mortii / anki-morphs

A MorphMan fork rebuilt from the ground up with a focus on simplicity, performance, and a codebase with minimal technical debt.
https://mortii.github.io/anki-morphs/
Mozilla Public License 2.0
47 stars 6 forks source link

Fix am-known-automatically not being assigned properly #210

Closed schiozzone closed 3 months ago

schiozzone commented 3 months ago

Fixes an issue where am-known-automatically was not being applied to new cards with all known morphemes in cases where the card contained at least one morpheme that was manually set as known or loaded from the known-morphs folder.

What is the current behavior?

Known morphs loaded from the known-morphs folder are being assigned a highest_learning_interval of am_config.recalc_interval_for_known (L372). However, this caused such morphs to be considered 'in learning' inside the function _get_card_score_and_unknowns_and_learning_status since it checks for intervals that are lower or equal that value (L734).

This resulted in a situation where new cards with all known morphs, where at least some of them were loaded from the known-morphs folder, were considered to have learning morphs in them, preventing the card from getting tagged with am-known-automatically even though all of its morphs were known.

What is the new behavior?

For the purpose of tagging a new card, morphs are now considered to be 'in learning' when their highest learning interval is strictly less than the "learning interval of known morphs" set in the configuration.

New cards containing only known morphs, regardless of how they got their 'known' status, will now be properly tagged with am-known-automatically.

What kind of changes does this PR introduce?

Checklist:

mortii commented 3 months ago

Ah, classic mistake. Thank you so much!