Ajatt-Tools / anki.koplugin

KOReader plugin enabling Anki card generations for words looked up in the internal dictionary.
49 stars 6 forks source link

Deconjugation of Target Word #18

Open ccos89 opened 6 months ago

ccos89 commented 6 months ago

Hey there, loving the extension. One thing I’d like to request if possible - right now, for adjectives and verbs, the target word that gets output to Anki is the conjugated word used in the sentence as opposed to the deinflected dictionary form of the word. For example, if my sentence contains 食べたり, the target word will export as 食べたり instead of 食べる.

Can this behavior - at least optionally - be altered to export the headword of the selected dictionary entry, or deinflected form of the word, as the target word instead? This would help avoid inflated known word counts for me.

nairyosangha commented 6 months ago

That is what extensions/EXT_dict_word_lookup.lua tries to do. This one also required that you have those patterns in langsupport/ja/dictwrapper.lua working for your dicts.

As I mentioned on your other issue, if the headword in a dict looks like ののしる【罵る】, the extension will try to add 罵る as target word on your note.

If you don't care about that you could change this line https://github.com/Ajatt-Tools/anki.koplugin/blob/1cc0d36c318b9931e1f7157ff8aad9ca453e6e6a/extensions/EXT_dict_word_lookup.lua#L13 and have it use selected.word directly, instead of trying to extract info out of it