ueno / libkkc

Japanese Kana Kanji conversion input method library
GNU General Public License v3.0
106 stars 15 forks source link

kkc gives incorrect results regarding to the word 令和 #26

Open xuzhao9 opened 4 years ago

xuzhao9 commented 4 years ago

For example:

>> れいわ
0: <令/れい><わ/わ>

The correct result should be: <令和/れいわ>

>> れいわじだい
0: <れ/れ><岩/いわ><時代/じだい>

The correct result should be: <令和/れいわ><時代/じだい>

I am using libkkc 0.3.5+git20190809.b2e5a15-2.1.

xuzhao9 commented 4 years ago

This is a bug caused by the frontend fcitx5-kkc, as it failed to load the SKK dictionary.

xuzhao9 commented 4 years ago

Some further investigations: At https://github.com/ueno/libkkc/blob/master/libkkc/context.vala#L174, the context CLEARS the all dictionaries in the context. When the user quits a program, fcitx5-kkc will deconstruct a Context, which clears the dictionary. The next time a program opens, kkc will lose all the dictionary information.

Now the question is: should kkc State keep the dictionary information even though it destructs, and let the caller handle the dictionary resource?