engine: verbs and adjectives through SKK's okuri-ari entries
A sixth of kanji.dict is SKK's okuri-ari entries, keyed by a stem and the letter of the okurigana that follows it — かk: 書 描 掛 —, and no reading ever ends in a letter, so かく offered 確 and 各 but never 書く, and no verb or adjective could be converted at all. Now every split of a complete reading is tried, longest stem first, with the okurigana put back: かく adds 書く and 描く after the exact candidates, よむ gives 読む, あかい 赤い, おおきい 大きい, いった 言った, かいた 書いた. A stem that ends in っ writes it in kana too, so いt and いっt agree.
This commit is contained in:
@@ -1200,6 +1200,32 @@ engine_japanese_candidates(struct ct *t)
|
||||
checkstr(t, "typo mended", "かんじ", &shown);
|
||||
CT_EQ_INT(t, 2, im.nkouho);
|
||||
CT_CHECK(t, keystroke(Kesc, 0, &com));
|
||||
/* SKK's okuri-ari entries convert verbs: stem plus okurigana. */
|
||||
setdict(jp->dict, "かk", "書 描");
|
||||
setdict(jp->dict, "かく", "確");
|
||||
if(!typekeys(t, "kaku", &com))
|
||||
goto cleanup;
|
||||
if(CT_EQ_INT(t, 3, im.nkouho)){
|
||||
checkstr(t, "exact candidate first", "確", &im.kouho[0]);
|
||||
checkstr(t, "okurigana put back", "書く", &im.kouho[1]);
|
||||
checkstr(t, "second okuri candidate", "描く", &im.kouho[2]);
|
||||
}
|
||||
CT_CHECK(t, keystroke(Kesc, 0, &com));
|
||||
setdict(jp->dict, "おおk", "大");
|
||||
if(!typekeys(t, "ookii", &com))
|
||||
goto cleanup;
|
||||
if(CT_EQ_INT(t, 1, im.nkouho))
|
||||
checkstr(t, "two-kana okurigana", "大きい", &im.kouho[0]);
|
||||
CT_CHECK(t, keystroke(Kesc, 0, &com));
|
||||
setdict(jp->dict, "いt", "言 行");
|
||||
setdict(jp->dict, "いっt", "言 行");
|
||||
if(!typekeys(t, "itta", &com))
|
||||
goto cleanup;
|
||||
if(CT_EQ_INT(t, 2, im.nkouho)){
|
||||
checkstr(t, "sokuon written in kana", "言った", &im.kouho[0]);
|
||||
checkstr(t, "sokuon written in kana", "行った", &im.kouho[1]);
|
||||
}
|
||||
CT_CHECK(t, keystroke(Kesc, 0, &com));
|
||||
/* Backspace looks a complete shorter reading up again. */
|
||||
setdict(jp->dict, "かん", "缶");
|
||||
if(!typekeys(t, "kanji", &com))
|
||||
|
||||
Reference in New Issue
Block a user