himselfv / wakan

Japanese and Chinese learning tool with dictionary
36 stars 7 forks source link

Editor - kana to kanji transition changes the word #296

Closed danglotor closed 3 years ago

danglotor commented 3 years ago

In the editor when writing japanese text, upon hitting space bar to pick the desired kanji+translation, the form of some of the words changes. E.g. I want to write 来た [kita] (came), but the word and reading change to base form 来る [kuru] (come). (來る same behavior)

himselfv commented 3 years ago

Confirmed.

Notes to myself: The problem is in the insert resolution in TfEditor.ResolveInsert(). The algorithm correctly locates 来る/くる, correctly stripes the common tail to 来/く. But then it compares the remaining kana to what was typed, but it's "'きた" and doesn't start with "く". So it doesn't know how many of the typed characters to preserve as a tail, and replaces it entirely. I'll think what to do here.

himselfv commented 3 years ago

Fixed by writing a special case for kuru-type verbs (which are thankfully marked by the deflexion routine). Will be included in the next release.