kaegi / MorphMan

Anki plugin that reorders language cards based on the words you know
Other
258 stars 66 forks source link

A way to write ALL Morphs to field without affecting scheduler? #279

Open Nayelianne opened 1 year ago

Nayelianne commented 1 year ago

I'm new to MorphMan so apologies if I'm asking dumb questions, but is there a way to write all the found morphs of a card to a field (regardless of maturity)? I know there's a browser button to view all the morphs but it'd be awesome if there were an option for that information to just get inserted into the card field instead (preferably without affecting the scheduler / without reordering cards).

The reason I ask is because I think it would be an awesome complement to this addon that scrapes weblio dictionary entries but requires a user to add the morphs of a sentence to a field first, and the way Morphman is capable of grabbing those morphs automatically was the first thing that crossed my mind to speed up that process when editing existing decks.

If anyone knows a way to achieve that and could point me in the right direction (whether through modifying some files or a separate add-on altogether) I'd really appreciate it.

landonepps commented 1 year ago

That's a good suggestion and I don't believe there's any way to tell MorphMan to add known morphs to a field on your cards.

If you want to hack it together you can hijack the MorphMan_Unknowns field for this purpose. Replace this line in main.py

setField(mid, fs, field_unknowns, ', '.join(u.base for u in unknowns))

with

setField(mid, fs, field_unknowns, ', '.join(m.base for m in morphemes))

I think you'd likely want to filter based on part of speech to exclude particles and things like the past-tense た. For instance 彼は交通事故に遭った parses to は, に, 彼, 交通事故, 遭う, た.