engine: look dictionaries up synchronously
The dictionary thread ran in imthread's own proc, so a lookup could only start once the engine blocked, and it was a trie probe anyway; the emoji and Hanja searches already called dictlookup directly. The request/result channels, sequence numbers, staleness checks and the second draw per Japanese key are gone; dictqjp fills the candidates in place. Emit.dict and Lang.dictq only ever triggered lookups for Vietnamese, which has no dictionary. dictlookup(Lang*, key, out, max) returns the count. The Hanja lookup no longer pre-checks for a single syllable; a reading either has an entry or it does not.
This commit is contained in:
@@ -99,13 +99,12 @@ transmap_states(struct ct *t)
|
||||
int eat;
|
||||
char *emit;
|
||||
char *next;
|
||||
char *mapped;
|
||||
} cases[] = {
|
||||
{ "", 'k', 1, "", "k", "" },
|
||||
{ "k", 'a', 1, "", "ka", "か" },
|
||||
{ "ka", 's', 1, "か", "s", "" },
|
||||
{ "ka", 'q', 0, "か", "", "" },
|
||||
{ "k", 'q', 0, "k", "", "" },
|
||||
{ "", 'k', 1, "", "k" },
|
||||
{ "k", 'a', 1, "", "ka" },
|
||||
{ "ka", 's', 1, "か", "s" },
|
||||
{ "ka", 'q', 0, "か", "" },
|
||||
{ "k", 'q', 0, "k", "" },
|
||||
};
|
||||
Emit e;
|
||||
Im state;
|
||||
@@ -125,7 +124,6 @@ transmap_states(struct ct *t)
|
||||
i, cases[i].eat, e.eat);
|
||||
checkstr(t, "emit", cases[i].emit, &e.s);
|
||||
checkstr(t, "next", cases[i].next, &e.next);
|
||||
checkstr(t, "mapped", cases[i].mapped, &e.dict);
|
||||
}
|
||||
trieclose(fixture);
|
||||
state.l->map = saved;
|
||||
|
||||
Reference in New Issue
Block a user