Chinese-Prestudy icon indicating copy to clipboard operation
Chinese-Prestudy copied to clipboard

FR: Proposal for deck search configuration

Open BorisNA opened this issue 1 year ago β€’ 0 comments

I have a proposal for the known words deck search configuration. It already works for me, so if you are Ok, I will make a PR.

Instead of hardcoded heuristic we can move it to the configuration to the config file. There will be an array of search conditions, each of those conditions containing:

  • a set of decks to search
  • a set of fields to search in these decks
  • search query to limit search
  • an additional search query to exclude (it can be a little overhead but it looks like it is needed for difficult configurations)

For example, we include seen words from two main study decks (with different fields in each) without suspended ones:

        "known_words": [
            {
                "decks": [
                    "πŸ‡¨πŸ‡³ δΈ­ζ–‡::Hanzi", "πŸ‡¨πŸ‡³ δΈ­ζ–‡::Words"
                ],
                "fields": [
                    "Hanzi", "Word"
                ],
                "search_exclude": "is:suspended OR tag:leech",
                "search_include": "-is:new"
            },

And also add "known" all words, that are hidden in another deck (suspended, active,... all):

            {
                "decks": [
                    "πŸ‡¨πŸ‡³ δΈ­ζ–‡::z_known"
                ],
                "fields": [
                    "Hanzi",
                    "Simplified"
                ],
                "search_exclude": "",
                "search_include": ""
            }

Yes, it could be a little hard for ordinary user, but it is easy to implement and gives more than enough configurability.

Another possible option would be to borrow idea, UI (and code?) from anki-morph plugin

BorisNA avatar Nov 11 '23 10:11 BorisNA