Yay, new version time! This one will be in Anki shared plugins, but it isn't yet because I'm trying to figure out how to do this
Lots of bugfixes, tagging, much better sentence extraction, more options, list of added vocab (double click to edit), optional stripping of readings, auto update check etc.
Reload first post for updated screenshots.
EDIT: Oh, yeah I changed some stuff so your preferences will be reset. Sorry about that, but it had to happen
Last edited by FooSoft (2011 February 20, 5:38 pm)
So I grabbed the update from the Google Code page, and when I restarted Anki, instead of Anki the Yomichan window popped up? So at first I was very confused, since a lot of stuff was grayed out, add buttons missing, etc. So in frustration I closed the window, only to have Anki then pop up? So I was like, OK, and I hit the hotkey to open Yomichan again and nothing happened. So I looked for the option in the Menu and couldn't find it?
Anyway, I switched back to the older Yomichan, hehe. I'll try the new version again later.
Last edited by nest0r (2011 February 20, 7:34 pm)
That's really really strange. So the hotkey was removed because after thinking about it some, CTRL + Y was a bad key to do this with. It's the default key for redo in a lot of applications, so I scrapped it.
It should still be in the tools menu, and in fact there is a new item in the toolbar which you can use too:
I just tried it on a clean install of Anki (Version 1.2.7) on my Windows virtual machine, looks like it works there too :S Quit making stuff up nest0r!
Maybe you have a version conflict, you should delete the old version instead of overwriting it (if you did that).
Last edited by FooSoft (2011 February 20, 7:56 pm)
Okay, I tried deleting the old version first and now it works. ;p Does that mean before downloading it as a shared plugin it should be deleted also? (For those who have the old version and will be grabbing it that way.)
Also, what about a new or customizable hotkey? Although ctrl + Y didn't give me any problems. (That's another one of those random trifles I mention in these comments, not a genuine feature request per se.) Ahem, or I could click the big button I just noticed. ;p
Last edited by nest0r (2011 February 20, 8:07 pm)
Finding hot keys that make some sort of sense is actually pretty tough. I didn't know anybody actually cared, haha. If you can tell me a good shortcut that doesn't conflict with anything else (or standards) I'll use it I'm far too lazy to make it customizable too hehe.
As far as deleting old files... I don't think you need to do that normally. I have no idea what happened in your case though, and can't even begin to guess. That was just strange.
Yeah I don't know, originally I just extracted the new .7z into the plugins folder? And chaos ensued. All hell broke loose. The dogs of war came hurtling forth from the gaping maw of Hades itself.
Then I deleted the yomichan.py files and the yomichan folder and re-extracted and voila.
I really like it so far! Great stuff. The docking/dragging back into different places, the vocabulary tag which now lets me use Thurd's JDIC audio plugin, the clickable fid/browser thing to the left, the tooltips. Everything's very smooth.
Speaking of which, the little plus gives me Add Fact as Expression, but the big plus and the other white squares thingy both say Copy Definition. I also notice the tooltip is kind of stubborn and slow for the Copy Definition ones. Actually I notice that when the little plus is right next to the white squares thingy it also will say Copy Definition rather than Add Fact as Expression, so it seems to be something to do with the size/radius of the tooltip mouseover thingy for the Copy Definition button?
Last edited by nest0r (2011 February 20, 8:28 pm)
Bah, that's a bug of the stupid QTextBrowser control. The control allows you to output HTML to it (that's what the definitions window is), but it's really flaky on alignment. I had to mess around with it a lot to get the buttons to hover on the right like that, and it must not be happy. I'll try putting things into a table for layout and see if it's any better.
All the code plugin-side is correct. Sigh. Qt.
Yay, new version time! This one will be in Anki shared plugins, but it isn't yet because I'm trying to figure out how to do this
I'm quite sure that can upload the plugin here on ankionline.
Ah, cool thanks jettyke! Oh, btw nest0r, I figured out what the problem you were running into was. I screwed up packaging the plugin. Doh. Fixed and re-uploaded. Also uploading to Anki online now
Edit: Now in Shared Plugins! w00t.
Last edited by FooSoft (2011 February 20, 10:14 pm)
Oh okay. I went ahead and deleted and redownloaded the shared version. Much neater to have the yomichan.py and subfolder rather than all those folders and .py files in the plugins folder in a seething pandaemonium of barely contained cataclysmic hellfire. Not that it was a big deal. ;p
I just downloaded the plugin for the first time from the shared plugins, and Anki now dumps this error when starting up:
Error in yomichan.py Traceback (most recent call last): File "/usr/share/anki/ankiqt/ui/main.py", line 2685, in loadPlugins __import__(nopy) File "/home/me/.anki/plugins/yomichan.py", line 1, in <module> from yomichan_plugin import yomichan_plugin File "/home/me/.anki/plugins/yomichan_plugin/yomichan_plugin.py", line 22, in <module> from core.reader import MainWindowReader File "/home/me/.anki/plugins/yomichan_plugin/core/reader.py", line 26, in <module> import reader_util File "/home/me/.anki/plugins/yomichan_plugin/core/reader_util.py", line 101 field: replaceMarkupInField(value, markup) for field, value in fields.items() ^ SyntaxError: invalid syntax
This is on Ubuntu 10.10 with Python 2.6.6 and Anki 1.2.7
Edit: Checked first post, and it says I need Python 2.7. Not sure how feasible it is for me to upgrade that before Ubuntu 11.4 is released.
Last edited by Yucalus (2011 February 21, 12:11 am)
If you go into the offending file and replace the "replaceMarkupInFields" with this function, it will fix your problem. I don't know if there is anything else that won't work with 2.6 though. I might make a 2.6 compat pass later, depending on if I have time to set up a testing environment in the next couple of days
def replaceMarkupInFields(fields, markup): result = dict() for field, value in fields.items(): result[field] = replaceMarkupInField(value, markup) return result
Last edited by FooSoft (2011 February 21, 8:10 am)
looking forward to seeing how it'll improve ^^
Last edited by hotkiller123 (2011 February 21, 10:13 am)
This is really, really useful.
I too, agree with cangy
.... find all the words in the currently displayed page
look them up in the vocab decks
if they're not in the decks highlight in the text and show them with the dictionary lookup on the side, with options to add as new cards
if they're in a deck but not active highlight differently in the text and show them with the card info on the side, with options to make due, unsuspend or tag ...
Especially the part about being able to mark in some way cards that already exist in the deck.
The reason I would like to be able to select all words in the text that are not in the deck (or even for my purposes every single word in the text) is that mostly, at the moment I would be working with text on paper or, for example, JP101 transcripts /pdfs that I don't know how to open in your plugin. Thus I would look the words up in an electronic dictionary as I went, creating a list, which I could use to make cards. But I can see that the process could be greatly simplified by your program, if I could just open the resulting word-list in the plugin and create cards from there - ideally not having to do them one at a time.
This moves away from just help with reading, into the realm of purely card creation, perhaps, so I'm not sure if you are interested in going in that direction.
Last edited by rachels (2011 February 24, 8:31 pm)
My knowledge of coding is quite limited, so please let me know if asking for this type of functionality is taking the piss as I don't know how difficult it would be to implement.
Texts obtained from Aozora Bunko have rubies that often prevent the usage of the "add word" feature. For example, the word 瓜実顔 is split into 瓜実《うりざね》顔《がお》 making it impossible to use the Rikai-chan style look up that so streamlines the process of vocabulary mining. Like others have intimated, I think a furigana rendering that doesn't affect the mouse-wheel click look up would be the best of all possible solutions.
Another distinguishing feature of Aozora Bunko texts are lines of "code," if you will, that render 外字. For example, ※［＃「目＋爭」、第3水準1-88-85］ gives you 睜, and ※［＃「（楫－木）＋戈」、第3水準1-84-66］ produces 戢. There is a terrific website that perhaps a few of you are already familiar with that converts Aozora Bunko's shift-JIS files in to vertical reading, furigana appended PDFs formatted for the Kindle. Their converter is somehow able to interpret this "code" and the resulting PDF displays the 外字 beautifully, furigana and all.
Thank you for the awesome plugin, I look forward to hearing your thoughts about these minor nitpicks.
Very sharp, thanks for the link! I'll have to test out its .pdf creation awesomeness.
Last edited by nest0r (2011 March 03, 4:59 am)
Excellent link! I can't wait to try out the results on my kindle. Thanks.
Even though you can't display furigana in Yomichan yet, you can at least strip the readings. It's in the options. Displaying readings is definitely on the list of stuff to do, but there are still low hanging fruit to grab before that.
@nest0r and Oniichan
You're welcome guys, I'm glad I could contribute instead of lurk for once.
As you can imagine I feel a trifle foolish for not having noticed that on my own, I apologize for being nitpicky without first being thorough. While furigana would be nice to see in the future, striping the readings definitely solves the first problem. What do you make of the second? To my mind it seems difficult, but the individual running the website I mentioned seems to have come up with an elegant solution. There is no rush of course, I'm just curious seeing as programming has always fascinated me.
@firion1234 - It might be easier to implement this with cb4960's tool since it's more of a standalone conversion-oriented application. I've pointed out the tool/your comment and signs point to a possible and welcome implementation of such a functionality.
See the JNovel Formatter thread: http://forum.koohii.com/viewtopic.php?p … 87#p136287
Edit: But oh yes, I imagine your ideal (and mine) is to have all this integrated with direct card creation, yes?
And doesn't Anki allow Latex, which is what that a2k uses for 縦書き and ルビ? Perhaps that's the bridge for Yomichan... ? (No idea how Yomichan works. ;p)
Last edited by nest0r (2011 March 03, 6:20 pm)
What do you make of the second? To my mind it seems difficult, but the individual running the website I mentioned seems to have come up with an elegant solution.
Maybe I'm missing something? What is the purpose of the 外字 code? Is it just for rendering furigana? Can't you just display them as the rest of the text?
Doesn't UTF-8 handle all that stuff? At least, going by those codes, it looks like it's referring to kanji that's in JIS X 0213, which Unicode encompasses?
Or okay, does Shift_JIS not handle the JIS x 0213 stuff, so they use the code, which tells the stuff with broader encoding what they were? Or maybe it's for stuff that was originally written with versions of Shift_JIS or whathaveyou that didn't support certain characters at the time?
Edit: It looks like, in practice, instead of having the kanji written out, it has a .png of the kanji with that code in the alt= area?
So for 樺, instead of displaying that, it has http://www.aozora.gr.jp/gaiji/1-87/1-87-62.png? I guess when they first digitized it they were using an early version of Shift_JIS?
Last edited by nest0r (2011 March 06, 6:05 pm)
I think we should get our terminology straight. I should not have used the term 外字. While it's true that the characters in question (睜 and 戢) are outside of the jouyou character set, and therefore "technically" are 外字, it's not that Shift_JIS can't display any 外字 at all. It's presumably because (and I don't know the history of East Asian font encoding methods) these two kanji were considered too rare to warrant inclusion in the Shift_JIS character set. If for instance you were to download this text (take the final slash off in your url bar or it will 404) and view it in a text editor you would find these codes. See pic. Interestingly, if you view the html version (again, remove the final slash) it renders this character 睜 as a png instead of highlightable text. Yomichan isn't at fault, it just regurgitates what you put in it. See pic. Since Yomichan is capable of rendering UTF-8, so too can it render these two characters. One last pic. I would like to see Yomichan be able to interpret the "code" so that I don't have to arduously replace the code by hand with the intended character. At this point, I'm sure you're thinking "It's very probable that these words don't even have Edict entries," and you'd be right, the kanji and the words are just too archaic. The alternative however is use that website to turn every Shift_JIS into a pdf and highlight and copy the proper characters or to use Denshi Jisho and painstakingly isolate the author's intended kanji one radical at a time. Beggars can't be choosers and Yomichan deserves all the credit in the world for streamlining vocabulary mining. Still, considering the popularity of Aozora Bunko and the sheer quantity of texts they provide, a world where Yomichan plays nice with the format of their books is better world for Japanese learners everywhere.
Last edited by firion1234 (2011 March 06, 6:38 pm)
Ah, I see what you are saying. OK, assuming I can figure out how the hell character block code works I'll include support for parsing them in Yomichan
Today is my first deck with yomichan!
FooSoft! This is fantastic, thank you soo much
By the way, is there a key shortcut to add the fact into the anki deck/card? There is one to copy definition and copy sentence but didnt find for adding the fact. That would be useful.
Last edited by marcmiddag (2011 March 12, 12:19 pm)