Back

Mighty Morphin Morphology

Yes, it did complete updating.

Btw, I also get this error when I try to use "Save results to DB".

Sorry to be pain Smile

An error occurred in a plugin. Please contact the plugin author.
Please do not file a bug report with Anki.

Traceback (most recent call last):
File "/Users/andrew/Library/Application Support/Anki/plugins/morph/manager.py", line 277, in onSaveResults
self.db.save( destPath )
File "/Users/andrew/Library/Application Support/Anki/plugins/morph/morphemes.py", line 168, in save
par = os.path.split( path )[0]
File "posixpath.pyc", line 82, in split
AttributeError: 'QString' object has no attribute 'rfind'
Edited: 2011-09-17, 9:31 am
Reply
andrewkun Wrote:Yes, it did complete updating.

Btw, I also get this error when I try to use "Save results to DB".

Sorry to be pain Smile

An error occurred in a plugin. Please contact the plugin author.
Please do not file a bug report with Anki.

Traceback (most recent call last):
File "/Users/andrew/Library/Application Support/Anki/plugins/morph/manager.py", line 277, in onSaveResults
self.db.save( destPath )
File "/Users/andrew/Library/Application Support/Anki/plugins/morph/morphemes.py", line 168, in save
par = os.path.split( path )[0]
File "posixpath.pyc", line 82, in split
AttributeError: 'QString' object has no attribute 'rfind'
Oh. Strange I didn't encounter that but I know the fix for that error. As for it not updating your card ordering, can you try this:

1) make a copy of your deck, enable morph man for it then open it up
2) reset scheduling info on all the cards and close the deck
3) wait for morph man to update the copy
4) open the deck and see if the order is correct now (not sure if this will work, but it'll help me guess what could be wrong more easily)
5) if not, send me / post the log file (plugindir/morph/tests/auto.log) [note it clears the log when you open anki, so do this before you start anki again)
Reply
I've released version 2.03, which includes a handful of minor fixes/additions people have mentioned, such as:

