kanji koohii FORUM
Mighty Morphin Morphology - Printable Version

+- kanji koohii FORUM (http://forum.koohii.com)
+-- Forum: Learning Japanese (http://forum.koohii.com/forum-4.html)
+--- Forum: Learning resources (http://forum.koohii.com/forum-9.html)
+--- Thread: Mighty Morphin Morphology (/thread-7486.html)

Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18


Mighty Morphin Morphology - overture2112 - 2011-10-24

Lolicon Wrote: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.
Strange, I can't fathom why it would work once and then not again. Can you provide the following info:

1) Where is Anki installed?
2) Where is mecab? (eg, C:\Program Files\Anki\mecab\bin\mecab.exe or /usr/bin/mecab etc)
3) What OS and version are you running?
4) What version of Anki are you using?
5) What version of mecab do you have?
6) Can you post the auto feature's log file (found at path-to-anki-plugin-dir/morph/tests/auto.log, note it resets every time you open Anki)?


Mighty Morphin Morphology - Lolicon - 2011-10-25

1)C:\program files\anki\
2) C:\program files\aniki\mecab\bin\mecab.exe does give the wrong location error here, when placing it at C:\program files\mecab\bin\mecab.exe it just gives me a black box
3) windows 7
4)1.2.8
5)0.98
6)
2011-10-25 17:05:56.045000: ! deck file not found @ C:\Users\name\Documents\Anki\srs.anki
2011-10-25 17:05:56.045000: ! deck file not found @ C:\Users\name\Documents\Anki\Japanese Kana.anki
2011-10-25 17:05:56.045000: Dbs updated in 0.260000
2011-10-25 17:05:56.245000: ! deck file not found @ C:\Users\name\Documents\Anki\srs.anki
2011-10-25 17:05:56.245000: ! deck file not found @ C:\Users\name\Documents\Anki\Japanese Kana.anki
2011-10-25 17:05:56.245000: Decks updated in 0.200000
2011-10-25 17:05:56.245000: Full update completed in 0 sec
2011-10-25 17:06:06.275000: ! deck already open @ C:\Users\name\Documents\Anki\Core 2000 Japanese Vocabulary.anki. skipping
2011-10-25 17:06:06.445000: ! deck file not found @ C:\Users\name\Documents\Anki\srs.anki
2011-10-25 17:06:06.445000: ! deck file not found @ C:\Users\name\Documents\Anki\Japanese Kana.anki
2011-10-25 17:06:06.445000: Dbs updated in 0.200000
2011-10-25 17:06:06.485000: ! deck already open @ C:\Users\name\Documents\Anki\Core 2000 Japanese Vocabulary.anki. skipping
2011-10-25 17:06:06.635000: ! deck file not found @ C:\Users\name\Documents\Anki\srs.anki
2011-10-25 17:06:06.635000: ! deck file not found @ C:\Users\name\Documents\Anki\Japanese Kana.anki


Mighty Morphin Morphology - aec0Xu - 2011-10-25

Hello,

I came here from Anki forum, and I am curious if I could substitute `mecab` with a morpheme analyzer for another language to get this plugin working in different language? What interface and data does an analyzer need to provide to work?

Thanks,


Mighty Morphin Morphology - overture2112 - 2011-10-25

aec0Xu Wrote:Hello,

I came here from Anki forum, and I am curious if I could substitute `mecab` with a morpheme analyzer for another language to get this plugin working in different language? What interface and data does an analyzer need to provide to work?

Thanks,
Thats certainly possible.

Things I can think of:
You'll have to alter morphemes.py to properly connect to the other app and parse data to and from. The program needs to take a line of text and return information on the morphemes used, including the base dictionary and/or inflected forms, part of speech, and reading. You'll also have to change default part of speech white and blacklists.


Mighty Morphin Morphology - walruz - 2011-11-20

Seems like quite a useful plugin. Can't test it, though, because the following keeps popping up when I'm trying to export as per the OP of this thread:

Quote: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 "C:\Users\walruz\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\walruz\AppData\Roaming\.anki\plugins\morph\util.py", line 82, in doOnSelection
st = perF( st, f )
File "C:\Users\walruz\AppData\Roaming\.anki\plugins\morph\exportMorphemes.py", line 25, in per
ms = M.getMorphemes( st['mp'], f[ fname ] )
File "C:\cygwin\home\dae\Home\anki\win\build\pyi.win32\anki\outPYZ1.pyz/anki.facts", line 89, in __getitem__
KeyError: PyQt4.QtCore.QString(u'Expression')
. I tried looking through the thread to see if someone's got similar error messages, but I seem to be the only one (or I just missed it). Any ideas?


