From 833b4a21549f7ea8067291f344f6acdeaff3f079 Mon Sep 17 00:00:00 2001 From: Jules Aguillon Date: Fri, 10 Apr 2026 19:08:23 +0200 Subject: Better suggestion with diacritics (#1223) * Update cdict * scripts/subst_of_compose.py: Compute substitutions from compose mappings. They are used when building dictionaries. * Add substitutions compose data * Better suggestion with diacritics This improves the suggestions for words that contain diacritics and uppercase letters. This works by stripping diacritics both when building the dictionaries (using word aliases added in cdict: https://github.com/Julow/cdict/pull/3) and during lookup. Cdict then takes care of resolving the correct word. The substitutions are generated using mappings from `fn`, `shift` and all the `accent_*` modifiers into srcs/compose/substitutions.json This can be updated easily when more mappings are added.--- srcs/compose/compile.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'srcs/compose/compile.py') diff --git a/srcs/compose/compile.py b/srcs/compose/compile.py index 69d22ad..efbe714 100644 --- a/srcs/compose/compile.py +++ b/srcs/compose/compile.py @@ -198,6 +198,8 @@ def make_automata(tries): states.append((None, None)) # Add nested nodes and fill the current node for c in sorted(t.keys()): + if len(c) > 1 or ord(c[0]) > 65535: + raise Exception("Char out of range: " + c) states[i] = (c, add_node(t[c])) i += 1 return this_node_index -- cgit v1.2.3