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 - Irixmark - 2013-01-08

OK, figured it out by playing around with enabling and disabling the model override for certain types. Needed to exclude note types containing any non-Japanese stuff like Latex and everything went smoothly then.

お忙しい中お時間頂いてありがとうございます。


Mighty Morphin Morphology - ryuudou - 2013-02-08

I get an error when trying to bring up the calc or whatever, so maybe it's not working with the newest Anki?


Mighty Morphin Morphology - overture2112 - 2013-02-08

ryuudou Wrote:I get an error when trying to bring up the calc or whatever, so maybe it's not working with the newest Anki?
What do you mean by "calc"?


Mighty Morphin Morphology - ryuudou - 2013-02-09

overture2112 Wrote:
ryuudou Wrote:I get an error when trying to bring up the calc or whatever, so maybe it's not working with the newest Anki?
What do you mean by "calc"?
The recalc thing. I was under the impression I needed to go there to create a database to start using the addon, but when I try it errors.


Mighty Morphin Morphology - overture2112 - 2013-02-09

ryuudou Wrote:The recalc thing. I was under the impression I needed to go there to create a database to start using the addon, but when I try it errors.
Ah. Have you looked at the MM3 announcement post or the wiki? Those at least explain the basic instructions.

As for the error, can you post the error message you get? Posting your config.py and log file might help too.


Mighty Morphin Morphology - ryuudou - 2013-02-09

overture2112 Wrote:
ryuudou Wrote:The recalc thing. I was under the impression I needed to go there to create a database to start using the addon, but when I try it errors.
Ah. Have you looked at the MM3 announcement post or the wiki? Those at least explain the basic instructions.

As for the error, can you post the error message you get? Posting your config.py and log file might help too.
Yes. Is the first step not to create a database? Also am I correct in that the add-on hasn't been updated since October 2012 according to the Anki add-on respiratory? I may be using the wrong version. Error below.

Quote:An error occurred in an add-on. Please contact the add-on author.
Traceback (most recent call last):
File "C:\Users\Reason\Documents\Anki\addons\morphman.py", line 6, in onMorphManRecalc
morph.main.main()
File "C:\Users\Reason\Documents\Anki\addons\morph\main.py", line 188, in main
allDb = mkAllDb( cur )
File "C:\Users\Reason\Documents\Anki\addons\morph\main.py", line 49, in mkAllDb
fieldValue = getMecabField( fieldName, flds, mid )
File "C:\Users\Reason\Documents\Anki\addons\morph\main.py", line 23, in getMecabField
return stripHTML( splitFields( flds )[ idx ] )
TypeError: list indices must be integers, not NoneType
Apparently there's no log file in either the "addons" folder or the in "morph" folder within the "addons" folder. If you need config.py let me know.


Mighty Morphin Morphology - overture2112 - 2013-02-09

ryuudou Wrote:Yes. Is the first step not to create a database?
The first step is to edit config.py so it looks at the right fields for your cards. Then ctrl-m to have it calculate.

ryuudou Wrote:Also am I correct in that the add-on hasn't been updated since October 2012 according to the Anki add-on respiratory? I may be using the wrong version.
Correct. I believe it's version 3.1

Quote:An error occurred in an add-on. Please contact the add-on author.
Traceback (most recent call last):
File "C:\Users\Reason\Documents\Anki\addons\morphman.py", line 6, in onMorphManRecalc
morph.main.main()
File "C:\Users\Reason\Documents\Anki\addons\morph\main.py", line 188, in main
allDb = mkAllDb( cur )
File "C:\Users\Reason\Documents\Anki\addons\morph\main.py", line 49, in mkAllDb
fieldValue = getMecabField( fieldName, flds, mid )
File "C:\Users\Reason\Documents\Anki\addons\morph\main.py", line 23, in getMecabField
return stripHTML( splitFields( flds )[ idx ] )
TypeError: list indices must be integers, not NoneType
Thanks, from this I can tell the issue is that it's looking for a field that doesn't exist on some card. Since others have had this issue as well, I'll update the error message for the next version so this is more clear.