1. Strip fields of html before processing
2. Apply whitelist/blacklists when generating morphemes for a list. Defaults to punctuation and UNKNOWN (ie, what mecab can't figure out- usually english), so this should fix the problem nest0r mentioned previously. User configurable.
3. Instead of just an i+N field there is now separate i+N known and mature fields (defaults to iPlusN and iPlusNmature, but user configurable).
4. Tags facts with 'noMorphemes' if they have none (useful for non-subs2srs decks or if you don't perform culling of simplistic cards in subs2srs)
5. Tags facts with ip0matureEver and ip1knownEver if they ever were i+0 mature or i+1 known. These tags won't go away if they stop meeting the requirements, which should fix the problem nest0r mentioned with automatic demotion from just using ip0mature and ip1known.
6. Added a part of speech whitelist to the GUI db viewer.
7. Sorting by MorphManIndex now works even if you don't have a MMI field in your deck. This way you need zero additional fields for Morph Man 2 to still fulfill it's primary purpose.

I'm still looking at exporting to various formats and an option to base everything on inflected forms, but if there's anything else I missed, feel free to (re)suggest it.
Reply
May 16 - 30 : Pretty Big Deal: Save 31% on all Premium Subscriptions! - Sign up here
JapanesePod101
I've released v2.05 which adds a new adaptive subtitles feature as well as a minor bugfix for people using the codebase without Anki.
Reply
Just wondering if the algorithm uses seen cards that have been suspended. I'm asking because I have a lot of easy cards coming up that I don't necessarily need to see again. However, my deck is fairly new, so Morphman doesn't have that much data with which to work. I'm wondering if it would be better to delete or just suspend them. Thanks. Smile
Reply
Earthlark Wrote:Just wondering if the algorithm uses seen cards that have been suspended. I'm asking because I have a lot of easy cards coming up that I don't necessarily need to see again. However, my deck is fairly new, so Morphman doesn't have that much data with which to work. I'm wondering if it would be better to delete or just suspend them. Thanks. Smile
It's based on the highest interval of all the cards associated with the fact. So yes, it uses seen cards that have been suspended- but since most things are calculated based on known and/or mature.db, it would have had to been suspended after it already became known/mature (defaults to an interval of 3 and 21 days, respectively).

Are the cards it's showing i+0 or i+1? If they're i+1 and too easy then yes, it's probably just because it doesn't have enough data to accurate flesh out your known/mature morphemes. Suspending them wouldn't help because those morphemes would continue to be considered unknown, so instead you should just hit 4 (very easy) and quickly make those cards mature. Alternatively, you could manually merge known.db and mature.db with a database made from a text file full of stuff you know well (if you do tons of study outside Anki).

If they're i+0 then they _should_ be easy. I'd recommend to either use selective study to only show new cards that are tagged ip1known, suspend those i+0 cards liberally, or use the auto-promotion thing nest0r and I have been experimenting with to make the i+0 cards become sentence/comprehension cards.
Reply
Hey overture, it seems there is a memory leak in this plugin. Every time the 10 second script runs, it adds about a megabyte to the anki process (I just found anki sitting on 1.5GB).

By the way, I sent you a pull request on github some time ago that checks which encoding mecab is using instead of hard-coding euc-jp. Not sure if you noticed, but it's there if you want it.

Also, I said I'd keep you updated, so: that stuff I said I'd do a couple months back (query for words by kanji with specific reading). Well...it turned out to be significantly more difficult than I first thought. While I managed to get something that works well enough with around 90% accuracy, I will continue to feel defeated until it's 100%. That's why I intend to start a project to do semi-automated alignment and verification of kanji/reading pairs inside words. I'll make a thread here when I need some humans. I'm hoping to have something up before the end of the year. Sadly, I have a job now, which is proving to be a hindrance. That, and I started Japanese from scratch, so I have a lot of catching up to do before I get back to writing any code. But, that is beyond the scope of this plugin, so I won't pollute the thread.
Reply
netsplitter Wrote:Hey overture, it seems there is a memory leak in this plugin. Every time the 10 second script runs, it adds about a megabyte to the anki process (I just found anki sitting on 1.5GB).
Interesting, I'll glance over the code to see what could be causing it.

netsplitter Wrote:By the way, I sent you a pull request on github some time ago that checks which encoding mecab is using instead of hard-coding euc-jp. Not sure if you noticed, but it's there if you want it.
Doh, I should check that more; I usually just push code (free storage and public access) and never look at the page , but that's awesome that you sent a patch upstream.

netsplitter Wrote:Also, I said I'd keep you updated...
Yea, juggling work and personal projects is a pain, but good luck. It'd certainly be nice to improve the vocab ranking algorithm once you feel it's complete.
Reply
Feature request:
When learning new words through sentences, it would be nice to get a number of sentences with the same new word in it. So instead of learning a new word from just one sentence, you learn it from a number of sentences.

To implement this, we could put a priority on words that have other facts that are not mature (I guess that makes them young cards). So a card with one unknown which is present in a number of other young cards and not present in mature cards will be preferred over a card with an unknown that has never been seen before.

Question:
Is there a way to schedule new cards so they are sorted on morphManIndex? Currently I am just suspending/un-suspending as needed, but this is extra work.



Great work overture :)
Reply
overture2112 Wrote:It's based on the highest interval of all the cards associated with the fact. So yes, it uses seen cards that have been suspended- but since most things are calculated based on known and/or mature.db, it would have had to been suspended after it already became known/mature (defaults to an interval of 3 and 21 days, respectively).
Thanks. Just what I was looking for. Smile

I'll check out the auto-promotion things as well.
Reply
Hey, I think I've detected a bug. I have noticed that for some of my cards, I'm getting an iPlusN that is less than the iPlusNmature. Since anything mature must be known, this shouldn't happen (as I understand them). When I first saw this, I thought that my databases probably got corrupted or out of sync, so I wiped them and regenerated from scratch and got the same thing.

Got any ideas? Would you like me to send you my deck (I only have the one I'm using for Morphman) for analysis?
Reply
@gwedig: I think that's how it's supposed to be. iplusn is calculated using all known facts, but iplusnmature is restricted to mature knowns. Less knowns obviously means it will find more unknowns in the sentence.
Reply
Whoops. You're right. I wrote it backwards. The problem is I'm seeing a iPlusN > iPlusNmature. iPlusN < iPlusNmature is expected, as you say. I am seeing wrong direction cases, though, even if I can't explain them correctly.

Thanks for the correction.
Reply
Ah, I see. That does sound bad....
Reply
Ok, now I feel like a real idiot. I found the problem. I recently changed some deck fields and it looks like when I updated morph man's config for the deck, I had a typo. So only iPlusNmature was being updated.

Sorry for the false alarm! Wink
Reply
Got a suggestion and two minor issues Smile

1) Is there a reason why it needs to update everything every 10 seconds? I would think that once a day is more than enough for most purposes - unless I'm missing something here...

2) Some of my decks don't appear in the Control Auto list thingy... the four that do appear are sentence decks, but it's missing a couple others.

