diff options
| author | Jules Aguillon | 2026-04-10 19:08:23 +0200 |
|---|---|---|
| committer | GitHub | 2026-04-10 19:08:23 +0200 |
| commit | 833b4a21549f7ea8067291f344f6acdeaff3f079 (patch) | |
| tree | 81448d90ea6260e49a0b7e02595f8c4f5508eda0 /srcs/compose/compile.py | |
| parent | 8921de7f02570ba03816ebb4025f2c95bc131707 (diff) | |
| download | unexpected-keyboard-833b4a21549f7ea8067291f344f6acdeaff3f079.tar.gz unexpected-keyboard-833b4a21549f7ea8067291f344f6acdeaff3f079.zip | |
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.
Diffstat (limited to 'srcs/compose/compile.py')
| -rw-r--r-- | srcs/compose/compile.py | 2 |
1 files changed, 2 insertions, 0 deletions
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 |
