engine: a Hanja word shows once, as every other candidate does
hanjaquery was the only query that assigned dictprefix's output straight into im.kouho; emojiquery, dictqjp and katakouho all go through addkouho, which is the only place a duplicate is dropped. Two readings under one prefix can carry the same word, and 198 of the 61,479 one- and two-syllable prefixes in hanja.dict do: 게 listed 偈句 at rows 8 and 9, 개근 listed 皆勤狀 twice in five. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
8
strans.c
8
strans.c
@@ -653,14 +653,16 @@ emojiquery(void)
|
|||||||
static void
|
static void
|
||||||
hanjaquery(void)
|
hanjaquery(void)
|
||||||
{
|
{
|
||||||
Str tail;
|
Str kouho[Maxkouho], tail;
|
||||||
|
int i, n;
|
||||||
|
|
||||||
transstr(im.l, &search.seed, &search.raw, &tail);
|
transstr(im.l, &search.seed, &search.raw, &tail);
|
||||||
search.text = search.back;
|
search.text = search.back;
|
||||||
sappend(&search.text, &tail);
|
sappend(&search.text, &tail);
|
||||||
clearkouho();
|
clearkouho();
|
||||||
im.nkouho = dictprefix(getlang(LangHANJA)->dict, &search.text,
|
n = dictprefix(getlang(LangHANJA)->dict, &search.text, kouho, Maxkouho);
|
||||||
im.kouho, Maxkouho);
|
for(i = 0; i < n; i++)
|
||||||
|
addkouho(&kouho[i]);
|
||||||
selectfirst();
|
selectfirst();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2072,6 +2072,8 @@ engine_hanja_word_prefix(struct ct *t)
|
|||||||
Str com;
|
Str com;
|
||||||
|
|
||||||
hanjabegin(&f, LangKO);
|
hanjabegin(&f, LangKO);
|
||||||
|
/* Two readings under one prefix may share a word; it shows once. */
|
||||||
|
setdict(f.dictlang->dict, "민민", "民");
|
||||||
sclear(&com);
|
sclear(&com);
|
||||||
if(!CT_CHECK(t, keystroke('h', Mctrl, &com)) ||
|
if(!CT_CHECK(t, keystroke('h', Mctrl, &com)) ||
|
||||||
!typekeys(t, "als", &com))
|
!typekeys(t, "als", &com))
|
||||||
|
|||||||
Reference in New Issue
Block a user