3) I get the following error message:

Code:
Exception in thread Thread-1:
Traceback (most recent call last):
File "C:\cygwin\home\dae\Home\anki\win\build\pyi.win32\anki\outPYZ1.pyz/threading", line 530, in __bootstrap_inner
File "C:\Users\bzap\AppData\Roaming\.anki\plugins\morph\auto.py", line 494, in run
run()
File "C:\Users\bzap\AppData\Roaming\.anki\plugins\morph\auto.py", line 449, in run
dm = DeckMgr( deck )
File "C:\Users\bzap\AppData\Roaming\.anki\plugins\morph\auto.py", line 51, in __init__
self.deckName = str( deck.name() )
UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-10: ordinal not in range(128)
...every time I open Anki. Not sure what's going on here.
Reply
Hi I have linux mint based on ubuntu 10 with anki 1.28
i have this when i create known.db

Traceback (most recent call last):
File "/home/name/.anki/plugins/morph/util.py", line 97, in
ed.connect( a, SIGNAL('triggered()'), lambda e=ed: doOnSelection( e, overviewMsg, progMsg, preF, perF, postF ) )
File "/home/name/.anki/plugins/morph/util.py", line 82, in doOnSelection
st = perF( st, f )
File "/home/name/.anki/plugins/morph/exportMorphemes.py", line 25, in per
ms = M.getMorphemes( st['mp'], f[ fname ] )
File "/usr/share/anki/anki/facts.py", line 89, in __getitem__
raise KeyError(key)
KeyError: PyQt4.QtCore.QString(u'')
Can you help me?
Tnx
Reply
Exception in thread Thread-1:
Traceback (most recent call last):
File "/usr/lib/python2.6/threading.py", line 532, in __bootstrap_inner
self.run()
File "/home/name/.anki/plugins/morph/auto.py", line 494, in run
run()
File "/home/name/.anki/plugins/morph/auto.py", line 454, in run
closeDeck( deck )
File "/home/name/.anki/plugins/morph/auto.py", line 38, in closeDeck
deck.s.rollback()
File "/usr/share/anki/anki/hooks.py", line 61, in repl
new(*args, **kwargs)
File "/usr/share/anki/ankiqt/ui/main.py", line 2874, in checkProgressHandler
raise Exception("Accessed DB while in progress handler")
Exception: Accessed DB while in progress handler

this is another error

Thanks for help
Reply
I've tried to get this ingenious plugin to work but i get lost when saving a known deck. I've tried opening a new deck and added fields of Expressions iPlusN vocabRank unknown (by number), and it looks like it gives a new order for things but not ascending from easiest possible to learn.

Basically i dont know what i should be doing so can someone write a layman's guide walkthrough because as i havent changed any anki settings and just do the basic Kore2k deck the simple front back deal.

I've looked through the wiki and the first post through, but its already over my head, but i think this plugin could be really useful so if someone could help id really appreciate it.
Reply
This looks like an awesome plugin, But i just can't find out how to set it up,Those Instructions are just way to hard writen for me .( the only thing i know about anki is how to review regular decks) as far as i can make up about morphman is that it is fully automatic,(or isn't it?) so i imagine that when i do enough sentences it will automaticly will seek the best match for me? also i expierience an error when i try to export morphemes:

