mirror of
https://github.com/Julow/Unexpected-Keyboard.git
synced 2025-06-25 20:22:38 +02:00
Compose: Allow to force string final states
Appending the ':' character to a sequence result forces it to be a string final state. This will cause a KeyValue lookup that would normally not happen for single-character results. This is useful to make Tamil letters smaller, even when they are the result of a Shift.
This commit is contained in:
parent
bd2170e04b
commit
82e472ba46
@ -195,6 +195,9 @@ def make_automata(tries):
|
||||
# There are two encoding for leafs: character final state for 15-bit
|
||||
# characters and string final state for the rest.
|
||||
if len(c) > 1 or ord(c[0]) > 32767: # String final state
|
||||
# A ':' can be added to the result of a sequence to force a string
|
||||
# final state. For example, to go through KeyValue lookup.
|
||||
if c.startswith(":"): c = c[1:]
|
||||
javachars = array('H', c.encode("UTF-16-LE"))
|
||||
states.append((-1, len(javachars) + 1))
|
||||
for c in javachars:
|
||||
|
Loading…
x
Reference in New Issue
Block a user