fix: preserve complete Japanese readings

This commit is contained in:
2026-08-12 15:28:16 +09:00
parent 5ae0945015
commit ec7e6eb992
7 changed files with 319 additions and 32 deletions

View File

@@ -76,10 +76,14 @@ transmap_states(struct ct *t)
};
Emit e;
Im state;
Trie *fixture, *saved;
int i;
fixture = trieopen("data/hira.map");
memset(&state, 0, sizeof state);
state.l = getlang(LangJP);
saved = state.l->map;
state.l->map = fixture;
for(i = 0; i < nelem(cases); i++){
state.pre = mkstr(cases[i].pre);
e = transmap(&state, cases[i].key);
@@ -90,4 +94,6 @@ transmap_states(struct ct *t)
checkstr(t, "next", cases[i].next, &e.next);
checkstr(t, "mapped", cases[i].mapped, &e.dict);
}
trieclose(fixture);
state.l->map = saved;
}