kaegi / MorphMan

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

Error when grading card whose "focus" field contains brackets #261

Closed ryanbstifler closed 2 years ago

ryanbstifler commented 2 years ago

I am using Migaku Japanese to add the readings and accents of the words to my cards, but everytime I try to grade a card whose focus field contains brackets (and other things between them), like the one below, I get an error.

image image

When the "focus" field have no brackets (only the word), it works just fine.

Error:

Error An error occurred. Please start Anki while holding down the shift key, which will temporarily disable the add-ons you have installed. If the issue only occurs when add-ons are enabled, please use the Tools>Add-ons menu item to disable some add-ons and restart Anki, repeat until you discover the add-on that is causing the problem. When you've discovered the add-on that is causing the problem, please report the issue on the add-ons section of our support site. Debug info: Anki 2.1.35 (84dcaa86) Python 3.8.0 Qt 5.14.2 PyQt 5.14.2 Platform: Windows 10 Flags: frz=True ao=True sv=2 Add-ons, last update check: 2021-11-26 09:27:24

Caught exception: Traceback (most recent call last): File "aqt\reviewer.py", line 299, in File "C:\Users\ryanb\AppData\Roaming\Anki2\addons21\PassFail (JP)__init__.py", line 41, in AKR_answerCard __oldFunc(self, ease) File "<C:\Program Files\Anki\decorator.pyc:decorator-gen-104>", line 2, in _answerCard File "anki\hooks.py", line 638, in decorator_wrapper File "anki\hooks.py", line 632, in repl File "C:\Users\ryanb\AppData\Roaming\Anki2\addons21\900801631\morph\newMorphHelper.py", line 180, in my_reviewer_answerCard markFocusSeen(self, self.card.note()) File "C:\Users\ryanb\AppData\Roaming\Anki2\addons21\900801631\morph\newMorphHelper.py", line 94, in markFocusSeen num_skipped = len(self.mw.col.findNotes(q)) - 1 File "anki\collection.py", line 453, in find_notes File "anki\rsbackend_gen.py", line 88, in search_notes File "anki\rsbackend.py", line 267, in _run_command anki.rsbackend.InvalidInput: regex parse error: (?i)(^|,|\s)味見[あじみ;h($|,|\s) ^ error: unclosed character class

bxkx commented 2 years ago

This was previously reported, just don't use the pitch accent stuff in that field. This is most likely not going to get fixed. Morphman is abandoned.

ianki commented 2 years ago

It's possible to fix this specific error, however I think that using syntax on the focus field that's internally used by MorphMan is going to lead to other problems since that field is used to match the morphemes it generates. I suggest to not modify this auto generated field.

ianki commented 2 years ago

Opening since I plan to fix this error. Still, I suggest to not use formatting on this field or other functionality may break.