emoji: search the dictionary by prefix in the engine, not in the data

mkemoji wrote a row for every prefix of every alias, so that a query
matched as it was typed; the trie is a prefix index already, and with a
real emoji list those rows would be four times the aliases themselves.
Now emoji.dict has one row per alias, trienode() names a key's node, and
dictlookup walks the entries at and below it, the key's own first, up to
Maxkouho.  Trie children are appended rather than pushed, so the walk
keeps the file's order and a bare digit still picks the superscript or
subscript it always did.

The hand-written symbol rows move to symbol.src; emoji.src is left to
the emoji.  mkemoji reads both by default, or the files it is given.
This commit is contained in:
2026-08-17 01:07:10 +09:00
parent 221117f93d
commit abff5ed122
9 changed files with 275 additions and 386 deletions

1
fn.h
View File

@@ -15,6 +15,7 @@ Trie* trienew(void);
void trieput(Trie*, char*, int, char*, int);
Trie* trieopen(char*);
void trieclose(Trie*);
int trienode(Trie*, Str*);
int trielookup(Trie*, Str*, char**, int*);
Lang* getlang(int);