jpayne@7: # -*- coding: utf-8 -*- jpayne@7: from codecs import BOM_UTF8, BOM_UTF16_BE, BOM_UTF16_LE, BOM_UTF32_BE, BOM_UTF32_LE jpayne@7: from encodings.aliases import aliases jpayne@7: from re import IGNORECASE, compile as re_compile jpayne@7: from typing import Dict, List, Set, Union jpayne@7: jpayne@7: # Contain for each eligible encoding a list of/item bytes SIG/BOM jpayne@7: ENCODING_MARKS: Dict[str, Union[bytes, List[bytes]]] = { jpayne@7: "utf_8": BOM_UTF8, jpayne@7: "utf_7": [ jpayne@7: b"\x2b\x2f\x76\x38", jpayne@7: b"\x2b\x2f\x76\x39", jpayne@7: b"\x2b\x2f\x76\x2b", jpayne@7: b"\x2b\x2f\x76\x2f", jpayne@7: b"\x2b\x2f\x76\x38\x2d", jpayne@7: ], jpayne@7: "gb18030": b"\x84\x31\x95\x33", jpayne@7: "utf_32": [BOM_UTF32_BE, BOM_UTF32_LE], jpayne@7: "utf_16": [BOM_UTF16_BE, BOM_UTF16_LE], jpayne@7: } jpayne@7: jpayne@7: TOO_SMALL_SEQUENCE: int = 32 jpayne@7: TOO_BIG_SEQUENCE: int = int(10e6) jpayne@7: jpayne@7: UTF8_MAXIMAL_ALLOCATION: int = 1_112_064 jpayne@7: jpayne@7: # Up-to-date Unicode ucd/15.0.0 jpayne@7: UNICODE_RANGES_COMBINED: Dict[str, range] = { jpayne@7: "Control character": range(32), jpayne@7: "Basic Latin": range(32, 128), jpayne@7: "Latin-1 Supplement": range(128, 256), jpayne@7: "Latin Extended-A": range(256, 384), jpayne@7: "Latin Extended-B": range(384, 592), jpayne@7: "IPA Extensions": range(592, 688), jpayne@7: "Spacing Modifier Letters": range(688, 768), jpayne@7: "Combining Diacritical Marks": range(768, 880), jpayne@7: "Greek and Coptic": range(880, 1024), jpayne@7: "Cyrillic": range(1024, 1280), jpayne@7: "Cyrillic Supplement": range(1280, 1328), jpayne@7: "Armenian": range(1328, 1424), jpayne@7: "Hebrew": range(1424, 1536), jpayne@7: "Arabic": range(1536, 1792), jpayne@7: "Syriac": range(1792, 1872), jpayne@7: "Arabic Supplement": range(1872, 1920), jpayne@7: "Thaana": range(1920, 1984), jpayne@7: "NKo": range(1984, 2048), jpayne@7: "Samaritan": range(2048, 2112), jpayne@7: "Mandaic": range(2112, 2144), jpayne@7: "Syriac Supplement": range(2144, 2160), jpayne@7: "Arabic Extended-B": range(2160, 2208), jpayne@7: "Arabic Extended-A": range(2208, 2304), jpayne@7: "Devanagari": range(2304, 2432), jpayne@7: "Bengali": range(2432, 2560), jpayne@7: "Gurmukhi": range(2560, 2688), jpayne@7: "Gujarati": range(2688, 2816), jpayne@7: "Oriya": range(2816, 2944), jpayne@7: "Tamil": range(2944, 3072), jpayne@7: "Telugu": range(3072, 3200), jpayne@7: "Kannada": range(3200, 3328), jpayne@7: "Malayalam": range(3328, 3456), jpayne@7: "Sinhala": range(3456, 3584), jpayne@7: "Thai": range(3584, 3712), jpayne@7: "Lao": range(3712, 3840), jpayne@7: "Tibetan": range(3840, 4096), jpayne@7: "Myanmar": range(4096, 4256), jpayne@7: "Georgian": range(4256, 4352), jpayne@7: "Hangul Jamo": range(4352, 4608), jpayne@7: "Ethiopic": range(4608, 4992), jpayne@7: "Ethiopic Supplement": range(4992, 5024), jpayne@7: "Cherokee": range(5024, 5120), jpayne@7: "Unified Canadian Aboriginal Syllabics": range(5120, 5760), jpayne@7: "Ogham": range(5760, 5792), jpayne@7: "Runic": range(5792, 5888), jpayne@7: "Tagalog": range(5888, 5920), jpayne@7: "Hanunoo": range(5920, 5952), jpayne@7: "Buhid": range(5952, 5984), jpayne@7: "Tagbanwa": range(5984, 6016), jpayne@7: "Khmer": range(6016, 6144), jpayne@7: "Mongolian": range(6144, 6320), jpayne@7: "Unified Canadian Aboriginal Syllabics Extended": range(6320, 6400), jpayne@7: "Limbu": range(6400, 6480), jpayne@7: "Tai Le": range(6480, 6528), jpayne@7: "New Tai Lue": range(6528, 6624), jpayne@7: "Khmer Symbols": range(6624, 6656), jpayne@7: "Buginese": range(6656, 6688), jpayne@7: "Tai Tham": range(6688, 6832), jpayne@7: "Combining Diacritical Marks Extended": range(6832, 6912), jpayne@7: "Balinese": range(6912, 7040), jpayne@7: "Sundanese": range(7040, 7104), jpayne@7: "Batak": range(7104, 7168), jpayne@7: "Lepcha": range(7168, 7248), jpayne@7: "Ol Chiki": range(7248, 7296), jpayne@7: "Cyrillic Extended-C": range(7296, 7312), jpayne@7: "Georgian Extended": range(7312, 7360), jpayne@7: "Sundanese Supplement": range(7360, 7376), jpayne@7: "Vedic Extensions": range(7376, 7424), jpayne@7: "Phonetic Extensions": range(7424, 7552), jpayne@7: "Phonetic Extensions Supplement": range(7552, 7616), jpayne@7: "Combining Diacritical Marks Supplement": range(7616, 7680), jpayne@7: "Latin Extended Additional": range(7680, 7936), jpayne@7: "Greek Extended": range(7936, 8192), jpayne@7: "General Punctuation": range(8192, 8304), jpayne@7: "Superscripts and Subscripts": range(8304, 8352), jpayne@7: "Currency Symbols": range(8352, 8400), jpayne@7: "Combining Diacritical Marks for Symbols": range(8400, 8448), jpayne@7: "Letterlike Symbols": range(8448, 8528), jpayne@7: "Number Forms": range(8528, 8592), jpayne@7: "Arrows": range(8592, 8704), jpayne@7: "Mathematical Operators": range(8704, 8960), jpayne@7: "Miscellaneous Technical": range(8960, 9216), jpayne@7: "Control Pictures": range(9216, 9280), jpayne@7: "Optical Character Recognition": range(9280, 9312), jpayne@7: "Enclosed Alphanumerics": range(9312, 9472), jpayne@7: "Box Drawing": range(9472, 9600), jpayne@7: "Block Elements": range(9600, 9632), jpayne@7: "Geometric Shapes": range(9632, 9728), jpayne@7: "Miscellaneous Symbols": range(9728, 9984), jpayne@7: "Dingbats": range(9984, 10176), jpayne@7: "Miscellaneous Mathematical Symbols-A": range(10176, 10224), jpayne@7: "Supplemental Arrows-A": range(10224, 10240), jpayne@7: "Braille Patterns": range(10240, 10496), jpayne@7: "Supplemental Arrows-B": range(10496, 10624), jpayne@7: "Miscellaneous Mathematical Symbols-B": range(10624, 10752), jpayne@7: "Supplemental Mathematical Operators": range(10752, 11008), jpayne@7: "Miscellaneous Symbols and Arrows": range(11008, 11264), jpayne@7: "Glagolitic": range(11264, 11360), jpayne@7: "Latin Extended-C": range(11360, 11392), jpayne@7: "Coptic": range(11392, 11520), jpayne@7: "Georgian Supplement": range(11520, 11568), jpayne@7: "Tifinagh": range(11568, 11648), jpayne@7: "Ethiopic Extended": range(11648, 11744), jpayne@7: "Cyrillic Extended-A": range(11744, 11776), jpayne@7: "Supplemental Punctuation": range(11776, 11904), jpayne@7: "CJK Radicals Supplement": range(11904, 12032), jpayne@7: "Kangxi Radicals": range(12032, 12256), jpayne@7: "Ideographic Description Characters": range(12272, 12288), jpayne@7: "CJK Symbols and Punctuation": range(12288, 12352), jpayne@7: "Hiragana": range(12352, 12448), jpayne@7: "Katakana": range(12448, 12544), jpayne@7: "Bopomofo": range(12544, 12592), jpayne@7: "Hangul Compatibility Jamo": range(12592, 12688), jpayne@7: "Kanbun": range(12688, 12704), jpayne@7: "Bopomofo Extended": range(12704, 12736), jpayne@7: "CJK Strokes": range(12736, 12784), jpayne@7: "Katakana Phonetic Extensions": range(12784, 12800), jpayne@7: "Enclosed CJK Letters and Months": range(12800, 13056), jpayne@7: "CJK Compatibility": range(13056, 13312), jpayne@7: "CJK Unified Ideographs Extension A": range(13312, 19904), jpayne@7: "Yijing Hexagram Symbols": range(19904, 19968), jpayne@7: "CJK Unified Ideographs": range(19968, 40960), jpayne@7: "Yi Syllables": range(40960, 42128), jpayne@7: "Yi Radicals": range(42128, 42192), jpayne@7: "Lisu": range(42192, 42240), jpayne@7: "Vai": range(42240, 42560), jpayne@7: "Cyrillic Extended-B": range(42560, 42656), jpayne@7: "Bamum": range(42656, 42752), jpayne@7: "Modifier Tone Letters": range(42752, 42784), jpayne@7: "Latin Extended-D": range(42784, 43008), jpayne@7: "Syloti Nagri": range(43008, 43056), jpayne@7: "Common Indic Number Forms": range(43056, 43072), jpayne@7: "Phags-pa": range(43072, 43136), jpayne@7: "Saurashtra": range(43136, 43232), jpayne@7: "Devanagari Extended": range(43232, 43264), jpayne@7: "Kayah Li": range(43264, 43312), jpayne@7: "Rejang": range(43312, 43360), jpayne@7: "Hangul Jamo Extended-A": range(43360, 43392), jpayne@7: "Javanese": range(43392, 43488), jpayne@7: "Myanmar Extended-B": range(43488, 43520), jpayne@7: "Cham": range(43520, 43616), jpayne@7: "Myanmar Extended-A": range(43616, 43648), jpayne@7: "Tai Viet": range(43648, 43744), jpayne@7: "Meetei Mayek Extensions": range(43744, 43776), jpayne@7: "Ethiopic Extended-A": range(43776, 43824), jpayne@7: "Latin Extended-E": range(43824, 43888), jpayne@7: "Cherokee Supplement": range(43888, 43968), jpayne@7: "Meetei Mayek": range(43968, 44032), jpayne@7: "Hangul Syllables": range(44032, 55216), jpayne@7: "Hangul Jamo Extended-B": range(55216, 55296), jpayne@7: "High Surrogates": range(55296, 56192), jpayne@7: "High Private Use Surrogates": range(56192, 56320), jpayne@7: "Low Surrogates": range(56320, 57344), jpayne@7: "Private Use Area": range(57344, 63744), jpayne@7: "CJK Compatibility Ideographs": range(63744, 64256), jpayne@7: "Alphabetic Presentation Forms": range(64256, 64336), jpayne@7: "Arabic Presentation Forms-A": range(64336, 65024), jpayne@7: "Variation Selectors": range(65024, 65040), jpayne@7: "Vertical Forms": range(65040, 65056), jpayne@7: "Combining Half Marks": range(65056, 65072), jpayne@7: "CJK Compatibility Forms": range(65072, 65104), jpayne@7: "Small Form Variants": range(65104, 65136), jpayne@7: "Arabic Presentation Forms-B": range(65136, 65280), jpayne@7: "Halfwidth and Fullwidth Forms": range(65280, 65520), jpayne@7: "Specials": range(65520, 65536), jpayne@7: "Linear B Syllabary": range(65536, 65664), jpayne@7: "Linear B Ideograms": range(65664, 65792), jpayne@7: "Aegean Numbers": range(65792, 65856), jpayne@7: "Ancient Greek Numbers": range(65856, 65936), jpayne@7: "Ancient Symbols": range(65936, 66000), jpayne@7: "Phaistos Disc": range(66000, 66048), jpayne@7: "Lycian": range(66176, 66208), jpayne@7: "Carian": range(66208, 66272), jpayne@7: "Coptic Epact Numbers": range(66272, 66304), jpayne@7: "Old Italic": range(66304, 66352), jpayne@7: "Gothic": range(66352, 66384), jpayne@7: "Old Permic": range(66384, 66432), jpayne@7: "Ugaritic": range(66432, 66464), jpayne@7: "Old Persian": range(66464, 66528), jpayne@7: "Deseret": range(66560, 66640), jpayne@7: "Shavian": range(66640, 66688), jpayne@7: "Osmanya": range(66688, 66736), jpayne@7: "Osage": range(66736, 66816), jpayne@7: "Elbasan": range(66816, 66864), jpayne@7: "Caucasian Albanian": range(66864, 66928), jpayne@7: "Vithkuqi": range(66928, 67008), jpayne@7: "Linear A": range(67072, 67456), jpayne@7: "Latin Extended-F": range(67456, 67520), jpayne@7: "Cypriot Syllabary": range(67584, 67648), jpayne@7: "Imperial Aramaic": range(67648, 67680), jpayne@7: "Palmyrene": range(67680, 67712), jpayne@7: "Nabataean": range(67712, 67760), jpayne@7: "Hatran": range(67808, 67840), jpayne@7: "Phoenician": range(67840, 67872), jpayne@7: "Lydian": range(67872, 67904), jpayne@7: "Meroitic Hieroglyphs": range(67968, 68000), jpayne@7: "Meroitic Cursive": range(68000, 68096), jpayne@7: "Kharoshthi": range(68096, 68192), jpayne@7: "Old South Arabian": range(68192, 68224), jpayne@7: "Old North Arabian": range(68224, 68256), jpayne@7: "Manichaean": range(68288, 68352), jpayne@7: "Avestan": range(68352, 68416), jpayne@7: "Inscriptional Parthian": range(68416, 68448), jpayne@7: "Inscriptional Pahlavi": range(68448, 68480), jpayne@7: "Psalter Pahlavi": range(68480, 68528), jpayne@7: "Old Turkic": range(68608, 68688), jpayne@7: "Old Hungarian": range(68736, 68864), jpayne@7: "Hanifi Rohingya": range(68864, 68928), jpayne@7: "Rumi Numeral Symbols": range(69216, 69248), jpayne@7: "Yezidi": range(69248, 69312), jpayne@7: "Arabic Extended-C": range(69312, 69376), jpayne@7: "Old Sogdian": range(69376, 69424), jpayne@7: "Sogdian": range(69424, 69488), jpayne@7: "Old Uyghur": range(69488, 69552), jpayne@7: "Chorasmian": range(69552, 69600), jpayne@7: "Elymaic": range(69600, 69632), jpayne@7: "Brahmi": range(69632, 69760), jpayne@7: "Kaithi": range(69760, 69840), jpayne@7: "Sora Sompeng": range(69840, 69888), jpayne@7: "Chakma": range(69888, 69968), jpayne@7: "Mahajani": range(69968, 70016), jpayne@7: "Sharada": range(70016, 70112), jpayne@7: "Sinhala Archaic Numbers": range(70112, 70144), jpayne@7: "Khojki": range(70144, 70224), jpayne@7: "Multani": range(70272, 70320), jpayne@7: "Khudawadi": range(70320, 70400), jpayne@7: "Grantha": range(70400, 70528), jpayne@7: "Newa": range(70656, 70784), jpayne@7: "Tirhuta": range(70784, 70880), jpayne@7: "Siddham": range(71040, 71168), jpayne@7: "Modi": range(71168, 71264), jpayne@7: "Mongolian Supplement": range(71264, 71296), jpayne@7: "Takri": range(71296, 71376), jpayne@7: "Ahom": range(71424, 71504), jpayne@7: "Dogra": range(71680, 71760), jpayne@7: "Warang Citi": range(71840, 71936), jpayne@7: "Dives Akuru": range(71936, 72032), jpayne@7: "Nandinagari": range(72096, 72192), jpayne@7: "Zanabazar Square": range(72192, 72272), jpayne@7: "Soyombo": range(72272, 72368), jpayne@7: "Unified Canadian Aboriginal Syllabics Extended-A": range(72368, 72384), jpayne@7: "Pau Cin Hau": range(72384, 72448), jpayne@7: "Devanagari Extended-A": range(72448, 72544), jpayne@7: "Bhaiksuki": range(72704, 72816), jpayne@7: "Marchen": range(72816, 72896), jpayne@7: "Masaram Gondi": range(72960, 73056), jpayne@7: "Gunjala Gondi": range(73056, 73136), jpayne@7: "Makasar": range(73440, 73472), jpayne@7: "Kawi": range(73472, 73568), jpayne@7: "Lisu Supplement": range(73648, 73664), jpayne@7: "Tamil Supplement": range(73664, 73728), jpayne@7: "Cuneiform": range(73728, 74752), jpayne@7: "Cuneiform Numbers and Punctuation": range(74752, 74880), jpayne@7: "Early Dynastic Cuneiform": range(74880, 75088), jpayne@7: "Cypro-Minoan": range(77712, 77824), jpayne@7: "Egyptian Hieroglyphs": range(77824, 78896), jpayne@7: "Egyptian Hieroglyph Format Controls": range(78896, 78944), jpayne@7: "Anatolian Hieroglyphs": range(82944, 83584), jpayne@7: "Bamum Supplement": range(92160, 92736), jpayne@7: "Mro": range(92736, 92784), jpayne@7: "Tangsa": range(92784, 92880), jpayne@7: "Bassa Vah": range(92880, 92928), jpayne@7: "Pahawh Hmong": range(92928, 93072), jpayne@7: "Medefaidrin": range(93760, 93856), jpayne@7: "Miao": range(93952, 94112), jpayne@7: "Ideographic Symbols and Punctuation": range(94176, 94208), jpayne@7: "Tangut": range(94208, 100352), jpayne@7: "Tangut Components": range(100352, 101120), jpayne@7: "Khitan Small Script": range(101120, 101632), jpayne@7: "Tangut Supplement": range(101632, 101760), jpayne@7: "Kana Extended-B": range(110576, 110592), jpayne@7: "Kana Supplement": range(110592, 110848), jpayne@7: "Kana Extended-A": range(110848, 110896), jpayne@7: "Small Kana Extension": range(110896, 110960), jpayne@7: "Nushu": range(110960, 111360), jpayne@7: "Duployan": range(113664, 113824), jpayne@7: "Shorthand Format Controls": range(113824, 113840), jpayne@7: "Znamenny Musical Notation": range(118528, 118736), jpayne@7: "Byzantine Musical Symbols": range(118784, 119040), jpayne@7: "Musical Symbols": range(119040, 119296), jpayne@7: "Ancient Greek Musical Notation": range(119296, 119376), jpayne@7: "Kaktovik Numerals": range(119488, 119520), jpayne@7: "Mayan Numerals": range(119520, 119552), jpayne@7: "Tai Xuan Jing Symbols": range(119552, 119648), jpayne@7: "Counting Rod Numerals": range(119648, 119680), jpayne@7: "Mathematical Alphanumeric Symbols": range(119808, 120832), jpayne@7: "Sutton SignWriting": range(120832, 121520), jpayne@7: "Latin Extended-G": range(122624, 122880), jpayne@7: "Glagolitic Supplement": range(122880, 122928), jpayne@7: "Cyrillic Extended-D": range(122928, 123024), jpayne@7: "Nyiakeng Puachue Hmong": range(123136, 123216), jpayne@7: "Toto": range(123536, 123584), jpayne@7: "Wancho": range(123584, 123648), jpayne@7: "Nag Mundari": range(124112, 124160), jpayne@7: "Ethiopic Extended-B": range(124896, 124928), jpayne@7: "Mende Kikakui": range(124928, 125152), jpayne@7: "Adlam": range(125184, 125280), jpayne@7: "Indic Siyaq Numbers": range(126064, 126144), jpayne@7: "Ottoman Siyaq Numbers": range(126208, 126288), jpayne@7: "Arabic Mathematical Alphabetic Symbols": range(126464, 126720), jpayne@7: "Mahjong Tiles": range(126976, 127024), jpayne@7: "Domino Tiles": range(127024, 127136), jpayne@7: "Playing Cards": range(127136, 127232), jpayne@7: "Enclosed Alphanumeric Supplement": range(127232, 127488), jpayne@7: "Enclosed Ideographic Supplement": range(127488, 127744), jpayne@7: "Miscellaneous Symbols and Pictographs": range(127744, 128512), jpayne@7: "Emoticons range(Emoji)": range(128512, 128592), jpayne@7: "Ornamental Dingbats": range(128592, 128640), jpayne@7: "Transport and Map Symbols": range(128640, 128768), jpayne@7: "Alchemical Symbols": range(128768, 128896), jpayne@7: "Geometric Shapes Extended": range(128896, 129024), jpayne@7: "Supplemental Arrows-C": range(129024, 129280), jpayne@7: "Supplemental Symbols and Pictographs": range(129280, 129536), jpayne@7: "Chess Symbols": range(129536, 129648), jpayne@7: "Symbols and Pictographs Extended-A": range(129648, 129792), jpayne@7: "Symbols for Legacy Computing": range(129792, 130048), jpayne@7: "CJK Unified Ideographs Extension B": range(131072, 173792), jpayne@7: "CJK Unified Ideographs Extension C": range(173824, 177984), jpayne@7: "CJK Unified Ideographs Extension D": range(177984, 178208), jpayne@7: "CJK Unified Ideographs Extension E": range(178208, 183984), jpayne@7: "CJK Unified Ideographs Extension F": range(183984, 191472), jpayne@7: "CJK Compatibility Ideographs Supplement": range(194560, 195104), jpayne@7: "CJK Unified Ideographs Extension G": range(196608, 201552), jpayne@7: "CJK Unified Ideographs Extension H": range(201552, 205744), jpayne@7: "Tags": range(917504, 917632), jpayne@7: "Variation Selectors Supplement": range(917760, 918000), jpayne@7: "Supplementary Private Use Area-A": range(983040, 1048576), jpayne@7: "Supplementary Private Use Area-B": range(1048576, 1114112), jpayne@7: } jpayne@7: jpayne@7: jpayne@7: UNICODE_SECONDARY_RANGE_KEYWORD: List[str] = [ jpayne@7: "Supplement", jpayne@7: "Extended", jpayne@7: "Extensions", jpayne@7: "Modifier", jpayne@7: "Marks", jpayne@7: "Punctuation", jpayne@7: "Symbols", jpayne@7: "Forms", jpayne@7: "Operators", jpayne@7: "Miscellaneous", jpayne@7: "Drawing", jpayne@7: "Block", jpayne@7: "Shapes", jpayne@7: "Supplemental", jpayne@7: "Tags", jpayne@7: ] jpayne@7: jpayne@7: RE_POSSIBLE_ENCODING_INDICATION = re_compile( jpayne@7: r"(?:(?:encoding)|(?:charset)|(?:coding))(?:[\:= ]{1,10})(?:[\"\']?)([a-zA-Z0-9\-_]+)(?:[\"\']?)", jpayne@7: IGNORECASE, jpayne@7: ) jpayne@7: jpayne@7: IANA_NO_ALIASES = [ jpayne@7: "cp720", jpayne@7: "cp737", jpayne@7: "cp856", jpayne@7: "cp874", jpayne@7: "cp875", jpayne@7: "cp1006", jpayne@7: "koi8_r", jpayne@7: "koi8_t", jpayne@7: "koi8_u", jpayne@7: ] jpayne@7: jpayne@7: IANA_SUPPORTED: List[str] = sorted( jpayne@7: filter( jpayne@7: lambda x: x.endswith("_codec") is False jpayne@7: and x not in {"rot_13", "tactis", "mbcs"}, jpayne@7: list(set(aliases.values())) + IANA_NO_ALIASES, jpayne@7: ) jpayne@7: ) jpayne@7: jpayne@7: IANA_SUPPORTED_COUNT: int = len(IANA_SUPPORTED) jpayne@7: jpayne@7: # pre-computed code page that are similar using the function cp_similarity. jpayne@7: IANA_SUPPORTED_SIMILAR: Dict[str, List[str]] = { jpayne@7: "cp037": ["cp1026", "cp1140", "cp273", "cp500"], jpayne@7: "cp1026": ["cp037", "cp1140", "cp273", "cp500"], jpayne@7: "cp1125": ["cp866"], jpayne@7: "cp1140": ["cp037", "cp1026", "cp273", "cp500"], jpayne@7: "cp1250": ["iso8859_2"], jpayne@7: "cp1251": ["kz1048", "ptcp154"], jpayne@7: "cp1252": ["iso8859_15", "iso8859_9", "latin_1"], jpayne@7: "cp1253": ["iso8859_7"], jpayne@7: "cp1254": ["iso8859_15", "iso8859_9", "latin_1"], jpayne@7: "cp1257": ["iso8859_13"], jpayne@7: "cp273": ["cp037", "cp1026", "cp1140", "cp500"], jpayne@7: "cp437": ["cp850", "cp858", "cp860", "cp861", "cp862", "cp863", "cp865"], jpayne@7: "cp500": ["cp037", "cp1026", "cp1140", "cp273"], jpayne@7: "cp850": ["cp437", "cp857", "cp858", "cp865"], jpayne@7: "cp857": ["cp850", "cp858", "cp865"], jpayne@7: "cp858": ["cp437", "cp850", "cp857", "cp865"], jpayne@7: "cp860": ["cp437", "cp861", "cp862", "cp863", "cp865"], jpayne@7: "cp861": ["cp437", "cp860", "cp862", "cp863", "cp865"], jpayne@7: "cp862": ["cp437", "cp860", "cp861", "cp863", "cp865"], jpayne@7: "cp863": ["cp437", "cp860", "cp861", "cp862", "cp865"], jpayne@7: "cp865": ["cp437", "cp850", "cp857", "cp858", "cp860", "cp861", "cp862", "cp863"], jpayne@7: "cp866": ["cp1125"], jpayne@7: "iso8859_10": ["iso8859_14", "iso8859_15", "iso8859_4", "iso8859_9", "latin_1"], jpayne@7: "iso8859_11": ["tis_620"], jpayne@7: "iso8859_13": ["cp1257"], jpayne@7: "iso8859_14": [ jpayne@7: "iso8859_10", jpayne@7: "iso8859_15", jpayne@7: "iso8859_16", jpayne@7: "iso8859_3", jpayne@7: "iso8859_9", jpayne@7: "latin_1", jpayne@7: ], jpayne@7: "iso8859_15": [ jpayne@7: "cp1252", jpayne@7: "cp1254", jpayne@7: "iso8859_10", jpayne@7: "iso8859_14", jpayne@7: "iso8859_16", jpayne@7: "iso8859_3", jpayne@7: "iso8859_9", jpayne@7: "latin_1", jpayne@7: ], jpayne@7: "iso8859_16": [ jpayne@7: "iso8859_14", jpayne@7: "iso8859_15", jpayne@7: "iso8859_2", jpayne@7: "iso8859_3", jpayne@7: "iso8859_9", jpayne@7: "latin_1", jpayne@7: ], jpayne@7: "iso8859_2": ["cp1250", "iso8859_16", "iso8859_4"], jpayne@7: "iso8859_3": ["iso8859_14", "iso8859_15", "iso8859_16", "iso8859_9", "latin_1"], jpayne@7: "iso8859_4": ["iso8859_10", "iso8859_2", "iso8859_9", "latin_1"], jpayne@7: "iso8859_7": ["cp1253"], jpayne@7: "iso8859_9": [ jpayne@7: "cp1252", jpayne@7: "cp1254", jpayne@7: "cp1258", jpayne@7: "iso8859_10", jpayne@7: "iso8859_14", jpayne@7: "iso8859_15", jpayne@7: "iso8859_16", jpayne@7: "iso8859_3", jpayne@7: "iso8859_4", jpayne@7: "latin_1", jpayne@7: ], jpayne@7: "kz1048": ["cp1251", "ptcp154"], jpayne@7: "latin_1": [ jpayne@7: "cp1252", jpayne@7: "cp1254", jpayne@7: "cp1258", jpayne@7: "iso8859_10", jpayne@7: "iso8859_14", jpayne@7: "iso8859_15", jpayne@7: "iso8859_16", jpayne@7: "iso8859_3", jpayne@7: "iso8859_4", jpayne@7: "iso8859_9", jpayne@7: ], jpayne@7: "mac_iceland": ["mac_roman", "mac_turkish"], jpayne@7: "mac_roman": ["mac_iceland", "mac_turkish"], jpayne@7: "mac_turkish": ["mac_iceland", "mac_roman"], jpayne@7: "ptcp154": ["cp1251", "kz1048"], jpayne@7: "tis_620": ["iso8859_11"], jpayne@7: } jpayne@7: jpayne@7: jpayne@7: CHARDET_CORRESPONDENCE: Dict[str, str] = { jpayne@7: "iso2022_kr": "ISO-2022-KR", jpayne@7: "iso2022_jp": "ISO-2022-JP", jpayne@7: "euc_kr": "EUC-KR", jpayne@7: "tis_620": "TIS-620", jpayne@7: "utf_32": "UTF-32", jpayne@7: "euc_jp": "EUC-JP", jpayne@7: "koi8_r": "KOI8-R", jpayne@7: "iso8859_1": "ISO-8859-1", jpayne@7: "iso8859_2": "ISO-8859-2", jpayne@7: "iso8859_5": "ISO-8859-5", jpayne@7: "iso8859_6": "ISO-8859-6", jpayne@7: "iso8859_7": "ISO-8859-7", jpayne@7: "iso8859_8": "ISO-8859-8", jpayne@7: "utf_16": "UTF-16", jpayne@7: "cp855": "IBM855", jpayne@7: "mac_cyrillic": "MacCyrillic", jpayne@7: "gb2312": "GB2312", jpayne@7: "gb18030": "GB18030", jpayne@7: "cp932": "CP932", jpayne@7: "cp866": "IBM866", jpayne@7: "utf_8": "utf-8", jpayne@7: "utf_8_sig": "UTF-8-SIG", jpayne@7: "shift_jis": "SHIFT_JIS", jpayne@7: "big5": "Big5", jpayne@7: "cp1250": "windows-1250", jpayne@7: "cp1251": "windows-1251", jpayne@7: "cp1252": "Windows-1252", jpayne@7: "cp1253": "windows-1253", jpayne@7: "cp1255": "windows-1255", jpayne@7: "cp1256": "windows-1256", jpayne@7: "cp1254": "Windows-1254", jpayne@7: "cp949": "CP949", jpayne@7: } jpayne@7: jpayne@7: jpayne@7: COMMON_SAFE_ASCII_CHARACTERS: Set[str] = { jpayne@7: "<", jpayne@7: ">", jpayne@7: "=", jpayne@7: ":", jpayne@7: "/", jpayne@7: "&", jpayne@7: ";", jpayne@7: "{", jpayne@7: "}", jpayne@7: "[", jpayne@7: "]", jpayne@7: ",", jpayne@7: "|", jpayne@7: '"', jpayne@7: "-", jpayne@7: } jpayne@7: jpayne@7: jpayne@7: KO_NAMES: Set[str] = {"johab", "cp949", "euc_kr"} jpayne@7: ZH_NAMES: Set[str] = {"big5", "cp950", "big5hkscs", "hz"} jpayne@7: jpayne@7: # Logging LEVEL below DEBUG jpayne@7: TRACE: int = 5 jpayne@7: jpayne@7: jpayne@7: # Language label that contain the em dash "—" jpayne@7: # character are to be considered alternative seq to origin jpayne@7: FREQUENCIES: Dict[str, List[str]] = { jpayne@7: "English": [ jpayne@7: "e", jpayne@7: "a", jpayne@7: "t", jpayne@7: "i", jpayne@7: "o", jpayne@7: "n", jpayne@7: "s", jpayne@7: "r", jpayne@7: "h", jpayne@7: "l", jpayne@7: "d", jpayne@7: "c", jpayne@7: "u", jpayne@7: "m", jpayne@7: "f", jpayne@7: "p", jpayne@7: "g", jpayne@7: "w", jpayne@7: "y", jpayne@7: "b", jpayne@7: "v", jpayne@7: "k", jpayne@7: "x", jpayne@7: "j", jpayne@7: "z", jpayne@7: "q", jpayne@7: ], jpayne@7: "English—": [ jpayne@7: "e", jpayne@7: "a", jpayne@7: "t", jpayne@7: "i", jpayne@7: "o", jpayne@7: "n", jpayne@7: "s", jpayne@7: "r", jpayne@7: "h", jpayne@7: "l", jpayne@7: "d", jpayne@7: "c", jpayne@7: "m", jpayne@7: "u", jpayne@7: "f", jpayne@7: "p", jpayne@7: "g", jpayne@7: "w", jpayne@7: "b", jpayne@7: "y", jpayne@7: "v", jpayne@7: "k", jpayne@7: "j", jpayne@7: "x", jpayne@7: "z", jpayne@7: "q", jpayne@7: ], jpayne@7: "German": [ jpayne@7: "e", jpayne@7: "n", jpayne@7: "i", jpayne@7: "r", jpayne@7: "s", jpayne@7: "t", jpayne@7: "a", jpayne@7: "d", jpayne@7: "h", jpayne@7: "u", jpayne@7: "l", jpayne@7: "g", jpayne@7: "o", jpayne@7: "c", jpayne@7: "m", jpayne@7: "b", jpayne@7: "f", jpayne@7: "k", jpayne@7: "w", jpayne@7: "z", jpayne@7: "p", jpayne@7: "v", jpayne@7: "ü", jpayne@7: "ä", jpayne@7: "ö", jpayne@7: "j", jpayne@7: ], jpayne@7: "French": [ jpayne@7: "e", jpayne@7: "a", jpayne@7: "s", jpayne@7: "n", jpayne@7: "i", jpayne@7: "t", jpayne@7: "r", jpayne@7: "l", jpayne@7: "u", jpayne@7: "o", jpayne@7: "d", jpayne@7: "c", jpayne@7: "p", jpayne@7: "m", jpayne@7: "é", jpayne@7: "v", jpayne@7: "g", jpayne@7: "f", jpayne@7: "b", jpayne@7: "h", jpayne@7: "q", jpayne@7: "à", jpayne@7: "x", jpayne@7: "è", jpayne@7: "y", jpayne@7: "j", jpayne@7: ], jpayne@7: "Dutch": [ jpayne@7: "e", jpayne@7: "n", jpayne@7: "a", jpayne@7: "i", jpayne@7: "r", jpayne@7: "t", jpayne@7: "o", jpayne@7: "d", jpayne@7: "s", jpayne@7: "l", jpayne@7: "g", jpayne@7: "h", jpayne@7: "v", jpayne@7: "m", jpayne@7: "u", jpayne@7: "k", jpayne@7: "c", jpayne@7: "p", jpayne@7: "b", jpayne@7: "w", jpayne@7: "j", jpayne@7: "z", jpayne@7: "f", jpayne@7: "y", jpayne@7: "x", jpayne@7: "ë", jpayne@7: ], jpayne@7: "Italian": [ jpayne@7: "e", jpayne@7: "i", jpayne@7: "a", jpayne@7: "o", jpayne@7: "n", jpayne@7: "l", jpayne@7: "t", jpayne@7: "r", jpayne@7: "s", jpayne@7: "c", jpayne@7: "d", jpayne@7: "u", jpayne@7: "p", jpayne@7: "m", jpayne@7: "g", jpayne@7: "v", jpayne@7: "f", jpayne@7: "b", jpayne@7: "z", jpayne@7: "h", jpayne@7: "q", jpayne@7: "è", jpayne@7: "à", jpayne@7: "k", jpayne@7: "y", jpayne@7: "ò", jpayne@7: ], jpayne@7: "Polish": [ jpayne@7: "a", jpayne@7: "i", jpayne@7: "o", jpayne@7: "e", jpayne@7: "n", jpayne@7: "r", jpayne@7: "z", jpayne@7: "w", jpayne@7: "s", jpayne@7: "c", jpayne@7: "t", jpayne@7: "k", jpayne@7: "y", jpayne@7: "d", jpayne@7: "p", jpayne@7: "m", jpayne@7: "u", jpayne@7: "l", jpayne@7: "j", jpayne@7: "ł", jpayne@7: "g", jpayne@7: "b", jpayne@7: "h", jpayne@7: "ą", jpayne@7: "ę", jpayne@7: "ó", jpayne@7: ], jpayne@7: "Spanish": [ jpayne@7: "e", jpayne@7: "a", jpayne@7: "o", jpayne@7: "n", jpayne@7: "s", jpayne@7: "r", jpayne@7: "i", jpayne@7: "l", jpayne@7: "d", jpayne@7: "t", jpayne@7: "c", jpayne@7: "u", jpayne@7: "m", jpayne@7: "p", jpayne@7: "b", jpayne@7: "g", jpayne@7: "v", jpayne@7: "f", jpayne@7: "y", jpayne@7: "ó", jpayne@7: "h", jpayne@7: "q", jpayne@7: "í", jpayne@7: "j", jpayne@7: "z", jpayne@7: "á", jpayne@7: ], jpayne@7: "Russian": [ jpayne@7: "о", jpayne@7: "а", jpayne@7: "е", jpayne@7: "и", jpayne@7: "н", jpayne@7: "с", jpayne@7: "т", jpayne@7: "р", jpayne@7: "в", jpayne@7: "л", jpayne@7: "к", jpayne@7: "м", jpayne@7: "д", jpayne@7: "п", jpayne@7: "у", jpayne@7: "г", jpayne@7: "я", jpayne@7: "ы", jpayne@7: "з", jpayne@7: "б", jpayne@7: "й", jpayne@7: "ь", jpayne@7: "ч", jpayne@7: "х", jpayne@7: "ж", jpayne@7: "ц", jpayne@7: ], jpayne@7: # Jap-Kanji jpayne@7: "Japanese": [ jpayne@7: "人", jpayne@7: "一", jpayne@7: "大", jpayne@7: "亅", jpayne@7: "丁", jpayne@7: "丨", jpayne@7: "竹", jpayne@7: "笑", jpayne@7: "口", jpayne@7: "日", jpayne@7: "今", jpayne@7: "二", jpayne@7: "彳", jpayne@7: "行", jpayne@7: "十", jpayne@7: "土", jpayne@7: "丶", jpayne@7: "寸", jpayne@7: "寺", jpayne@7: "時", jpayne@7: "乙", jpayne@7: "丿", jpayne@7: "乂", jpayne@7: "气", jpayne@7: "気", jpayne@7: "冂", jpayne@7: "巾", jpayne@7: "亠", jpayne@7: "市", jpayne@7: "目", jpayne@7: "儿", jpayne@7: "見", jpayne@7: "八", jpayne@7: "小", jpayne@7: "凵", jpayne@7: "県", jpayne@7: "月", jpayne@7: "彐", jpayne@7: "門", jpayne@7: "間", jpayne@7: "木", jpayne@7: "東", jpayne@7: "山", jpayne@7: "出", jpayne@7: "本", jpayne@7: "中", jpayne@7: "刀", jpayne@7: "分", jpayne@7: "耳", jpayne@7: "又", jpayne@7: "取", jpayne@7: "最", jpayne@7: "言", jpayne@7: "田", jpayne@7: "心", jpayne@7: "思", jpayne@7: "刂", jpayne@7: "前", jpayne@7: "京", jpayne@7: "尹", jpayne@7: "事", jpayne@7: "生", jpayne@7: "厶", jpayne@7: "云", jpayne@7: "会", jpayne@7: "未", jpayne@7: "来", jpayne@7: "白", jpayne@7: "冫", jpayne@7: "楽", jpayne@7: "灬", jpayne@7: "馬", jpayne@7: "尸", jpayne@7: "尺", jpayne@7: "駅", jpayne@7: "明", jpayne@7: "耂", jpayne@7: "者", jpayne@7: "了", jpayne@7: "阝", jpayne@7: "都", jpayne@7: "高", jpayne@7: "卜", jpayne@7: "占", jpayne@7: "厂", jpayne@7: "广", jpayne@7: "店", jpayne@7: "子", jpayne@7: "申", jpayne@7: "奄", jpayne@7: "亻", jpayne@7: "俺", jpayne@7: "上", jpayne@7: "方", jpayne@7: "冖", jpayne@7: "学", jpayne@7: "衣", jpayne@7: "艮", jpayne@7: "食", jpayne@7: "自", jpayne@7: ], jpayne@7: # Jap-Katakana jpayne@7: "Japanese—": [ jpayne@7: "ー", jpayne@7: "ン", jpayne@7: "ス", jpayne@7: "・", jpayne@7: "ル", jpayne@7: "ト", jpayne@7: "リ", jpayne@7: "イ", jpayne@7: "ア", jpayne@7: "ラ", jpayne@7: "ッ", jpayne@7: "ク", jpayne@7: "ド", jpayne@7: "シ", jpayne@7: "レ", jpayne@7: "ジ", jpayne@7: "タ", jpayne@7: "フ", jpayne@7: "ロ", jpayne@7: "カ", jpayne@7: "テ", jpayne@7: "マ", jpayne@7: "ィ", jpayne@7: "グ", jpayne@7: "バ", jpayne@7: "ム", jpayne@7: "プ", jpayne@7: "オ", jpayne@7: "コ", jpayne@7: "デ", jpayne@7: "ニ", jpayne@7: "ウ", jpayne@7: "メ", jpayne@7: "サ", jpayne@7: "ビ", jpayne@7: "ナ", jpayne@7: "ブ", jpayne@7: "ャ", jpayne@7: "エ", jpayne@7: "ュ", jpayne@7: "チ", jpayne@7: "キ", jpayne@7: "ズ", jpayne@7: "ダ", jpayne@7: "パ", jpayne@7: "ミ", jpayne@7: "ェ", jpayne@7: "ョ", jpayne@7: "ハ", jpayne@7: "セ", jpayne@7: "ベ", jpayne@7: "ガ", jpayne@7: "モ", jpayne@7: "ツ", jpayne@7: "ネ", jpayne@7: "ボ", jpayne@7: "ソ", jpayne@7: "ノ", jpayne@7: "ァ", jpayne@7: "ヴ", jpayne@7: "ワ", jpayne@7: "ポ", jpayne@7: "ペ", jpayne@7: "ピ", jpayne@7: "ケ", jpayne@7: "ゴ", jpayne@7: "ギ", jpayne@7: "ザ", jpayne@7: "ホ", jpayne@7: "ゲ", jpayne@7: "ォ", jpayne@7: "ヤ", jpayne@7: "ヒ", jpayne@7: "ユ", jpayne@7: "ヨ", jpayne@7: "ヘ", jpayne@7: "ゼ", jpayne@7: "ヌ", jpayne@7: "ゥ", jpayne@7: "ゾ", jpayne@7: "ヶ", jpayne@7: "ヂ", jpayne@7: "ヲ", jpayne@7: "ヅ", jpayne@7: "ヵ", jpayne@7: "ヱ", jpayne@7: "ヰ", jpayne@7: "ヮ", jpayne@7: "ヽ", jpayne@7: "゠", jpayne@7: "ヾ", jpayne@7: "ヷ", jpayne@7: "ヿ", jpayne@7: "ヸ", jpayne@7: "ヹ", jpayne@7: "ヺ", jpayne@7: ], jpayne@7: # Jap-Hiragana jpayne@7: "Japanese——": [ jpayne@7: "の", jpayne@7: "に", jpayne@7: "る", jpayne@7: "た", jpayne@7: "と", jpayne@7: "は", jpayne@7: "し", jpayne@7: "い", jpayne@7: "を", jpayne@7: "で", jpayne@7: "て", jpayne@7: "が", jpayne@7: "な", jpayne@7: "れ", jpayne@7: "か", jpayne@7: "ら", jpayne@7: "さ", jpayne@7: "っ", jpayne@7: "り", jpayne@7: "す", jpayne@7: "あ", jpayne@7: "も", jpayne@7: "こ", jpayne@7: "ま", jpayne@7: "う", jpayne@7: "く", jpayne@7: "よ", jpayne@7: "き", jpayne@7: "ん", jpayne@7: "め", jpayne@7: "お", jpayne@7: "け", jpayne@7: "そ", jpayne@7: "つ", jpayne@7: "だ", jpayne@7: "や", jpayne@7: "え", jpayne@7: "ど", jpayne@7: "わ", jpayne@7: "ち", jpayne@7: "み", jpayne@7: "せ", jpayne@7: "じ", jpayne@7: "ば", jpayne@7: "へ", jpayne@7: "び", jpayne@7: "ず", jpayne@7: "ろ", jpayne@7: "ほ", jpayne@7: "げ", jpayne@7: "む", jpayne@7: "べ", jpayne@7: "ひ", jpayne@7: "ょ", jpayne@7: "ゆ", jpayne@7: "ぶ", jpayne@7: "ご", jpayne@7: "ゃ", jpayne@7: "ね", jpayne@7: "ふ", jpayne@7: "ぐ", jpayne@7: "ぎ", jpayne@7: "ぼ", jpayne@7: "ゅ", jpayne@7: "づ", jpayne@7: "ざ", jpayne@7: "ぞ", jpayne@7: "ぬ", jpayne@7: "ぜ", jpayne@7: "ぱ", jpayne@7: "ぽ", jpayne@7: "ぷ", jpayne@7: "ぴ", jpayne@7: "ぃ", jpayne@7: "ぁ", jpayne@7: "ぇ", jpayne@7: "ぺ", jpayne@7: "ゞ", jpayne@7: "ぢ", jpayne@7: "ぉ", jpayne@7: "ぅ", jpayne@7: "ゐ", jpayne@7: "ゝ", jpayne@7: "ゑ", jpayne@7: "゛", jpayne@7: "゜", jpayne@7: "ゎ", jpayne@7: "ゔ", jpayne@7: "゚", jpayne@7: "ゟ", jpayne@7: "゙", jpayne@7: "ゕ", jpayne@7: "ゖ", jpayne@7: ], jpayne@7: "Portuguese": [ jpayne@7: "a", jpayne@7: "e", jpayne@7: "o", jpayne@7: "s", jpayne@7: "i", jpayne@7: "r", jpayne@7: "d", jpayne@7: "n", jpayne@7: "t", jpayne@7: "m", jpayne@7: "u", jpayne@7: "c", jpayne@7: "l", jpayne@7: "p", jpayne@7: "g", jpayne@7: "v", jpayne@7: "b", jpayne@7: "f", jpayne@7: "h", jpayne@7: "ã", jpayne@7: "q", jpayne@7: "é", jpayne@7: "ç", jpayne@7: "á", jpayne@7: "z", jpayne@7: "í", jpayne@7: ], jpayne@7: "Swedish": [ jpayne@7: "e", jpayne@7: "a", jpayne@7: "n", jpayne@7: "r", jpayne@7: "t", jpayne@7: "s", jpayne@7: "i", jpayne@7: "l", jpayne@7: "d", jpayne@7: "o", jpayne@7: "m", jpayne@7: "k", jpayne@7: "g", jpayne@7: "v", jpayne@7: "h", jpayne@7: "f", jpayne@7: "u", jpayne@7: "p", jpayne@7: "ä", jpayne@7: "c", jpayne@7: "b", jpayne@7: "ö", jpayne@7: "å", jpayne@7: "y", jpayne@7: "j", jpayne@7: "x", jpayne@7: ], jpayne@7: "Chinese": [ jpayne@7: "的", jpayne@7: "一", jpayne@7: "是", jpayne@7: "不", jpayne@7: "了", jpayne@7: "在", jpayne@7: "人", jpayne@7: "有", jpayne@7: "我", jpayne@7: "他", jpayne@7: "这", jpayne@7: "个", jpayne@7: "们", jpayne@7: "中", jpayne@7: "来", jpayne@7: "上", jpayne@7: "大", jpayne@7: "为", jpayne@7: "和", jpayne@7: "国", jpayne@7: "地", jpayne@7: "到", jpayne@7: "以", jpayne@7: "说", jpayne@7: "时", jpayne@7: "要", jpayne@7: "就", jpayne@7: "出", jpayne@7: "会", jpayne@7: "可", jpayne@7: "也", jpayne@7: "你", jpayne@7: "对", jpayne@7: "生", jpayne@7: "能", jpayne@7: "而", jpayne@7: "子", jpayne@7: "那", jpayne@7: "得", jpayne@7: "于", jpayne@7: "着", jpayne@7: "下", jpayne@7: "自", jpayne@7: "之", jpayne@7: "年", jpayne@7: "过", jpayne@7: "发", jpayne@7: "后", jpayne@7: "作", jpayne@7: "里", jpayne@7: "用", jpayne@7: "道", jpayne@7: "行", jpayne@7: "所", jpayne@7: "然", jpayne@7: "家", jpayne@7: "种", jpayne@7: "事", jpayne@7: "成", jpayne@7: "方", jpayne@7: "多", jpayne@7: "经", jpayne@7: "么", jpayne@7: "去", jpayne@7: "法", jpayne@7: "学", jpayne@7: "如", jpayne@7: "都", jpayne@7: "同", jpayne@7: "现", jpayne@7: "当", jpayne@7: "没", jpayne@7: "动", jpayne@7: "面", jpayne@7: "起", jpayne@7: "看", jpayne@7: "定", jpayne@7: "天", jpayne@7: "分", jpayne@7: "还", jpayne@7: "进", jpayne@7: "好", jpayne@7: "小", jpayne@7: "部", jpayne@7: "其", jpayne@7: "些", jpayne@7: "主", jpayne@7: "样", jpayne@7: "理", jpayne@7: "心", jpayne@7: "她", jpayne@7: "本", jpayne@7: "前", jpayne@7: "开", jpayne@7: "但", jpayne@7: "因", jpayne@7: "只", jpayne@7: "从", jpayne@7: "想", jpayne@7: "实", jpayne@7: ], jpayne@7: "Ukrainian": [ jpayne@7: "о", jpayne@7: "а", jpayne@7: "н", jpayne@7: "і", jpayne@7: "и", jpayne@7: "р", jpayne@7: "в", jpayne@7: "т", jpayne@7: "е", jpayne@7: "с", jpayne@7: "к", jpayne@7: "л", jpayne@7: "у", jpayne@7: "д", jpayne@7: "м", jpayne@7: "п", jpayne@7: "з", jpayne@7: "я", jpayne@7: "ь", jpayne@7: "б", jpayne@7: "г", jpayne@7: "й", jpayne@7: "ч", jpayne@7: "х", jpayne@7: "ц", jpayne@7: "ї", jpayne@7: ], jpayne@7: "Norwegian": [ jpayne@7: "e", jpayne@7: "r", jpayne@7: "n", jpayne@7: "t", jpayne@7: "a", jpayne@7: "s", jpayne@7: "i", jpayne@7: "o", jpayne@7: "l", jpayne@7: "d", jpayne@7: "g", jpayne@7: "k", jpayne@7: "m", jpayne@7: "v", jpayne@7: "f", jpayne@7: "p", jpayne@7: "u", jpayne@7: "b", jpayne@7: "h", jpayne@7: "å", jpayne@7: "y", jpayne@7: "j", jpayne@7: "ø", jpayne@7: "c", jpayne@7: "æ", jpayne@7: "w", jpayne@7: ], jpayne@7: "Finnish": [ jpayne@7: "a", jpayne@7: "i", jpayne@7: "n", jpayne@7: "t", jpayne@7: "e", jpayne@7: "s", jpayne@7: "l", jpayne@7: "o", jpayne@7: "u", jpayne@7: "k", jpayne@7: "ä", jpayne@7: "m", jpayne@7: "r", jpayne@7: "v", jpayne@7: "j", jpayne@7: "h", jpayne@7: "p", jpayne@7: "y", jpayne@7: "d", jpayne@7: "ö", jpayne@7: "g", jpayne@7: "c", jpayne@7: "b", jpayne@7: "f", jpayne@7: "w", jpayne@7: "z", jpayne@7: ], jpayne@7: "Vietnamese": [ jpayne@7: "n", jpayne@7: "h", jpayne@7: "t", jpayne@7: "i", jpayne@7: "c", jpayne@7: "g", jpayne@7: "a", jpayne@7: "o", jpayne@7: "u", jpayne@7: "m", jpayne@7: "l", jpayne@7: "r", jpayne@7: "à", jpayne@7: "đ", jpayne@7: "s", jpayne@7: "e", jpayne@7: "v", jpayne@7: "p", jpayne@7: "b", jpayne@7: "y", jpayne@7: "ư", jpayne@7: "d", jpayne@7: "á", jpayne@7: "k", jpayne@7: "ộ", jpayne@7: "ế", jpayne@7: ], jpayne@7: "Czech": [ jpayne@7: "o", jpayne@7: "e", jpayne@7: "a", jpayne@7: "n", jpayne@7: "t", jpayne@7: "s", jpayne@7: "i", jpayne@7: "l", jpayne@7: "v", jpayne@7: "r", jpayne@7: "k", jpayne@7: "d", jpayne@7: "u", jpayne@7: "m", jpayne@7: "p", jpayne@7: "í", jpayne@7: "c", jpayne@7: "h", jpayne@7: "z", jpayne@7: "á", jpayne@7: "y", jpayne@7: "j", jpayne@7: "b", jpayne@7: "ě", jpayne@7: "é", jpayne@7: "ř", jpayne@7: ], jpayne@7: "Hungarian": [ jpayne@7: "e", jpayne@7: "a", jpayne@7: "t", jpayne@7: "l", jpayne@7: "s", jpayne@7: "n", jpayne@7: "k", jpayne@7: "r", jpayne@7: "i", jpayne@7: "o", jpayne@7: "z", jpayne@7: "á", jpayne@7: "é", jpayne@7: "g", jpayne@7: "m", jpayne@7: "b", jpayne@7: "y", jpayne@7: "v", jpayne@7: "d", jpayne@7: "h", jpayne@7: "u", jpayne@7: "p", jpayne@7: "j", jpayne@7: "ö", jpayne@7: "f", jpayne@7: "c", jpayne@7: ], jpayne@7: "Korean": [ jpayne@7: "이", jpayne@7: "다", jpayne@7: "에", jpayne@7: "의", jpayne@7: "는", jpayne@7: "로", jpayne@7: "하", jpayne@7: "을", jpayne@7: "가", jpayne@7: "고", jpayne@7: "지", jpayne@7: "서", jpayne@7: "한", jpayne@7: "은", jpayne@7: "기", jpayne@7: "으", jpayne@7: "년", jpayne@7: "대", jpayne@7: "사", jpayne@7: "시", jpayne@7: "를", jpayne@7: "리", jpayne@7: "도", jpayne@7: "인", jpayne@7: "스", jpayne@7: "일", jpayne@7: ], jpayne@7: "Indonesian": [ jpayne@7: "a", jpayne@7: "n", jpayne@7: "e", jpayne@7: "i", jpayne@7: "r", jpayne@7: "t", jpayne@7: "u", jpayne@7: "s", jpayne@7: "d", jpayne@7: "k", jpayne@7: "m", jpayne@7: "l", jpayne@7: "g", jpayne@7: "p", jpayne@7: "b", jpayne@7: "o", jpayne@7: "h", jpayne@7: "y", jpayne@7: "j", jpayne@7: "c", jpayne@7: "w", jpayne@7: "f", jpayne@7: "v", jpayne@7: "z", jpayne@7: "x", jpayne@7: "q", jpayne@7: ], jpayne@7: "Turkish": [ jpayne@7: "a", jpayne@7: "e", jpayne@7: "i", jpayne@7: "n", jpayne@7: "r", jpayne@7: "l", jpayne@7: "ı", jpayne@7: "k", jpayne@7: "d", jpayne@7: "t", jpayne@7: "s", jpayne@7: "m", jpayne@7: "y", jpayne@7: "u", jpayne@7: "o", jpayne@7: "b", jpayne@7: "ü", jpayne@7: "ş", jpayne@7: "v", jpayne@7: "g", jpayne@7: "z", jpayne@7: "h", jpayne@7: "c", jpayne@7: "p", jpayne@7: "ç", jpayne@7: "ğ", jpayne@7: ], jpayne@7: "Romanian": [ jpayne@7: "e", jpayne@7: "i", jpayne@7: "a", jpayne@7: "r", jpayne@7: "n", jpayne@7: "t", jpayne@7: "u", jpayne@7: "l", jpayne@7: "o", jpayne@7: "c", jpayne@7: "s", jpayne@7: "d", jpayne@7: "p", jpayne@7: "m", jpayne@7: "ă", jpayne@7: "f", jpayne@7: "v", jpayne@7: "î", jpayne@7: "g", jpayne@7: "b", jpayne@7: "ș", jpayne@7: "ț", jpayne@7: "z", jpayne@7: "h", jpayne@7: "â", jpayne@7: "j", jpayne@7: ], jpayne@7: "Farsi": [ jpayne@7: "ا", jpayne@7: "ی", jpayne@7: "ر", jpayne@7: "د", jpayne@7: "ن", jpayne@7: "ه", jpayne@7: "و", jpayne@7: "م", jpayne@7: "ت", jpayne@7: "ب", jpayne@7: "س", jpayne@7: "ل", jpayne@7: "ک", jpayne@7: "ش", jpayne@7: "ز", jpayne@7: "ف", jpayne@7: "گ", jpayne@7: "ع", jpayne@7: "خ", jpayne@7: "ق", jpayne@7: "ج", jpayne@7: "آ", jpayne@7: "پ", jpayne@7: "ح", jpayne@7: "ط", jpayne@7: "ص", jpayne@7: ], jpayne@7: "Arabic": [ jpayne@7: "ا", jpayne@7: "ل", jpayne@7: "ي", jpayne@7: "م", jpayne@7: "و", jpayne@7: "ن", jpayne@7: "ر", jpayne@7: "ت", jpayne@7: "ب", jpayne@7: "ة", jpayne@7: "ع", jpayne@7: "د", jpayne@7: "س", jpayne@7: "ف", jpayne@7: "ه", jpayne@7: "ك", jpayne@7: "ق", jpayne@7: "أ", jpayne@7: "ح", jpayne@7: "ج", jpayne@7: "ش", jpayne@7: "ط", jpayne@7: "ص", jpayne@7: "ى", jpayne@7: "خ", jpayne@7: "إ", jpayne@7: ], jpayne@7: "Danish": [ jpayne@7: "e", jpayne@7: "r", jpayne@7: "n", jpayne@7: "t", jpayne@7: "a", jpayne@7: "i", jpayne@7: "s", jpayne@7: "d", jpayne@7: "l", jpayne@7: "o", jpayne@7: "g", jpayne@7: "m", jpayne@7: "k", jpayne@7: "f", jpayne@7: "v", jpayne@7: "u", jpayne@7: "b", jpayne@7: "h", jpayne@7: "p", jpayne@7: "å", jpayne@7: "y", jpayne@7: "ø", jpayne@7: "æ", jpayne@7: "c", jpayne@7: "j", jpayne@7: "w", jpayne@7: ], jpayne@7: "Serbian": [ jpayne@7: "а", jpayne@7: "и", jpayne@7: "о", jpayne@7: "е", jpayne@7: "н", jpayne@7: "р", jpayne@7: "с", jpayne@7: "у", jpayne@7: "т", jpayne@7: "к", jpayne@7: "ј", jpayne@7: "в", jpayne@7: "д", jpayne@7: "м", jpayne@7: "п", jpayne@7: "л", jpayne@7: "г", jpayne@7: "з", jpayne@7: "б", jpayne@7: "a", jpayne@7: "i", jpayne@7: "e", jpayne@7: "o", jpayne@7: "n", jpayne@7: "ц", jpayne@7: "ш", jpayne@7: ], jpayne@7: "Lithuanian": [ jpayne@7: "i", jpayne@7: "a", jpayne@7: "s", jpayne@7: "o", jpayne@7: "r", jpayne@7: "e", jpayne@7: "t", jpayne@7: "n", jpayne@7: "u", jpayne@7: "k", jpayne@7: "m", jpayne@7: "l", jpayne@7: "p", jpayne@7: "v", jpayne@7: "d", jpayne@7: "j", jpayne@7: "g", jpayne@7: "ė", jpayne@7: "b", jpayne@7: "y", jpayne@7: "ų", jpayne@7: "š", jpayne@7: "ž", jpayne@7: "c", jpayne@7: "ą", jpayne@7: "į", jpayne@7: ], jpayne@7: "Slovene": [ jpayne@7: "e", jpayne@7: "a", jpayne@7: "i", jpayne@7: "o", jpayne@7: "n", jpayne@7: "r", jpayne@7: "s", jpayne@7: "l", jpayne@7: "t", jpayne@7: "j", jpayne@7: "v", jpayne@7: "k", jpayne@7: "d", jpayne@7: "p", jpayne@7: "m", jpayne@7: "u", jpayne@7: "z", jpayne@7: "b", jpayne@7: "g", jpayne@7: "h", jpayne@7: "č", jpayne@7: "c", jpayne@7: "š", jpayne@7: "ž", jpayne@7: "f", jpayne@7: "y", jpayne@7: ], jpayne@7: "Slovak": [ jpayne@7: "o", jpayne@7: "a", jpayne@7: "e", jpayne@7: "n", jpayne@7: "i", jpayne@7: "r", jpayne@7: "v", jpayne@7: "t", jpayne@7: "s", jpayne@7: "l", jpayne@7: "k", jpayne@7: "d", jpayne@7: "m", jpayne@7: "p", jpayne@7: "u", jpayne@7: "c", jpayne@7: "h", jpayne@7: "j", jpayne@7: "b", jpayne@7: "z", jpayne@7: "á", jpayne@7: "y", jpayne@7: "ý", jpayne@7: "í", jpayne@7: "č", jpayne@7: "é", jpayne@7: ], jpayne@7: "Hebrew": [ jpayne@7: "י", jpayne@7: "ו", jpayne@7: "ה", jpayne@7: "ל", jpayne@7: "ר", jpayne@7: "ב", jpayne@7: "ת", jpayne@7: "מ", jpayne@7: "א", jpayne@7: "ש", jpayne@7: "נ", jpayne@7: "ע", jpayne@7: "ם", jpayne@7: "ד", jpayne@7: "ק", jpayne@7: "ח", jpayne@7: "פ", jpayne@7: "ס", jpayne@7: "כ", jpayne@7: "ג", jpayne@7: "ט", jpayne@7: "צ", jpayne@7: "ן", jpayne@7: "ז", jpayne@7: "ך", jpayne@7: ], jpayne@7: "Bulgarian": [ jpayne@7: "а", jpayne@7: "и", jpayne@7: "о", jpayne@7: "е", jpayne@7: "н", jpayne@7: "т", jpayne@7: "р", jpayne@7: "с", jpayne@7: "в", jpayne@7: "л", jpayne@7: "к", jpayne@7: "д", jpayne@7: "п", jpayne@7: "м", jpayne@7: "з", jpayne@7: "г", jpayne@7: "я", jpayne@7: "ъ", jpayne@7: "у", jpayne@7: "б", jpayne@7: "ч", jpayne@7: "ц", jpayne@7: "й", jpayne@7: "ж", jpayne@7: "щ", jpayne@7: "х", jpayne@7: ], jpayne@7: "Croatian": [ jpayne@7: "a", jpayne@7: "i", jpayne@7: "o", jpayne@7: "e", jpayne@7: "n", jpayne@7: "r", jpayne@7: "j", jpayne@7: "s", jpayne@7: "t", jpayne@7: "u", jpayne@7: "k", jpayne@7: "l", jpayne@7: "v", jpayne@7: "d", jpayne@7: "m", jpayne@7: "p", jpayne@7: "g", jpayne@7: "z", jpayne@7: "b", jpayne@7: "c", jpayne@7: "č", jpayne@7: "h", jpayne@7: "š", jpayne@7: "ž", jpayne@7: "ć", jpayne@7: "f", jpayne@7: ], jpayne@7: "Hindi": [ jpayne@7: "क", jpayne@7: "र", jpayne@7: "स", jpayne@7: "न", jpayne@7: "त", jpayne@7: "म", jpayne@7: "ह", jpayne@7: "प", jpayne@7: "य", jpayne@7: "ल", jpayne@7: "व", jpayne@7: "ज", jpayne@7: "द", jpayne@7: "ग", jpayne@7: "ब", jpayne@7: "श", jpayne@7: "ट", jpayne@7: "अ", jpayne@7: "ए", jpayne@7: "थ", jpayne@7: "भ", jpayne@7: "ड", jpayne@7: "च", jpayne@7: "ध", jpayne@7: "ष", jpayne@7: "इ", jpayne@7: ], jpayne@7: "Estonian": [ jpayne@7: "a", jpayne@7: "i", jpayne@7: "e", jpayne@7: "s", jpayne@7: "t", jpayne@7: "l", jpayne@7: "u", jpayne@7: "n", jpayne@7: "o", jpayne@7: "k", jpayne@7: "r", jpayne@7: "d", jpayne@7: "m", jpayne@7: "v", jpayne@7: "g", jpayne@7: "p", jpayne@7: "j", jpayne@7: "h", jpayne@7: "ä", jpayne@7: "b", jpayne@7: "õ", jpayne@7: "ü", jpayne@7: "f", jpayne@7: "c", jpayne@7: "ö", jpayne@7: "y", jpayne@7: ], jpayne@7: "Thai": [ jpayne@7: "า", jpayne@7: "น", jpayne@7: "ร", jpayne@7: "อ", jpayne@7: "ก", jpayne@7: "เ", jpayne@7: "ง", jpayne@7: "ม", jpayne@7: "ย", jpayne@7: "ล", jpayne@7: "ว", jpayne@7: "ด", jpayne@7: "ท", jpayne@7: "ส", jpayne@7: "ต", jpayne@7: "ะ", jpayne@7: "ป", jpayne@7: "บ", jpayne@7: "ค", jpayne@7: "ห", jpayne@7: "แ", jpayne@7: "จ", jpayne@7: "พ", jpayne@7: "ช", jpayne@7: "ข", jpayne@7: "ใ", jpayne@7: ], jpayne@7: "Greek": [ jpayne@7: "α", jpayne@7: "τ", jpayne@7: "ο", jpayne@7: "ι", jpayne@7: "ε", jpayne@7: "ν", jpayne@7: "ρ", jpayne@7: "σ", jpayne@7: "κ", jpayne@7: "η", jpayne@7: "π", jpayne@7: "ς", jpayne@7: "υ", jpayne@7: "μ", jpayne@7: "λ", jpayne@7: "ί", jpayne@7: "ό", jpayne@7: "ά", jpayne@7: "γ", jpayne@7: "έ", jpayne@7: "δ", jpayne@7: "ή", jpayne@7: "ω", jpayne@7: "χ", jpayne@7: "θ", jpayne@7: "ύ", jpayne@7: ], jpayne@7: "Tamil": [ jpayne@7: "க", jpayne@7: "த", jpayne@7: "ப", jpayne@7: "ட", jpayne@7: "ர", jpayne@7: "ம", jpayne@7: "ல", jpayne@7: "ன", jpayne@7: "வ", jpayne@7: "ற", jpayne@7: "ய", jpayne@7: "ள", jpayne@7: "ச", jpayne@7: "ந", jpayne@7: "இ", jpayne@7: "ண", jpayne@7: "அ", jpayne@7: "ஆ", jpayne@7: "ழ", jpayne@7: "ங", jpayne@7: "எ", jpayne@7: "உ", jpayne@7: "ஒ", jpayne@7: "ஸ", jpayne@7: ], jpayne@7: "Kazakh": [ jpayne@7: "а", jpayne@7: "ы", jpayne@7: "е", jpayne@7: "н", jpayne@7: "т", jpayne@7: "р", jpayne@7: "л", jpayne@7: "і", jpayne@7: "д", jpayne@7: "с", jpayne@7: "м", jpayne@7: "қ", jpayne@7: "к", jpayne@7: "о", jpayne@7: "б", jpayne@7: "и", jpayne@7: "у", jpayne@7: "ғ", jpayne@7: "ж", jpayne@7: "ң", jpayne@7: "з", jpayne@7: "ш", jpayne@7: "й", jpayne@7: "п", jpayne@7: "г", jpayne@7: "ө", jpayne@7: ], jpayne@7: } jpayne@7: jpayne@7: LANGUAGE_SUPPORTED_COUNT: int = len(FREQUENCIES)