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
48 stars 6 forks source link

Duplicate unknowns #138

Closed mortii closed 5 months ago

mortii commented 5 months ago

Screenshot from 2024-01-26 12-55-35

This should only count as one unknown, not two.

This happend after morphemizers started returning lists instead of sets. Returning lists is still necessary for the readability analyzer, but we should convert them into sets when recalcing.

Card ID 1529914007376

aleksejrs commented 5 months ago

I also have duplicate unknowns, but it is probably because I configured two of each note type: one read-only without filters, and one read-write excluding MorphMan tags.

mortii commented 5 months ago

@aleksejrs that's interesting. I'll try to reproduce it.

mortii commented 5 months ago

@aleksejrs I'm not able to reproduce this. Could you provide the following:

  1. a screenshot of a card that is affected by this
  2. go to Tools -> Add-ons -> Ankimorphs -> Config -> copy paste the json found there
aleksejrs commented 5 months ago

As far as I can tell, it is not happening when the include section of the second definition for the note type contains

                "mm_orderedbymorphman",

When it does not contain that, the below happens. But I am not sure, because after I remove that line from the configuration in Tools -> Add-ons -> Ankimorphs -> Config, restarting Anki adds the line back.

Card ID 1706668716061 Note ID 1706668716061

The relevant fields from the card:

2: Las manzanas son buenas.
am-unknowns: manzanas, manzanas
am-unknowns-count: 2
am-highlighted: Las manzanas son buenas.
am-difficulty: 1499999
Tags: am-not-ready  and irrelevant tags

I removed the irrelevant note types.

{
    "filters": [
        {
            "extra_difficulty": true,
            "extra_highlighted": true,
            "extra_unknowns": true,
            "extra_unknowns_count": true,
            "field": "2",
            "field_index": 2,
            "modify": true,
            "morph_priority": "frequency.csv",
            "morph_priority_index": 1,
            "morphemizer_description": "AnkiMoprhs: Language w/ Spaces",
            "morphemizer_name": "SpaceMorphemizer",
            "note_type": "C-Bas-noMMQ",
            "note_type_id": 1676618086806,
            "read": true,
            "tags": {
                "exclude": [
                    "mm_alreadyKnown",
                    "mm_comprehension",
                    "mm_frequency",
                    "mm_fresh",
                    "mm_notReady",
                    "mm_orderedbymorphman",
                    "mm_vocab"
                ],
                "include": []
            }
        },
        {
            "extra_difficulty": true,
            "extra_highlighted": true,
            "extra_unknowns": true,
            "extra_unknowns_count": true,
            "field": "2",
            "field_index": 2,
            "modify": false,
            "morph_priority": "frequency.csv",
            "morph_priority_index": 1,
            "morphemizer_description": "AnkiMoprhs: Language w/ Spaces",
            "morphemizer_name": "SpaceMorphemizer",
            "note_type": "C-Bas-noMMQ",
            "note_type_id": 1676618086806,
            "read": true,
            "tags": {
                "exclude": [],
                "include": []
            }
        }
    ],
    "preprocess_ignore_bracket_contents": false,
    "preprocess_ignore_names_morphemizer": false,
    "preprocess_ignore_names_textfile": false,
    "preprocess_ignore_round_bracket_contents": true,
    "preprocess_ignore_slim_round_bracket_contents": true,
    "preprocess_ignore_suspended_cards_content": true,
    "recalc_interval_for_known": 66,
    "recalc_on_sync": false,
    "recalc_read_known_morphs_folder": false,
    "recalc_suspend_known_new_cards": false,
    "recalc_toolbar_stats_use_known": true,
    "recalc_toolbar_stats_use_seen": false,
    "shortcut_browse_all_same_unknown": "Shift+L",
    "shortcut_browse_ready_same_unknown": "L",
    "shortcut_frequency_file_generator": "Ctrl+Shift+F",
    "shortcut_known_morphs_exporter": "Ctrl+Shift+E",
    "shortcut_learn_now": "Ctrl+Alt+N",
    "shortcut_readability_report_generator": "Ctrl+Shift+R",
    "shortcut_recalc": "Ctrl+M",
    "shortcut_set_known_and_skip": "K",
    "shortcut_settings": "Ctrl+O",
    "shortcut_view_morphemes": "Ctrl+Alt+V",
    "skip_only_known_morphs_cards": true,
    "skip_show_num_of_skipped_cards": true,
    "skip_unknown_morph_seen_today_cards": true,
    "tag_known_automatically": "am-known-automatically",
    "tag_known_manually": "am-known-manually",
    "tag_learn_card_now": "am-learn-card-now",
    "tag_not_ready": "am-not-ready",
    "tag_ready": "am-ready"
}
aleksejrs commented 5 months ago

But I am not sure, because after I remove that line from the configuration in Tools -> Add-ons -> Ankimorphs -> Config, restarting Anki adds the line back. Maybe that's a bug.

mortii commented 5 months ago

@aleksejrs that's weird. Could you provide a deck with said cards?

mortii commented 5 months ago

I managed to reproduce it. I'll try fixing it.

mortii commented 5 months ago

My god, I forgot to specify a primary key for the Card_Morph_Map table, so it stored duplicate values. I'll release a hotfix now.

github-actions[bot] commented 4 months ago

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.