Traceback (most recent call last):
File "C:\Users\name\AppData\Roaming\.anki\plugins\morph\util.py", line 97, in
ed.connect( a, SIGNAL('triggered()'), lambda e=ed: doOnSelection( e, overviewMsg, progMsg, preF, perF, postF ) )
File "C:\Users\name\AppData\Roaming\.anki\plugins\morph\util.py", line 71, in doOnSelection
st = preF( ed )
File "C:\Users\name\AppData\Roaming\.anki\plugins\morph\exportMorphemes.py", line 20, in pre
return { 'ed':ed, 'fieldName':field, 'filePath'Confusedtr(path), 'db':M.MorphDb(), 'mp':M.mecab() }
File "C:\Users\name\AppData\Roaming\.anki\plugins\morph\morphemes.py", line 69, in mecab
return subprocess.Popen( mecabCmd, bufsize=-1, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, startupinfo=si )
File "C:\cygwin\home\dae\Home\anki\win\build\pyi.win32\anki\outPYZ1.pyz/subprocess", line 672, in __init__
File "C:\cygwin\home\dae\Home\anki\win\build\pyi.win32\anki\outPYZ1.pyz/subprocess", line 882, in _execute_child
Reply
Xenithar Wrote:1) Is there a reason why it needs to update everything every 10 seconds? I would think that once a day is more than enough for most purposes - unless I'm missing something here...
The idea is you open a deck, do your reviews and a few new cards, then close the deck (either to take a break or switch to another deck). During this time it will update based on your changes to that deck so that when you get back from your break or switch decks again, you'll be using the most up to date information.

This is also handy if you start a new subs2srs deck and don't know the character names. Generally shows will have 1-2 word sentences of someone's name and so morphman will prioritize these (since they're i+1 and fairly short) and by learning them you'll open up tons of other sentences from the show which depend on them.

Xenithar Wrote:2) Some of my decks don't appear in the Control Auto list thingy... the four that do appear are sentence decks, but it's missing a couple others.
Strange, are they located somewhere other than the default anki deck directory? Also try checking the log file.

Xenithar Wrote:3) I get the following error message:

Code:
Exception in thread Thread-1:
Traceback (most recent call last):
File "C:\cygwin\home\dae\Home\anki\win\build\pyi.win32\anki\outPYZ1.pyz/threading", line 530, in __bootstrap_inner
File "C:\Users\bzap\AppData\Roaming\.anki\plugins\morph\auto.py", line 494, in run
run()
File "C:\Users\bzap\AppData\Roaming\.anki\plugins\morph\auto.py", line 449, in run
dm = DeckMgr( deck )
File "C:\Users\bzap\AppData\Roaming\.anki\plugins\morph\auto.py", line 51, in __init__
self.deckName = str( deck.name() )
UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-10: ordinal not in range(128)
...every time I open Anki. Not sure what's going on here.
It sounds like you have a deck whose name isn't pure ascii. I'd like to remove such restrictions in a future version, but for now an easy fix is just to make deck names (and probably field names and some other things too?) ascii.
Reply
gnagai Wrote:Hi I have linux mint based on ubuntu 10 with anki 1.28
i have this when i create known.db

Traceback (most recent call last):
File "/home/name/.anki/plugins/morph/util.py", line 97, in
ed.connect( a, SIGNAL('triggered()'), lambda e=ed: doOnSelection( e, overviewMsg, progMsg, preF, perF, postF ) )
File "/home/name/.anki/plugins/morph/util.py", line 82, in doOnSelection
st = perF( st, f )
File "/home/name/.anki/plugins/morph/exportMorphemes.py", line 25, in per
ms = M.getMorphemes( st['mp'], f[ fname ] )
File "/usr/share/anki/anki/facts.py", line 89, in __getitem__
raise KeyError(key)
KeyError: PyQt4.QtCore.QString(u'')
Can you help me?
Tnx
At least one fact in your deck doesn't contain the field you told it to extract from. So, if you left it as the default ("Expression"), that means some fact in your deck doesn't contain that field.