ryuudou Wrote:Apparently there's no log file in either the "addons" folder or the in "morph" folder within the "addons" folder. If you need config.py let me know.
Not sure why you can't find the log file (maybe it's not created until you get further along?), but no matter since the error message makes it clear to me what the problem is.

The issue should be with your config.py not being correct for your anki collection. If it hasn't changed from the default, this most likely means you have cards that don't have an 'Expression' field, so either disable morphman for those cards, change the fields morphman looks at, or rename the fields, whichever is applicable.

If you can't figure it out, please provide your config.py and describe the models in your collection and their fields.


Mighty Morphin Morphology - ryuudou - 2013-02-09

Ah I was under the impression that editing config.py was optional. How do I know which field it should look for? I want the add-on to include all of my cards in the database. I have a collection with five different "note types" across multiple sub-decks I believe.

As far as fields that are displayed on the question side of my cards it ranges from "Sentence Cloze" to "Kanji" to "Text" to "Vocabulary-Kanji" to "Expression" depending on the deck. Additionally some of these decks have supplementary fields displayed on the front of the card along with these five primary "question side fields" I've mentioned. Does that interfere? I can edit config.py myself as long as I have a little instruction. Thanks.


Mighty Morphin Morphology - overture2112 - 2013-02-09

ryuudou Wrote:How do I know which field it should look for? I want the add-on to include all of my cards in the database.... "Sentence Cloze" to "Kanji" to "Text" to "Vocabulary-Kanji" to "Expression" depending on the deck. Additionally some of these decks have supplementary fields displayed on the front of the card along with these four primary "question side fields" I've mentioned.
see basic info on the config here

Basically you need to tell it which field(s) you want it to pull morphemes from and you'll have to provide information for each model if they're all different.

For example maybe do:
Code:
default['morph_fields'] = []
model_overrides[u'My Cloze Model'] = { 'morph_fields': [u'Kanji'] }
model_overrides[u'My Vocab Model'] = { 'morph_fields': [u'Kanji', u'Expression'] }
This means, by default morph man won't look at any fields, but in the case of 'My Cloze Model' cards, it will use the 'Kanji' field, and in the case of 'My Vocab Model' it will use the 'Kanji' and 'Expression' fields.

(Note the "u" in front of the strings is to signify unicode, which I believe Anki 2 uses for models and field names by default)


Mighty Morphin Morphology - ryuudou - 2013-02-10

I have given up, though one day I may return.


Mighty Morphin Morphology - tokyostyle - 2013-02-10

overture2112 Wrote:This means, by default morph man won't look at any fields, but in the case of 'My Cloze Model' cards, it will use the 'Kanji' field, and in the case of 'My Vocab Model' it will use the 'Kanji' and 'Expression' fields.
I haven't check out your plugin in years and part of the reason was that the MCD cards my Anki 1 plugin generated messed with the Anki 1 version of the plugin. It sounds like the way Anki 2 does clozes has basically fixed this little anomaly and I should try again?


Mighty Morphin Morphology - overture2112 - 2013-02-10

tokyostyle Wrote:I haven't check out your plugin in years and part of the reason was that the MCD cards my Anki 1 plugin generated messed with the Anki 1 version of the plugin. It sounds like the way Anki 2 does clozes has basically fixed this little anomaly and I should try again?
I'm not sure what issue you had with MCD cards, but the extra flexibility and control that Morph Man 3 allows when configuring which fields are processed by mecab should make anything work.


Mighty Morphin Morphology - tokyostyle - 2013-02-11

overture2112 Wrote:I'm not sure what issue you had with MCD cards, but the extra flexibility and control that Morph Man 3 allows when configuring which fields are processed by mecab should make anything work.
Basically mecab would see everything about the card except the clozed part because the old format didn't have the full text anywhere. If MM3 strips the Anki 2 style cloze tagging away before it sends it to mecab it should work wonderfully.


