github.com/primecitizens/pcz/std@v0.2.1/text/unicode/tables_lookup.go (about) 1 package unicode 2 3 func Category(c string) *RangeTable { 4 switch c { 5 case "C": 6 return C 7 case "Cc": 8 return Cc 9 case "Cf": 10 return Cf 11 case "Co": 12 return Co 13 case "Cs": 14 return Cs 15 case "L": 16 return L 17 case "Ll": 18 return Ll 19 case "Lm": 20 return Lm 21 case "Lo": 22 return Lo 23 case "Lt": 24 return Lt 25 case "Lu": 26 return Lu 27 case "M": 28 return M 29 case "Mc": 30 return Mc 31 case "Me": 32 return Me 33 case "Mn": 34 return Mn 35 case "N": 36 return N 37 case "Nd": 38 return Nd 39 case "Nl": 40 return Nl 41 case "No": 42 return No 43 case "P": 44 return P 45 case "Pc": 46 return Pc 47 case "Pd": 48 return Pd 49 case "Pe": 50 return Pe 51 case "Pf": 52 return Pf 53 case "Pi": 54 return Pi 55 case "Po": 56 return Po 57 case "Ps": 58 return Ps 59 case "S": 60 return S 61 case "Sc": 62 return Sc 63 case "Sk": 64 return Sk 65 case "Sm": 66 return Sm 67 case "So": 68 return So 69 case "Z": 70 return Z 71 case "Zl": 72 return Zl 73 case "Zp": 74 return Zp 75 case "Zs": 76 return Zs 77 default: 78 return nil 79 } 80 } 81 82 // Script maps a script name to a Unicode script table. 83 func Script(s string) *RangeTable { 84 switch s { 85 case "Adlam": 86 return Adlam 87 case "Ahom": 88 return Ahom 89 case "Anatolian_Hieroglyphs": 90 return Anatolian_Hieroglyphs 91 case "Arabic": 92 return Arabic 93 case "Armenian": 94 return Armenian 95 case "Avestan": 96 return Avestan 97 case "Balinese": 98 return Balinese 99 case "Bamum": 100 return Bamum 101 case "Bassa_Vah": 102 return Bassa_Vah 103 case "Batak": 104 return Batak 105 case "Bengali": 106 return Bengali 107 case "Bhaiksuki": 108 return Bhaiksuki 109 case "Bopomofo": 110 return Bopomofo 111 case "Brahmi": 112 return Brahmi 113 case "Braille": 114 return Braille 115 case "Buginese": 116 return Buginese 117 case "Buhid": 118 return Buhid 119 case "Canadian_Aboriginal": 120 return Canadian_Aboriginal 121 case "Carian": 122 return Carian 123 case "Caucasian_Albanian": 124 return Caucasian_Albanian 125 case "Chakma": 126 return Chakma 127 case "Cham": 128 return Cham 129 case "Cherokee": 130 return Cherokee 131 case "Chorasmian": 132 return Chorasmian 133 case "Common": 134 return Common 135 case "Coptic": 136 return Coptic 137 case "Cuneiform": 138 return Cuneiform 139 case "Cypriot": 140 return Cypriot 141 case "Cypro_Minoan": 142 return Cypro_Minoan 143 case "Cyrillic": 144 return Cyrillic 145 case "Deseret": 146 return Deseret 147 case "Devanagari": 148 return Devanagari 149 case "Dives_Akuru": 150 return Dives_Akuru 151 case "Dogra": 152 return Dogra 153 case "Duployan": 154 return Duployan 155 case "Egyptian_Hieroglyphs": 156 return Egyptian_Hieroglyphs 157 case "Elbasan": 158 return Elbasan 159 case "Elymaic": 160 return Elymaic 161 case "Ethiopic": 162 return Ethiopic 163 case "Georgian": 164 return Georgian 165 case "Glagolitic": 166 return Glagolitic 167 case "Gothic": 168 return Gothic 169 case "Grantha": 170 return Grantha 171 case "Greek": 172 return Greek 173 case "Gujarati": 174 return Gujarati 175 case "Gunjala_Gondi": 176 return Gunjala_Gondi 177 case "Gurmukhi": 178 return Gurmukhi 179 case "Han": 180 return Han 181 case "Hangul": 182 return Hangul 183 case "Hanifi_Rohingya": 184 return Hanifi_Rohingya 185 case "Hanunoo": 186 return Hanunoo 187 case "Hatran": 188 return Hatran 189 case "Hebrew": 190 return Hebrew 191 case "Hiragana": 192 return Hiragana 193 case "Imperial_Aramaic": 194 return Imperial_Aramaic 195 case "Inherited": 196 return Inherited 197 case "Inscriptional_Pahlavi": 198 return Inscriptional_Pahlavi 199 case "Inscriptional_Parthian": 200 return Inscriptional_Parthian 201 case "Javanese": 202 return Javanese 203 case "Kaithi": 204 return Kaithi 205 case "Kannada": 206 return Kannada 207 case "Katakana": 208 return Katakana 209 case "Kawi": 210 return Kawi 211 case "Kayah_Li": 212 return Kayah_Li 213 case "Kharoshthi": 214 return Kharoshthi 215 case "Khitan_Small_Script": 216 return Khitan_Small_Script 217 case "Khmer": 218 return Khmer 219 case "Khojki": 220 return Khojki 221 case "Khudawadi": 222 return Khudawadi 223 case "Lao": 224 return Lao 225 case "Latin": 226 return Latin 227 case "Lepcha": 228 return Lepcha 229 case "Limbu": 230 return Limbu 231 case "Linear_A": 232 return Linear_A 233 case "Linear_B": 234 return Linear_B 235 case "Lisu": 236 return Lisu 237 case "Lycian": 238 return Lycian 239 case "Lydian": 240 return Lydian 241 case "Mahajani": 242 return Mahajani 243 case "Makasar": 244 return Makasar 245 case "Malayalam": 246 return Malayalam 247 case "Mandaic": 248 return Mandaic 249 case "Manichaean": 250 return Manichaean 251 case "Marchen": 252 return Marchen 253 case "Masaram_Gondi": 254 return Masaram_Gondi 255 case "Medefaidrin": 256 return Medefaidrin 257 case "Meetei_Mayek": 258 return Meetei_Mayek 259 case "Mende_Kikakui": 260 return Mende_Kikakui 261 case "Meroitic_Cursive": 262 return Meroitic_Cursive 263 case "Meroitic_Hieroglyphs": 264 return Meroitic_Hieroglyphs 265 case "Miao": 266 return Miao 267 case "Modi": 268 return Modi 269 case "Mongolian": 270 return Mongolian 271 case "Mro": 272 return Mro 273 case "Multani": 274 return Multani 275 case "Myanmar": 276 return Myanmar 277 case "Nabataean": 278 return Nabataean 279 case "Nag_Mundari": 280 return Nag_Mundari 281 case "Nandinagari": 282 return Nandinagari 283 case "New_Tai_Lue": 284 return New_Tai_Lue 285 case "Newa": 286 return Newa 287 case "Nko": 288 return Nko 289 case "Nushu": 290 return Nushu 291 case "Nyiakeng_Puachue_Hmong": 292 return Nyiakeng_Puachue_Hmong 293 case "Ogham": 294 return Ogham 295 case "Ol_Chiki": 296 return Ol_Chiki 297 case "Old_Hungarian": 298 return Old_Hungarian 299 case "Old_Italic": 300 return Old_Italic 301 case "Old_North_Arabian": 302 return Old_North_Arabian 303 case "Old_Permic": 304 return Old_Permic 305 case "Old_Persian": 306 return Old_Persian 307 case "Old_Sogdian": 308 return Old_Sogdian 309 case "Old_South_Arabian": 310 return Old_South_Arabian 311 case "Old_Turkic": 312 return Old_Turkic 313 case "Old_Uyghur": 314 return Old_Uyghur 315 case "Oriya": 316 return Oriya 317 case "Osage": 318 return Osage 319 case "Osmanya": 320 return Osmanya 321 case "Pahawh_Hmong": 322 return Pahawh_Hmong 323 case "Palmyrene": 324 return Palmyrene 325 case "Pau_Cin_Hau": 326 return Pau_Cin_Hau 327 case "Phags_Pa": 328 return Phags_Pa 329 case "Phoenician": 330 return Phoenician 331 case "Psalter_Pahlavi": 332 return Psalter_Pahlavi 333 case "Rejang": 334 return Rejang 335 case "Runic": 336 return Runic 337 case "Samaritan": 338 return Samaritan 339 case "Saurashtra": 340 return Saurashtra 341 case "Sharada": 342 return Sharada 343 case "Shavian": 344 return Shavian 345 case "Siddham": 346 return Siddham 347 case "SignWriting": 348 return SignWriting 349 case "Sinhala": 350 return Sinhala 351 case "Sogdian": 352 return Sogdian 353 case "Sora_Sompeng": 354 return Sora_Sompeng 355 case "Soyombo": 356 return Soyombo 357 case "Sundanese": 358 return Sundanese 359 case "Syloti_Nagri": 360 return Syloti_Nagri 361 case "Syriac": 362 return Syriac 363 case "Tagalog": 364 return Tagalog 365 case "Tagbanwa": 366 return Tagbanwa 367 case "Tai_Le": 368 return Tai_Le 369 case "Tai_Tham": 370 return Tai_Tham 371 case "Tai_Viet": 372 return Tai_Viet 373 case "Takri": 374 return Takri 375 case "Tamil": 376 return Tamil 377 case "Tangsa": 378 return Tangsa 379 case "Tangut": 380 return Tangut 381 case "Telugu": 382 return Telugu 383 case "Thaana": 384 return Thaana 385 case "Thai": 386 return Thai 387 case "Tibetan": 388 return Tibetan 389 case "Tifinagh": 390 return Tifinagh 391 case "Tirhuta": 392 return Tirhuta 393 case "Toto": 394 return Toto 395 case "Ugaritic": 396 return Ugaritic 397 case "Vai": 398 return Vai 399 case "Vithkuqi": 400 return Vithkuqi 401 case "Wancho": 402 return Wancho 403 case "Warang_Citi": 404 return Warang_Citi 405 case "Yezidi": 406 return Yezidi 407 case "Yi": 408 return Yi 409 case "Zanabazar_Square": 410 return Zanabazar_Square 411 default: 412 return nil 413 } 414 } 415 416 // FoldCategory maps a category name to a table of 417 // code points outside the category that are equivalent under 418 // simple case folding to code points inside the category. 419 // If there is no entry for a category name, there are no such points. 420 func FoldCategory(c string) *RangeTable { 421 switch c { 422 case "L": 423 return foldL 424 case "Ll": 425 return foldLl 426 case "Lt": 427 return foldLt 428 case "Lu": 429 return foldLu 430 case "M": 431 return foldM 432 case "Mn": 433 return foldMn 434 default: 435 return nil 436 } 437 } 438 439 // FoldScript maps a script name to a table of 440 // code points outside the script that are equivalent under 441 // simple case folding to code points inside the script. 442 // If there is no entry for a script name, there are no such points. 443 func FoldScript(s string) *RangeTable { 444 switch s { 445 case "Common": 446 return foldCommon 447 case "Greek": 448 return foldGreek 449 case "Inherited": 450 return foldInherited 451 default: 452 return nil 453 } 454 } 455 456 // Property maps a property name to a Unicode property table. 457 func Property(s string) *RangeTable { 458 switch s { 459 case "ASCII_Hex_Digit": 460 return ASCII_Hex_Digit 461 case "Bidi_Control": 462 return Bidi_Control 463 case "Dash": 464 return Dash 465 case "Deprecated": 466 return Deprecated 467 case "Diacritic": 468 return Diacritic 469 case "Extender": 470 return Extender 471 case "Hex_Digit": 472 return Hex_Digit 473 case "Hyphen": 474 return Hyphen 475 case "IDS_Binary_Operator": 476 return IDS_Binary_Operator 477 case "IDS_Trinary_Operator": 478 return IDS_Trinary_Operator 479 case "Ideographic": 480 return Ideographic 481 case "Join_Control": 482 return Join_Control 483 case "Logical_Order_Exception": 484 return Logical_Order_Exception 485 case "Noncharacter_Code_Point": 486 return Noncharacter_Code_Point 487 case "Other_Alphabetic": 488 return Other_Alphabetic 489 case "Other_Default_Ignorable_Code_Point": 490 return Other_Default_Ignorable_Code_Point 491 case "Other_Grapheme_Extend": 492 return Other_Grapheme_Extend 493 case "Other_ID_Continue": 494 return Other_ID_Continue 495 case "Other_ID_Start": 496 return Other_ID_Start 497 case "Other_Lowercase": 498 return Other_Lowercase 499 case "Other_Math": 500 return Other_Math 501 case "Other_Uppercase": 502 return Other_Uppercase 503 case "Pattern_Syntax": 504 return Pattern_Syntax 505 case "Pattern_White_Space": 506 return Pattern_White_Space 507 case "Prepended_Concatenation_Mark": 508 return Prepended_Concatenation_Mark 509 case "Quotation_Mark": 510 return Quotation_Mark 511 case "Radical": 512 return Radical 513 case "Regional_Indicator": 514 return Regional_Indicator 515 case "Sentence_Terminal": 516 return Sentence_Terminal 517 case "STerm": 518 return Sentence_Terminal 519 case "Soft_Dotted": 520 return Soft_Dotted 521 case "Terminal_Punctuation": 522 return Terminal_Punctuation 523 case "Unified_Ideograph": 524 return Unified_Ideograph 525 case "Variation_Selector": 526 return Variation_Selector 527 case "White_Space": 528 return White_Space 529 default: 530 return nil 531 } 532 }