Most likely this means you simply don't have such a field name in your model (n.b. it's case sensitive) but on rare occasion it might mean just a few facts here or there. If it really is the latter, you could try using anki's database error checking option, renaming the field to something else and renaming it back, or asking on the anki forums.
Reply
gnagai Wrote:Exception in thread Thread-1:
Traceback (most recent call last):
File "/usr/lib/python2.6/threading.py", line 532, in __bootstrap_inner
self.run()
File "/home/name/.anki/plugins/morph/auto.py", line 494, in run
run()
File "/home/name/.anki/plugins/morph/auto.py", line 454, in run
closeDeck( deck )
File "/home/name/.anki/plugins/morph/auto.py", line 38, in closeDeck
deck.s.rollback()
File "/usr/share/anki/anki/hooks.py", line 61, in repl
new(*args, **kwargs)
File "/usr/share/anki/ankiqt/ui/main.py", line 2874, in checkProgressHandler
raise Exception("Accessed DB while in progress handler")
Exception: Accessed DB while in progress handler

this is another error

Thanks for help
A deck open in Anki is locked and inaccessible by Morph Man until you close it, but Anki isn't completely thread safe. There's a few bugs where Morph Man will use code in Anki libraries that is assumed to be on the one-and-only Anki thread when it is, in fact, not.

Most of the bugs I've seen have come from code triggering some hook which is assumed to apply to the deck Anki has open rather than the one Morph Man is working with, which seems to also be the case here.

The upshot is that this error is a false positive, you can safely ignore it, and I'll add it to the list of fixes needed for the next release.
Reply
sammiad Wrote:Basically i dont know what i should be doing so can someone write a layman's guide walkthrough because as i havent changed any anki settings and just do the basic Kore2k deck the simple front back deal.

I've looked through the wiki and the first post through, but its already over my head, but i think this plugin could be really useful so if someone could help id really appreciate it.
and
Lolicon Wrote:This looks like an awesome plugin, But i just can't find out how to set it up,Those Instructions are just way to hard writen for me .( the only thing i know about anki is how to review regular decks)
=> I'll try to add a tutorial some time this week.

Lolicon Wrote:as far as i can make up about morphman is that it is fully automatic,(or isn't it?) so i imagine that when i do enough sentences it will automaticly will seek the best match for me?
Yes, it will automatically scan your decks to determine which morphemes they contain and how well you know them (based on the highest review interval of all the facts that contain said morpheme). Using this information it then constantly recalculates your known.db and mature.db, changes various fields on your deck according to their cfg (but only if they're available), and changes creation timestamps to manipulate Anki into present them in optimal order (ie, in Morph Man Index order).

Lolicon Wrote:also i expierience an error when i try to export morphemes:

Traceback (most recent call last):
File "C:\Users\name\AppData\Roaming\.anki\plugins\morph\util.py", line 97, in
ed.connect( a, SIGNAL('triggered()'), lambda e=ed: doOnSelection( e, overviewMsg, progMsg, preF, perF, postF ) )
File "C:\Users\name\AppData\Roaming\.anki\plugins\morph\util.py", line 71, in doOnSelection
st = preF( ed )
File "C:\Users\name\AppData\Roaming\.anki\plugins\morph\exportMorphemes.py", line 20, in pre
return { 'ed':ed, 'fieldName':field, 'filePath'Confusedtr(path), 'db':M.MorphDb(), 'mp':M.mecab() }
File "C:\Users\name\AppData\Roaming\.anki\plugins\morph\morphemes.py", line 69, in mecab
return subprocess.Popen( mecabCmd, bufsize=-1, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, startupinfo=si )
File "C:\cygwin\home\dae\Home\anki\win\build\pyi.win32\anki\outPYZ1.pyz/subprocess", line 672, in __init__
File "C:\cygwin\home\dae\Home\anki\win\build\pyi.win32\anki\outPYZ1.pyz/subprocess", line 882, in _execute_child
It looks like it failed to run mecab. Most likely you don't have the japanese plugin installed and adding it will fix this. Otherwise (maybe you use unix/mac?) your system's installation of mecab is broken.
Reply
i'm pretty sure that i installed the japanese plugin+ the additional files. I even reinstalled them but without succses . I also tried to run mecab.exe, its said it couldn't find proggramfiles/mecab/bin/mecab.exe, so i copied the mecab map there but badly enough without succses again. i also tried it on an other computer. while it worked the first time it didnt work the second time when i tried to export morphohemes.
Reply