kanji koohii FORUM
Sentence glossing - 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: Sentence glossing (/thread-7163.html)



Sentence glossing - overture2112 - 2011-01-29

I really liked the gloss for sentences in my Kore deck and figured that'd be useful for all my decks (especially grammar decks where I'm not testing vocab in the first place). As such, I created an anki plugin called 'Sentence Gloss' that lets you easily fill a 'Gloss' field based on an 'Expression' field via WWWJDIC's glossing feature.

---- Example ----
Expr: 彼も彼女もハーバードの卒業生だ。
Mean: Both he and she are graduates of Harvard.
Gloss:
彼 【かれ; あれ】 (n) (かれ) (1) he; (2) boyfriend; (あれ) (1) that (indicating something distant from both speaker and listener); that person; SP

彼女 【かのじょ】 (pn) (1) she; her; (adj-no) (2) her; (3) girl friend; girlfriend; sweetheart; (P); ED

ハーバード (p) (abbr) Harvard (University); NA

卒業生 【そつぎょうせい】 (n) graduate; alumnus; ED


Note: Thanks to cangy's lookup-sentences script for the idea.


Sentence glossing - nest0r - 2011-01-29

Wow, works great! Thanks for writing and sharing.

A nice supplement to the same function on Translation Aggregator which I suppose I'll reserve for stuff I won't be SRSing. Worth noting that TA limits the number of words it'll send, to spare WWWJDIC's servers. I hope this plugin won't be too hard on them.


Sentence glossing - Cranks - 2011-01-29

That's really convenient. I wish that this was around or that I had known of it when I was doing sentences. It certainly would have cut down on the work involved in card creation.


Sentence glossing - overture2112 - 2011-01-29

nest0r Wrote:Worth noting that TA limits the number of words it'll send, to spare WWWJDIC's servers. I hope this plugin won't be too hard on them.
Yea, I originally had refrained from posting it because I was afraid it might abuse the servers too much, but I'm hoping that won't be the case since this is more or less a one time thing for each fact.


Sentence glossing - cangy - 2011-01-30

overture2112 Wrote:I really liked the gloss for sentences in my Kore deck and figured that'd be useful for all my decks
glad you liked it!

lookup-sentences (see also) was used for kore but a plugin is probably more convenient for most people


Sentence glossing - mafried - 2011-01-30

Thanks for the great plugin, it saves me a bunch of time!

I had to delete the debugging print statement on line 9 from the script. It was raising an error trying to convert the expression to ascii.


Sentence glossing - overture2112 - 2011-01-30

cangy Wrote:lookup-sentences (see also) was used for kore but a plugin is probably more convenient for most people
Oh, that's the script I originally got the idea from. I couldn't remember how I found out about wwwjdic's glossing feature (I wrote the plugin months ago but didn't release it) but that's definately it.

Thanks


Sentence glossing - Irixmark - 2011-01-30

Great plugin, very helpful!


Sentence glossing - Lindley - 2011-02-05

Thanks for the plugin, it's really useful. One question, though - is it feasible to make it add Heisig keyword for kanji?


Sentence glossing - TheVinster - 2011-02-05

I hate WWWJDIC. I wish it used ALC!


Sentence glossing - overture2112 - 2011-02-05

TheVinster Wrote:I hate WWWJDIC. I wish it used ALC!
Never used ALC, but you can probably look at the source code and modify it a bit to get it to work (assuming ALC offers a similar glossing service).


Sentence glossing - kerosan41 - 2011-02-05

Wow, this is quite useful. Thanks for your wonderful contribution.

If anybody ends up doing it with other dictionaries, please share.


Sentence glossing - nest0r - 2011-03-15

I noticed this plugin only has 40 downloads in Anki so I thought I'd bring it to the Recent Topics section, since firion1234, if I interpreted their comment correctly, requested a functionality from Yomichan that I think this plugin performs quite well.

And I wonder, if one uses WWWJDIC's sentence glossing without the plugin, one could probably import the results as a Front/Back card if tabs rather than semicolons are used in Anki's import function, no? Hmm maybe not so easy w/o a find/replace, as I look at the results via Translation Aggregator and the WWWJDIC site.


Sentence glossing - Boy.pockets - 2011-05-20

I am having trouble with this plug-in.

I have the Expression and Gloss fields, but when I try to regenerate glosses I get a unicode error:

Error Report Wrote: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/lindon/Library/Application Support/Anki/plugins/jmrGloss.py", line 48, in regenGlosses
File "/Users/lindon/Library/Application Support/Anki/plugins/jmrGloss.py", line 26, in glossFact
File "/Users/lindon/Library/Application Support/Anki/plugins/jmrGloss.py", line 9, in gloss
File "/Users/lindon/Library/Application Support/Anki/plugins/ianki_ext/web/webapi.py", line 182, in write
UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-16: ordinal not in range(128)
I am on a Mac, which might be the problem, I will be able to try this on a PC tomorrow. But just thought I would put this up anyway. I hope this is the correct place for this...

Still only 56 downloads... : (

/edit: problem has temporary fix (see my next post below)


Sentence glossing - overture2112 - 2011-05-20

Error Report Wrote: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/lindon/Library/Application Support/Anki/plugins/jmrGloss.py", line 48, in regenGlosses
File "/Users/lindon/Library/Application Support/Anki/plugins/jmrGloss.py", line 26, in glossFact
File "/Users/lindon/Library/Application Support/Anki/plugins/jmrGloss.py", line 9, in gloss
File "/Users/lindon/Library/Application Support/Anki/plugins/ianki_ext/web/webapi.py", line 182, in write
UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-16: ordinal not in range(128)
Strange. I haven't had any unicode decoding issues (and used it just this weekend), but I only test on linux and windows.

Apparently the problem is related to encoding/decoding your Expression field. Can you see if it happens for all your cards and all your decks or just some?

Also, since it's unnecessary, you can try removing/commenting line 9 of the file (the print statement). I'd assume that would simply cause something later to fail instead, but it might reveal more information to work from.

EDIT: I personally find this plugin critical for any new decks I make, but may others don't find it as useful as I do. Also, the only advertising it got was my initial posts and nest0r's cross post.


Sentence glossing - nest0r - 2011-05-20

Based on the lack of similar tools for other languages, I'm thinking perhaps a lot of people just aren't familiar with the concept, or the related use of the verb ‘gloss’.


Sentence glossing - Boy.pockets - 2011-05-20

Boy.pockets Wrote:I get a unicode error...
Fixed!
I tried another deck and other cards with the same result. Then...
overture2112 Wrote:Also, since it's unnecessary, you can try removing/commenting line 9 of the file (the print statement). I'd assume that would simply cause something later to fail instead, but it might reveal more information to work from.
I commented out line 9, and after a restart of Anki, the problem went away and things are looking really shinny. : ) I will still try on my PC when I get it back tomorrow to see if the problem is to do with the deck or with the environment.

As to why so few downloads, I think a contributing factor has to be Anki's poor plug-in support (compared to how well it does other things). Getting off topic now...

Thanks overture for the quick help!


Sentence glossing - overture2112 - 2011-05-20

Boy.pockets Wrote:Fixed!...Thanks overture for the quick help!
Cool. I'm not certain why printing the unicode string gave issue when it otherwise decodes properly. I assume by "PC" you meant the bizarre, but not unpopular definition, of "non-Apple hardware running Windows"? Because I'm curious to see if it's reproducible on a windows/linux box.


Sentence glossing - nest0r - 2011-05-21

So in conclusion to my previous comment, just to add to it, you may want to consider renaming the plugin to something more literal and adding more of a description of what it does.


Sentence glossing - overture2112 - 2011-05-21

nest0r Wrote:So in conclusion to my previous comment, just to add to it, you may want to consider renaming the plugin to something more literal and adding more of a description of what it does.
Have a suggestion for a better name?


Sentence glossing - nest0r - 2011-05-21

overture2112 Wrote:
nest0r Wrote:So in conclusion to my previous comment, just to add to it, you may want to consider renaming the plugin to something more literal and adding more of a description of what it does.
Have a suggestion for a better name?
Maybe a name like ‘Automatically Define Words in Sentences’? ^_^


Sentence glossing - Boy.pockets - 2011-05-21

overture2112 Wrote:I assume by "PC" you meant the bizarre, but not unpopular definition, of "non-Apple hardware running Windows"? .
Yes, and no. I just meant my computer running Windows.

On my Windows box, I was able to run 'Regenerate Glosses' without any problems. So perhaps the problem is platform specific. I would be happy to do some more testing if required.


Sentence glossing - zigmonty - 2011-05-22

Wow, i can't believe i missed this. This looks crazy useful. Thanks!


Sentence glossing - cangy - 2011-06-02

nest0r Wrote:And I wonder, if one uses WWWJDIC's sentence glossing without the plugin, one could probably import the results as a Front/Back card if tabs rather than semicolons are used in Anki's import function, no? Hmm maybe not so easy w/o a find/replace, as I look at the results via Translation Aggregator and the WWWJDIC site.
that's what this is for...