Mighty Morphin Morphology - weirdesky - 2011-12-14

I wasn't sure where to put this, but I guess this thread's the best place to do it? I'm sorry I'm bumping a crazy old thread.

I have it working on one of my computers, but when I try to use it on my second computer, I always get the following error:

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

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\���o�[�g\AppData\Roaming\.anki\plugins\morph\auto.py", line 494, in run
run()
File "C:\Users\���o�[�g\AppData\Roaming\.anki\plugins\morph\auto.py", line 449, in run
dm = DeckMgr( deck )
File "C:\Users\���o�[�g\AppData\Roaming\.anki\plugins\morph\auto.py", line 52, in __init__
self.deckPath = str( deck.path )
UnicodeEncodeError: 'ascii' codec can't encode characters in position 9-12: ordinal not in range(128)

Do you guys know what's going on?


Mighty Morphin Morphology - overture2112 - 2011-12-14

weirdesky Wrote: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\���o�[�g\AppData\Roaming\.anki\plugins\morph\auto.py", line 494, in run
run()
File "C:\Users\���o�[�g\AppData\Roaming\.anki\plugins\morph\auto.py", line 449, in run
dm = DeckMgr( deck )
File "C:\Users\���o�[�g\AppData\Roaming\.anki\plugins\morph\auto.py", line 52, in __init__
self.deckPath = str( deck.path )
UnicodeEncodeError: 'ascii' codec can't encode characters in position 9-12: ordinal not in range(128)

Do you guys know what's going on?
Your deck has non ascii characters in it, which morphman doesnt support properly.
Try renaming your deck to just english temporarily to comfirm/workaround.


Mighty Morphin Morphology - Boy.pockets - 2011-12-15

weirdesky Wrote: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\���o�[�g\AppData\Roaming\.anki\plugins\morph\auto.py", line 494, in run
run()
File "C:\Users\���o�[�g\AppData\Roaming\.anki\plugins\morph\auto.py", line 449, in run
dm = DeckMgr( deck )
File "C:\Users\���o�[�g\AppData\Roaming\.anki\plugins\morph\auto.py", line 52, in __init__
self.deckPath = str( deck.path )
UnicodeEncodeError: 'ascii' codec can't encode characters in position 9-12: ordinal not in range(128)

Do you guys know what's going on?
Also make sure the path does not have any non ascii characters in it. Japanese characters for example.


Mighty Morphin Morphology - weirdesky - 2011-12-16

Ohhhhh. My computer's kind of Japanese. That's probably the problem (and the other one isn't). ...is there a way to change where Anki saves its decks?


Mighty Morphin Morphology - franciscobc84 - 2011-12-25

I keep getting this mistake:

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

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:\Documents and Settings\Chico\Application Data\.anki\plugins\morph\auto.py", line 494, in run
run()
File "C:\Documents and Settings\Chico\Application Data\.anki\plugins\morph\auto.py", line 468, in run
closeDeck( deck )
File "C:\Documents and Settings\Chico\Application Data\.anki\plugins\morph\auto.py", line 38, in closeDeck
deck.s.rollback()
File "C:\cygwin\home\dae\Home\anki\win\build\pyi.win32\anki\outPYZ1.pyz/anki.hooks", line 61, in repl
File "C:\cygwin\home\dae\Home\anki\win\build\pyi.win32\anki\outPYZ1.pyz/ankiqt.ui.main", line 2874, in checkProgressHandler
Exception: Accessed DB while in progress handler

Don't have the slightest clue about what's happening...


Mighty Morphin Morphology - overture2112 - 2012-01-05

franciscobc84 Wrote:File "C:\Documents and Settings\Chico\Application Data\.anki\plugins\morph\auto.py", line 38, in closeDeck
deck.s.rollback()
File "C:\cygwin\home\dae\Home\anki\win\build\pyi.win32\anki\outPYZ1.pyz/anki.hooks", line 61, in repl
File "C:\cygwin\home\dae\Home\anki\win\build\pyi.win32\anki\outPYZ1.pyz/ankiqt.ui.main", line 2874, in checkProgressHandler
Exception: Accessed DB while in progress handler
Explanation:
MorphMan was closing a deck (and thus saving the database file) at the same time as the gui was manipulating a deck. Anki falsely assumes only one deck is in use and thus that something bad could happen and so it throws an error. Hopefully later Anki versions will have better threading support but until then MorphMan just performs it's own checks to make sure the same deck isn't opened by MorphMan and Anki itself and tries to avoid Anki's checks (which apparently it didn't do here).

Solution:
I thought I corrected this particular issue for the latest MorphMan and Anki versions, but perhaps not. Does this happen constantly or only every so often? If you just launch Anki and let it sit there without doing anything for a few minutes can MorphMan complete a full pass (check via log file or morph man config window) or does this error occur?


Mighty Morphin Morphology - franciscobc84 - 2012-01-05

Many thanks for the explanation!

I tried doing as you said. I opened Anki and waited, but still got an error.

Here's the message I got:

"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:\Documents and Settings\Chico\Application Data\.anki\plugins\morph\auto.py", line 494, in run
run()
File "C:\Documents and Settings\Chico\Application Data\.anki\plugins\morph\auto.py", line 451, in run
dm.updateDbs()
File "C:\Documents and Settings\Chico\Application Data\.anki\plugins\morph\auto.py", line 294, in updateDbs
newM = self.updateMatureDb()
File "C:\Documents and Settings\Chico\Application Data\.anki\plugins\morph\auto.py", line 251, in updateMatureDb
new = self.delLocsInDb( self.matureDb() ).merge( self.deckMatureDb() )
File "C:\Documents and Settings\Chico\Application Data\.anki\plugins\morph\auto.py", line 271, in matureDb
self._matureDb = M.MorphDb( matureDbPath )
File "C:\Documents and Settings\Chico\Application Data\.anki\plugins\morph\morphemes.py", line 147, in __init__
self.load( path )
File "C:\Documents and Settings\Chico\Application Data\.anki\plugins\morph\morphemes.py", line 180, in load
self.db = pickle.load( f )
File "C:\cygwin\home\dae\Home\anki\win\build\pyi.win32\anki\outPYZ1.pyz/pickle", line 1378, in load
File "C:\cygwin\home\dae\Home\anki\win\build\pyi.win32\anki\outPYZ1.pyz/pickle", line 858, in load
File "C:\cygwin\home\dae\Home\anki\win\build\pyi.win32\anki\outPYZ1.pyz/pickle", line 880, in load_eof
EOFError"


Mighty Morphin Morphology - gombost - 2012-01-11

Hi!

Your plug-in seems great, thank you for your hard work!

Unfortunately I get the following error when I enable MorphMan on a deck in the Control Auto menu:

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

Exception in thread Thread-2:
Traceback (most recent call last):
File "/usr/lib/python2.7/threading.py", line 552, in __bootstrap_inner
self.run()
File "/home/tamas/.anki/plugins/morph/auto.py", line 494, in run
run()
File "/home/tamas/.anki/plugins/morph/auto.py", line 451, in run
dm.updateDbs()
File "/home/tamas/.anki/plugins/morph/auto.py", line 289, in updateDbs
aDb = self.allDb( doLoad=False )
File "/home/tamas/.anki/plugins/morph/auto.py", line 209, in allDb
return self.mkAll()
File "/home/tamas/.anki/plugins/morph/auto.py", line 189, in mkAll
ms = M.getMorphemes( mp, fieldValue, ws=whitelist, bs=blacklist )
File "/home/tamas/.anki/plugins/morph/morphemes.py", line 87, in getMorphemes
ms = [ tuple( m.split('\t') ) for m in interact( p, e ).split('\r') ] # morphemes
File "/home/tamas/.anki/plugins/morph/morphemes.py", line 75, in interact
p.stdin.flush()
IOError: [Errno 32] Broken pipe

I use Arch Linux with kernel 3.1.8.
Anki's version is 1.2.9, mecab's is 0.98.


Mighty Morphin Morphology - Korvar - 2012-02-20

gombost Wrote:Hi!

Your plug-in seems great, thank you for your hard work!

Unfortunately I get the following error when I enable MorphMan on a deck in the Control Auto menu:

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

Exception in thread Thread-2:
Traceback (most recent call last):
File "/usr/lib/python2.7/threading.py", line 552, in __bootstrap_inner
self.run()
File "/home/tamas/.anki/plugins/morph/auto.py", line 494, in run
run()
File "/home/tamas/.anki/plugins/morph/auto.py", line 451, in run
dm.updateDbs()
File "/home/tamas/.anki/plugins/morph/auto.py", line 289, in updateDbs
aDb = self.allDb( doLoad=False )
File "/home/tamas/.anki/plugins/morph/auto.py", line 209, in allDb
return self.mkAll()
File "/home/tamas/.anki/plugins/morph/auto.py", line 189, in mkAll
ms = M.getMorphemes( mp, fieldValue, ws=whitelist, bs=blacklist )
File "/home/tamas/.anki/plugins/morph/morphemes.py", line 87, in getMorphemes
ms = [ tuple( m.split('\t') ) for m in interact( p, e ).split('\r') ] # morphemes
File "/home/tamas/.anki/plugins/morph/morphemes.py", line 75, in interact
p.stdin.flush()
IOError: [Errno 32] Broken pipe

I use Arch Linux with kernel 3.1.8.
Anki's version is 1.2.9, mecab's is 0.98.
I'm getting that same error.

Anki 1.2.8, mecab 0.97-1, Ubuntu 10-10.


Mighty Morphin Morphology - Pauline - 2012-02-26

I think there is a bug with the condition for applying the tag "notReady" to cards.

From what I can tell, the tag is applied to all cards that have one unknown (iPlusN:1). Which is great, since I can use it to filter out new cards with too many unknowns.

However, that the tag is also put on cards that have no unknowns (iPlusN:0), which means I must manually remove the tag from those cards after running MorphMan to be able to review them.

It seems wrong to me that cards with no unknowns would be "not ready", but not cards with exactly one unknown.


Mighty Morphin Morphology - Hagrid - 2012-02-29

Could someone tell me what to do ?

Traceback (most recent call last):
File "C:\Users\hagrid\AppData\Roaming\.anki\plugins\morph\util.py", line 63, in
ed.connect( a, SIGNAL('triggered()'), lambda e=ed: doOnSelection( e, overviewMsg, progMsg, preF, perF, postF ) )
File "C:\Users\hagrid\AppData\Roaming\.anki\plugins\morph\util.py", line 37, in doOnSelection
st = preF( ed )
File "C:\Users\hagrid\AppData\Roaming\.anki\plugins\morph\setMatch.py", line 13, in pre
db = M.loadDb( path )
File "C:\Users\hagrid\AppData\Roaming\.anki\plugins\morph\morphemes.py", line 60, in loadDbU
buf = open( path, 'rb' ).read().decode('utf-8')
File "C:\cygwin\home\dae\Home\anki\win\build\pyi.win32\anki\outPYZ1.pyz/encodings.utf_8", line 16, in decode
UnicodeDecodeError: 'utf8' codec can't decode byte 0x8b in position 1: invalid start byte


Mighty Morphin Morphology - overture2112 - 2012-03-06

Pauline Wrote:I think there is a bug with the condition for applying the tag "notReady" to cards.

From what I can tell, the tag is applied to all cards that have one unknown (iPlusN:1). Which is great, since I can use it to filter out new cards with too many unknowns.

However, that the tag is also put on cards that have no unknowns (iPlusN:0), which means I must manually remove the tag from those cards after running MorphMan to be able to review them.

It seems wrong to me that cards with no unknowns would be "not ready", but not cards with exactly one unknown.
I think at the time I was using 'not ready' to imply "not worth studying" because it's too hard or too trivial (but it could become ready if your knowledge decreased) whereas you're (reasonably) assuming "not yet easy enough to study". In retrospect, my interpretation is certainly not obvious and yours seems more useful so I'll probably go with that when I do the anki2.0 update/rewrite of the plugin.


Mighty Morphin Morphology - overture2112 - 2012-03-06

Hagrid Wrote:Could someone tell me what to do ?

Traceback (most recent call last):
File "C:\Users\hagrid\AppData\Roaming\.anki\plugins\morph\util.py", line 63, in
ed.connect( a, SIGNAL('triggered()'), lambda e=ed: doOnSelection( e, overviewMsg, progMsg, preF, perF, postF ) )
File "C:\Users\hagrid\AppData\Roaming\.anki\plugins\morph\util.py", line 37, in doOnSelection
st = preF( ed )
File "C:\Users\hagrid\AppData\Roaming\.anki\plugins\morph\setMatch.py", line 13, in pre
db = M.loadDb( path )
File "C:\Users\hagrid\AppData\Roaming\.anki\plugins\morph\morphemes.py", line 60, in loadDbU
buf = open( path, 'rb' ).read().decode('utf-8')
File "C:\cygwin\home\dae\Home\anki\win\build\pyi.win32\anki\outPYZ1.pyz/encodings.utf_8", line 16, in decode
UnicodeDecodeError: 'utf8' codec can't decode byte 0x8b in position 1: invalid start byte
Looks like it's failing to open a database due to some unicode conversion error. Could you provide more information on the database in question and/or what you were doing?


Mighty Morphin Morphology - qwarten - 2012-03-13

gombost, Korbar and I all share the same problem. From what I can understand from this, it seems to be a unix specific problem. The link suggests a solution but since I'm not a programmer I don't know how accurate or doable a solution it is.


Mighty Morphin Morphology - overture2112 - 2012-03-13

qwarten Wrote:gombost, Korbar and I all share the same problem. From what I can understand from this, it seems to be a unix specific problem. The link suggests a solution but since I'm not a programmer I don't know how accurate or doable a solution it is.
The real question is why is it throwing SIGPIPE when it never did this before. I have 3 theories if you don't mind checking some things:

1) Is your mecab dictionary in euc or utf-8 format?
2) What version of python2 are you running on your system?

I haven't upgraded to a 3.0 kernel on one of my linux boxes yet (raid driver issue holding me back) so I can't try to reproduce with a system mirroring yours but I'm hoping it's something simple like morphemes.interact failing due to encoding issues.


Mighty Morphin Morphology - qwarten - 2012-03-13

overture2112 Wrote:
qwarten Wrote:gombost, Korbar and I all share the same problem. From what I can understand from this, it seems to be a unix specific problem. The link suggests a solution but since I'm not a programmer I don't know how accurate or doable a solution it is.
The real question is why is it throwing SIGPIPE when it never did this before. I have 3 theories if you don't mind checking some things:

1) Is your mecab dictionary in euc or utf-8 format?
2) What version of python2 are you running on your system?