Mighty Morphin Morphology - overture2112 - 2013-02-11

tokyostyle Wrote:If MM3 strips the Anki 2 style cloze tagging away before it sends it to mecab it should work wonderfully.
Currently MM just uses the `stripHTML` function from anki.utils before sending off to mecab (line 23 of main.py), which might not handle the cloze syntax. Initial guess is that something like the following change is needed:

Code:
-return stripHTML( splitFields( flds )[ idx ] )
+return re.sub( '{{.*?::(.*?)}}', r'\1', stripHTML( splitFields( flds )[ idx ] ) )
(and adding 'import re' to the top)

I might try to make a new release sometime next week, though you're free to patch it yourself if you feel like tinkering.


Mighty Morphin Morphology - tokyostyle - 2013-02-12

overture2112 Wrote:I might try to make a new release sometime next week, though you're free to patch it yourself if you feel like tinkering.
The real world will prevent me from mess around with this too much this month but I'll take a stab at it. Right now I'm so used to adding sentences that are N+1 to N+3 that I'm not planning on using it on my sentences deck.

Basically I want to take your tool and some of the other tools and make them more integrated and automated. Two examples:

1) A sort of super plugin that takes big paragraphs of text, analyzes them with mecab, then looks up in the MM3 database to figure out what to cloze and basically does all of the work for you. Right now if I make an automatic mecab cloze it will happily cloze words that are already way too trivial because it doesn't know about the dozens of cards with those words already in the deck.

2) Take sub2srs content, cloze it using mecab or the system above, and then use MM3 to order it based on my entire collection.

I think you've sort of gotten close to this already but I think there's still some more glue to be added that can make using all of the current tools a lot easier.


Mighty Morphin Morphology - overture2112 - 2013-02-12

tokyostyle Wrote:1) A sort of super plugin that takes big paragraphs of text...figure out what to cloze...

2) Take sub2srs content, cloze it using mecab or the system above, and then use MM3 to order it based on my entire collection.

I think you've sort of gotten close to this already but I think there's still some more glue to be added that can make using all of the current tools a lot easier.
I considered something like #2 in the past but never really gave MCD a fair shot and thus had forgotten about it; I'll try to experiment with #1+2 a bit next week. I already had a request for a feature to locate the unknowns and unmatures within a sentence and highlight them in different colors, so it would be a similar problem.

If you think of other cool ideas, feel free to suggest them.


Mighty Morphin Morphology - Daichi - 2013-02-13

This isn't a big problem, but I'll point it out anyway. I don't tend to recalculate morphs very often because it's quite heavy on the sync times. (Like 5+ minutes on AnkiDroid.) Would it be possible to have a quick recalculate that only touches stuff between say k+n:0-3, while completely ignoring everything else?


Mighty Morphin Morphology - overture2112 - 2013-02-13

Daichi Wrote:This isn't a big problem, but I'll point it out anyway. I don't tend to recalculate morphs very often because it's quite heavy on the sync times. (Like 5+ minutes on AnkiDroid.) Would it be possible to have a quick recalculate that only touches stuff between say k+n:0-3, while completely ignoring everything else?
Agreed, this is one of those minor irritants that didn't quite bother me originally but has slowly gained my ire. In fact, just the other day I was actually toying around with making it avoid "modifying" notes which haven't actually changed (and thus causing them to require a sync for no reason), as the last release simply touches all of them (that are enabled, anyway).

But having a "lite" recalc or something would be even better, as that would speed things up in the common case quite a bit as well.


Mighty Morphin Morphology - neilhalligan - 2013-02-14

Quote:,
ryuudou wrote:

How do I know which field it should look for? I want the add-on to include all of my cards in the database.... "Sentence Cloze" to "Kanji" to "Text" to "Vocabulary-Kanji" to "Expression" depending on the deck. Additionally some of these decks have supplementary fields displayed on the front of the card along with these four primary "question side fields" I've mentioned.

see basic info on the config here

Basically you need to tell it which field(s) you want it to pull morphemes from and you'll have to provide information for each model if they're all different.

For example maybe do:

Code:

default['morph_fields'] = []
model_overrides[u'My Cloze Model'] = { 'morph_fields': [u'Kanji'] }
model_overrides[u'My Vocab Model'] = { 'morph_fields': [u'Kanji', u'Expression'] }
This means, by default morph man won't look at any fields, but in the case of 'My Cloze Model' cards, it will use the 'Kanji' field, and in the case of 'My Vocab Model' it will use the 'Kanji' and 'Expression' fields.

(Note the "u" in front of the strings is to signify unicode, which I believe Anki 2 uses for models and field names by default)
This cleared it up and managed to get it working perfect. Thanks!


Mighty Morphin Morphology - Aspiring - 2013-02-19

Code:
Traceback (most recent call last):
  File "C:\cygwin\home\dae\win\build\pyi.win32\anki\outPYZ1.pyz/aqt.main", line 149, in onOpenProfile
  File "C:\cygwin\home\dae\win\build\pyi.win32\anki\outPYZ1.pyz/aqt.main", line 227, in loadProfile
  File "C:\cygwin\home\dae\win\build\pyi.win32\anki\outPYZ1.pyz/anki.hooks", line 26, in runHook
  File "C:\Users\Mccoy\Documents\Anki\addons\morph\util.py", line 16, in initCfg
    import config
  File "c:\pyi\iu.py", line 436, in importHook
  File "c:\pyi\iu.py", line 495, in doimport
  File "c:\pyi\iu.py", line 297, in getmod
  File "c:\pyi\iu.py", line 123, in getmod
  File "C:\Users\Mccoy\Documents\Anki\addons\morph\config.py", line 38
    profile_overrides['User 1'] = { 'enabled'=False }
                                             ^
SyntaxError: invalid syntax
While trying to set up morphman on my original anki profile "User 1", entering the proper Note Types and fields, I kept getting a syntax error.

After making a new profile and attempting to override Profile User 1 I get the same error.
Could someone help?


Mighty Morphin Morphology - overture2112 - 2013-02-19

Code:
profile_overrides['User 1'] = { 'enabled'=False } #bad
profile_overrides['User 1'] = { 'enabled':False } #good
simple tutorial


Mighty Morphin Morphology - Aspiring - 2013-02-19

Thanks!



Edit:
It seems like I can't add any code without getting an error.
I'll try another day.

Instead I just edited all my card fields so they'd match with the default setting, which is to scan 'Expression'.

This is the easiest solution without editing config.
A little too easy. >.<


Mighty Morphin Morphology - overture2112 - 2013-02-19

I've created some initial video tutorials that demonstrate how to setup MorphMan as well as demonstrate some of the new features that will be released in v3.2 here.

If you'd like to see more tutorials, please request topics.


Even better, if you'd like to replace my videos with superior ones (with less "uhhs" or real video editing), I'll readily accept them Smile


Mighty Morphin Morphology - Aspiring - 2013-02-21

Lol, I spent like 30 minutes trying to figure out morphHighlight. ;o

The update looks amazing :O


Mighty Morphin Morphology - Daichi - 2013-02-22

overture2112 Wrote:I've created some initial video tutorials that demonstrate how to setup MorphMan as well as demonstrate some of the new features that will be released in v3.2 here.

If you'd like to see more tutorials, please request topics.


Even better, if you'd like to replace my videos with superior ones (with less "uhhs" or real video editing), I'll readily accept them Smile
Looks splendid. Looking forward to the new update.

The videos are fine, the only thing I would suggest, is some sort of video zoom on some of that text (or lowering your video resolution before capping) so people can see things more clearly.