From def3d13a9d1e37eef1d31f9486ae6d89c3292128 Mon Sep 17 00:00:00 2001 From: jaime-m-p <> Date: Tue, 7 May 2024 20:39:22 +0200 Subject: [PATCH] wip: generate NDF table --- scripts/gen-unicode-data.py | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/scripts/gen-unicode-data.py b/scripts/gen-unicode-data.py index e5043c1f7..1b5034a3c 100644 --- a/scripts/gen-unicode-data.py +++ b/scripts/gen-unicode-data.py @@ -100,14 +100,15 @@ print_cat("map", "lowercase", map_lowercase) print_cat("map", "uppercase", map_uppercase) -inv_map_nfd = {} -for codepoint in range(0x110000): - char = chr(codepoint) - norm = ord(unicodedata.normalize('NFD', char)[0]) - if codepoint != norm: - a, b = inv_map_nfd.get(norm, (codepoint, codepoint)) - inv_map_nfd[norm] = (min(a, codepoint), max(b, codepoint)) -nfd_ranges = [ (a, b, nfd) for nfd,(a,b) in inv_map_nfd.items() ] -nfd_ranges = list(sorted(nfd_ranges)) -del inv_map_nfd -print_cat("range_value", "nfd", nfd_ranges) +# TODO: this is wrong +# inv_map_nfd = {} +# for codepoint in range(0x110000): +# char = chr(codepoint) +# norm = ord(unicodedata.normalize('NFD', char)[0]) +# if codepoint != norm: +# a, b = inv_map_nfd.get(norm, (codepoint, codepoint)) +# inv_map_nfd[norm] = (min(a, codepoint), max(b, codepoint)) +# nfd_ranges = [ (a, b, nfd) for nfd,(a,b) in inv_map_nfd.items() ] +# nfd_ranges = list(sorted(nfd_ranges)) +# del inv_map_nfd +# print_cat("range_value", "nfd", nfd_ranges)