I haven't upgraded to a 3.0 kernel on one of my linux boxes yet (raid driver issue holding me back) so I can't try to reproduce with a system mirroring yours but I'm hoping it's something simple like morphemes.interact failing due to encoding issues.
1) How can I check this?

2) 2.6.5


Mighty Morphin Morphology - overture2112 - 2012-03-13

qwarten Wrote:1) How can I check this?
I believe `mecab -D` will list some info, including the charset


Mighty Morphin Morphology - qwarten - 2012-03-13

Edit: It appears it was a problem with the Japanese support plugin. Or I should say a misinstallation of the mecab.
After I installed it following the instructions from http://ankisrs.net/docs/JapaneseSupport.html
it appears there weren't any problems after all.
Sorry for the false alarm in my case and thanks for the awesome plugin.


overture2112 Wrote:I believe `mecab -D` will list some info, including the charset
EUC-JP

Also I'm on 2.6.35-32 Ubuntu Maverick Backport.

By the way now that I check it my traceback seems a little different.

Traceback (most recent call last):
File "/home/richthofen/.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/richthofen/.anki/plugins/morph/util.py", line 82, in doOnSelection
st = perF( st, f )
File "/home/richthofen/.anki/plugins/morph/exportMorphemes.py", line 25, in per
ms = M.getMorphemes( st['mp'], f[ fname ] )
File "/home/richthofen/.anki/plugins/morph/morphemes.py", line 87, in getMorphemes
ms = [ tuple( m.split('\t') ) for m in interact( p, e ).split('\r') ] # morphemes
File "/home/richthofen/.anki/plugins/morph/morphemes.py", line 75, in interact
p.stdin.flush()
IOError: [Errno 32] Broken pipe


Mighty Morphin Morphology - overture2112 - 2012-03-13

qwarten Wrote:Edit: It appears it was a problem with the Japanese support plugin. Or I should say a misinstallation of the mecab.
After I installed it following the instructions from http://ankisrs.net/docs/JapaneseSupport.html
it appears there weren't any problems after all.
Sorry for the false alarm in my case and thanks for the awesome plugin.
Can you clarify exactly what it was (so others with the issue can solve it if they see this thread)? Was it mecab-jumandic?


Mighty Morphin Morphology - qwarten - 2012-03-14

overture2112 Wrote:Can you clarify exactly what it was (so others with the issue can solve it if they see this thread)? Was it mecab-jumandic?
I cannot be exactly sure about this but as far as I can remember I hadn't installed mecab previously yet there was valid responses to mecab whereis, which and -D commands. What I did was to install mecab-ipadic and kakasi after I discovered there was an error message when I tried to generate readings while adding new cards.

This is not very clear I know but this is the extent of my knowledge.