Update Filters & Update Confusable Characters

Fixes #748, #749, #745
This commit is contained in:
ThioJoe
2022-03-31 12:34:01 -07:00
parent 24e6e079a1
commit ffddd693f0
4 changed files with 51 additions and 21 deletions

File diff suppressed because one or more lines are too long

View File

@@ -1,6 +1,26 @@
0061 ; 0040 ; # a → @
065 ; 0033 ; # e → 3
0065 ; 0033 ; # e → 3
0045 ; 0033 ; # E → 3
0069 ; 0021 ; # i → !
0049 ; 0021 ; # I → !
0074 ; 0372 ; # t → Ͳ
0054 ; 0372 ; # T → Ͳ
0065 ; 0454 ; # e → є
0045 ; 0454 ; # E → є
0067 ; 0260 ; # g → ɠ
0047 ; 0260 ; # G → ɠ
0072 ; 027E ; # r → ɾ
0052 ; 027E ; # R → ɾ
0066 ; FF26 ; # f →
0046 ; FF26 ; # F →
0072 ; FF32 ; # r →
0052 ; FF32 ; # R →
0072 ; FF32 ; # r →
0052 ; FF32 ; # R →
0075 ; FF35 ; # u →
0055 ; FF35 ; # U →
0066 ; 0493 ; # f → ғ
0046 ; 0493 ; # F → ғ
0041 ; 1D00 ; # A → ᴀ
0042 ; 0299 ; # B → ʙ
0043 ; 1D04 ; # C →
@@ -26,3 +46,4 @@
0057 ; 1D21 ; # W →
0059 ; 028F ; # Y → ʏ
005A ; 1D22 ; # Z →

View File

@@ -27,7 +27,11 @@ def parse_new_mapping_file():
mappings = unicode_mappings.readlines()
mappings.extend(custom_mappings)
numOfMappings = len(mappings)
i = 0
for mapping_line in mappings:
i = i+1
print(f"{i}/{numOfMappings} Mappings Checked", end = "\r")
if not mapping_line.strip() or mapping_line[0] == '#' or mapping_line[1] == '#':
continue
@@ -64,6 +68,7 @@ def parse_new_mapping_file():
unicode_confusable_map[case_change].add(str2)
else:
unicode_confusable_map[case_change] = set([str2])
print(" ")
for char in string.ascii_lowercase:
accented = _get_accented_characters(char)
@@ -85,10 +90,14 @@ def parse_new_mapping_file():
CONFUSABLE_MAP = {}
characters_to_map = list(unicode_confusable_map.keys())
for character in list(unicode_confusable_map.keys()):
numOfCharsToMap = len(characters_to_map)
charMapProgress = 0
for character in characters_to_map:
charMapProgress = charMapProgress +1
print(f"{charMapProgress}/{numOfCharsToMap} Characters Processed", end = "\r")
char_group = _get_confusable_chars(character, unicode_confusable_map, 0)
CONFUSABLE_MAP[character] = list(char_group)
print(" ")
mapping_file = open(os.path.join(os.path.dirname(__file__), CONFUSABLE_MAPPING_PATH), "w")
mapping_file.write(json.dumps(CONFUSABLE_MAP))

File diff suppressed because one or more lines are too long