kaegi / MorphMan

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

Japanese UNAVAILABLE #272

Closed megarafa35000 closed 1 year ago

megarafa35000 commented 2 years ago

Error when i try to Recalc and well to start with when I go to preferences, in the morphemizer tab I get "Japanese UNAVAILABLE" instead of "japanese". I do have the japanese support add on

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, repeating 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-on 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: 2022-04-23 20:24:51

Caught exception: Traceback (most recent call last): File "C:\Users\José\AppData\Roaming\Anki2\addons21\900801631\morph\util_external.py", line 38, in call return self.cache[args] KeyError: ('私[わたし;h]はアン[;a]です。',)

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "C:\Users\José\AppData\Roaming\Anki2\addons21\900801631\morph\util_external.py", line 38, in call return self.cache[args] KeyError: ('私[わたし;h]はアン[;a]です。',)

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "C:\Users\José\AppData\Roaming\Anki2\addons21\900801631\morph\util_external.py", line 38, in call return self.cache[args] KeyError: ()

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "C:\Users\José\AppData\Roaming\Anki2\addons21\900801631__init.py", line 17, in onMorphManRecalc main.main() File "C:\Users\José\AppData\Roaming\Anki2\addons21\900801631\morph\main.py", line 581, in main allDb = mkAllDb(cur) File "C:\Users\José\AppData\Roaming\Anki2\addons21\900801631\morph\main.py", line 196, in mkAllDb ms = getMorphemes(morphemizer, fieldValue, ts) File "C:\Users\José\AppData\Roaming\Anki2\addons21\900801631\morph\morphemes.py", line 166, in getMorphemes ms = morphemizer.getMorphemesFromExpr(expression) File "C:\Users\José\AppData\Roaming\Anki2\addons21\900801631\morph\morphemizer.py", line 49, in getMorphemesFromExpr morphs = self._getMorphemesFromExpr(expression) File "C:\Users\José\AppData\Roaming\Anki2\addons21\900801631\morph\morphemizer.py", line 113, in _getMorphemesFromExpr return getMorphemesMecab(expression) File "C:\Users\José\AppData\Roaming\Anki2\addons21\900801631\morph\util_external.py", line 40, in call value = self.func(args) File "C:\Users\José\AppData\Roaming\Anki2\addons21\900801631\morph\mecab_wrapper.py", line 106, in getMorphemesMecab ms = [getMorpheme(m.split('\t')) for m in interact(e).split('\r')] File "C:\Users\José\AppData\Roaming\Anki2\addons21\900801631\morph\util_external.py", line 40, in call value = self.func(args) File "C:\Users\José\AppData\Roaming\Anki2\addons21\900801631\morph\mecabwrapper.py", line 253, in interact p, = mecab() File "C:\Users\José\AppData\Roaming\Anki2\addons21\900801631\morph\util_external.py", line 40, in call__ value = self.func(args) File "C:\Users\José\AppData\Roaming\Anki2\addons21\900801631\morph\mecab_wrapper.py", line 246, in mecab return spawnMecab(m.mecabCmd[:1] + m.mecabCmd[4:], si), mecab_source File "C:\Users\José\AppData\Roaming\Anki2\addons21\900801631\morph\mecab_wrapper.py", line 129, in spawnMecab '^bos-feature: (.)$', str(config_dump, 'utf-8'), flags=re.M) UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe9 in position 114: invalid continuation byte

ghost commented 2 years ago

Try using this parser: https://github.com/Luukuton/MeCabUniDic

It's much better than the one included in Japanese Support and it's been recently updated :)

megarafa35000 commented 2 years ago

@yaoberh Thats what I did yesterday but thank you anyway. Still i wonder if the word count is accurate because it says i know about 1200 words and Im still only finishing the tango n5 deck wich covers like a 1000 words, still better then no tracking doe

ghost commented 2 years ago

It's not so strange that it shows you 1200 instead of 1000. Once you've finished that deck, just mark everything in it as already known and you'll be ready to proceed to the next step. I got all the way up to N0 and the numbers don't always match up. It's a pretty complex algorithm and you have to bear in mind that many characters appear in other words, so it correlates these things too. Glad it's at least working :)

landonepps commented 1 year ago

Issue seems resolved, closing.

Also 1200 is expected because it's counting morphemes, not words. For instance 戻ってくる is has 3 "morphs": 戻っ, て, and くる.