Skip to content

Commit def3d13

Browse files
author
jaime-m-p
committed
wip: generate NDF table
1 parent a5fa2fe commit def3d13

File tree

1 file changed

+12
-11
lines changed

1 file changed

+12
-11
lines changed

scripts/gen-unicode-data.py

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -100,14 +100,15 @@ def print_cat(mode, cat, ranges):
100100
print_cat("map", "uppercase", map_uppercase)
101101

102102

103-
inv_map_nfd = {}
104-
for codepoint in range(0x110000):
105-
char = chr(codepoint)
106-
norm = ord(unicodedata.normalize('NFD', char)[0])
107-
if codepoint != norm:
108-
a, b = inv_map_nfd.get(norm, (codepoint, codepoint))
109-
inv_map_nfd[norm] = (min(a, codepoint), max(b, codepoint))
110-
nfd_ranges = [ (a, b, nfd) for nfd,(a,b) in inv_map_nfd.items() ]
111-
nfd_ranges = list(sorted(nfd_ranges))
112-
del inv_map_nfd
113-
print_cat("range_value", "nfd", nfd_ranges)
103+
# TODO: this is wrong
104+
# inv_map_nfd = {}
105+
# for codepoint in range(0x110000):
106+
# char = chr(codepoint)
107+
# norm = ord(unicodedata.normalize('NFD', char)[0])
108+
# if codepoint != norm:
109+
# a, b = inv_map_nfd.get(norm, (codepoint, codepoint))
110+
# inv_map_nfd[norm] = (min(a, codepoint), max(b, codepoint))
111+
# nfd_ranges = [ (a, b, nfd) for nfd,(a,b) in inv_map_nfd.items() ]
112+
# nfd_ranges = list(sorted(nfd_ranges))
113+
# del inv_map_nfd
114+
# print_cat("range_value", "nfd", nfd_ranges)

0 commit comments

Comments
 (0)