Perhaps you could use a Python script to add special tags to all the cards
you want. As an example, I've attached a simple Python script that you can
modify as needed.
However, writing such a script might require some Python skills. But I
believe it's easy to learn, and I encourage you to give it a try.
在2025年1月17日星期五 UTC+8 23:08:38<Greg Reagle> 写道:
> Hello. I am using Mnemosyne with pipx:
> package mnemosyne-proj 2.11.0.2, installed using Python 3.11.2
>
> How do I exclude cards based on their tags? This would be equivalent to a
> logical AND NOT or a set theory SET DIFFERENCE.
>
> For example, I am studying cards with tags A or B or C, and I come across
> a card that I find annoying and I want to forget about or suspend. I want
> to be able to add tag X and filter equivalent to:
> (A OR B OR C) AND NOT X
> (A UNION B UNION C) MINUS X
>
> This could be for leeches, or for information that I just find annoying,
> or cards that are low priority when I am very busy.
>
> I know that I could remove tags A, B, and C for the card in question, but
> this has some significant disadvantages. I permanently lose the information
> that was conveyed by the presence of tags A, B, and C. To get it back into
> rotation in the future, I have to re-add all three tags A, B, and C,
> instead of the much more convenient deleting just tag X.
>
> I am using some logic and set "algebra" here for clarity, for those who
> understand it. I am not insinuating that the interface needs to use these
> mathematical concepts directly.
>
--
You received this message because you are subscribed to the Google Groups
"mnemosyne-proj-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion visit
https://groups.google.com/d/msgid/mnemosyne-proj-users/5de618ca-5487-44b2-857a-b25aa662b479n%40googlegroups.com.
# logical tag processer script written for Greg Reagle
# Usage
# tag_list contains all tags in string, each as an element
# chooser decides which card should be tagged with a special tag
# the special tag's name is defined as SPECIAL_TAG_NAME as string
import copy
from mnemosyne.script import Mnemosyne
def chooser(tags) -> bool:
# change statements here
if ("tag_name_A" in tags) and not ("tag_name_B" in tags):
return True
return False
SPECIAL_TAG_NAME: str = "specialTag"
# 'data_dir = None' will use the default system location, edit as appropriate.
data_dir = None
mnemosyne = Mnemosyne(data_dir)
for _card_id, _fact_id in mnemosyne.database().cards():
card = mnemosyne.database().card(_card_id, is_id_internal=True)
new_fact_data = copy.copy(card.fact.data)
tag_list = []
for a in card.tags:
tag_list.append(a.name)
if chooser(tag_list):
tag_list.append(SPECIAL_TAG_NAME)
mnemosyne.controller().edit_card_and_sisters(
card, new_fact_data, card.card_type, tag_list, {}
)
mnemosyne.finalise()