[userscript] Transform on'yomi readings into katakana 2.1.4

Thenn, if you’ve got time, could you fix the vocabulary pages as well? I meant to ask you a few days ago but totally forgot about it. :stuck_out_tongue: Thank you!

http://oi41.tinypic.com/im58qw.jpg


EskimoJo said... Stopped being lazy! Have now installed. Thanks very much! :-D
 you're welcome :)


floe said... Thenn, if you've got time, could you fix the vocabulary pages as well? I meant to ask you a few days ago but totally forgot about it. :P Thank you!

http://oi41.tinypic.com/im58qw.jpg


I can't believe I forgot another one... ^^
Thanks ! it's fixed. 

No, it’s alright. I can’t believe how fast you just were and I’m forever thankful for this script. :slight_smile:

Could someone update this userscript so that it works with the new lessons and also check the readings for mistakes? 松 for example is displayed in katakana although it’s kun’yomi. Merci! m(_ _)m

Actually, I'm still around.
The reason I didn't update the script yet is that I need to level up in order to get new kanji lessons.

I think it's about time I get back on track with wanikani (you actually caught up to my level ^^).


It might take a few days but I will update the script. (502 reviews to go through)

For the "check the readings for mistakes" feature, I would need a list.
I could try to automatically check against a Japanese dictionary in the script I use to format the data but I can't promise anything^^

Oh, glad to see you’re still around and I hope you keep at it. :D That would be great if you could get it to check against a dictionary (maybe automatically from time to time). I wrote Koichi a couple of emails over the past months regarding wrong or interchanged readings and I bet other people did so as well. Sorry that I can’t provide you with a list, apart from 松 I don’t really remember what Kanji I mailed them about. Viet also told me it should be quite easy to create a new script using code from his Wanakana IME.
http://wanakana.com/

Thanks! :slight_smile:

Wow, love you. Thanks for taking the time to update it. :slight_smile:

Thanks, sorry it took so long ^^

It doesn't check readings against a dictionnary but I don't think it would be efficient to make the userscript check readings at runtime.

I am working on a python script to check Wanikani readings with the kanjidic project. I am not sure if I will be able to do it, but I will post with the results if I can find anything interesting.

Moreover, I think 松 may have been a result from an error in the previous version of my script. So I might be responsible for some (if not all) of the kunyomi readings wrongfully displayed in katakana. Sorry :( 

I didn't locate the error in my formating script (which downloads the data from the API and formats it for use in the userscript) but I rewrote it and I think it's fixed.

No, it’s not your fault at all, I had to write them an email about a few wrong readings and matsu was one of them. :slight_smile:

Your script is making the readings disappear in the item info during reviews. It works fine on item pages outside of reviews. Another user encountered the same problem.

ok, thanks for the bug report.
 I updated the script (version 2.0.2), does it fix the issue?

In case you haven’t noticed, Wanikani now has an official API to do romaji-hiragana-katakana conversions called Wanakana. It’s even loaded by default on review pages! Have you thought of using it? Might make your script easier to maintain :slight_smile:

Thanks for the script, maybe now I’ll finally remember Katakana properly!

ruipgpinheiro said... In case you haven't noticed, Wanikani now has an official API to do romaji-hiragana-katakana conversions called Wanakana. It's even loaded by default on review pages! Have you thought of using it? Might make your script easier to maintain :)

Thanks for the script, maybe now I'll finally remember Katakana properly!
Thanks for the tip !

However,  the hard part to maintain in my userscript is about finding readings in the different parts of Wanikani and figuring out if they are onyomi readings or not.

I already have my own implementation of hiragana to katakana conversion (a javascript object and a loop, basically ^^) so it's probably not worth the trouble to switch over to Wanakana now. ^^

thenn42 said...However,  the hard part to maintain in my userscript is about finding readings in the different parts of Wanikani and figuring out if they are onyomi readings or not.
Since you've already got it implemented, it might not help much, but during reviews, there's a very very easy way to do that as that information is included in the kanji metadata. Look at my Wanikani KunOn script for more details, but the basics are (repeat this everytime the Kanji changes):

var curItem =  $.jStorage.get("currentItem");

if(!("kan" in curItem)) //Not a kanji
   return;

if(curItem.emph == "onyomi")
   //Onyomi reading, do stuff
else
   //Kunyomi reading, do stuff
Maybe you already know this (I didn't look at your source) and if so nevermind.

I suppose I could do that. 
What I’ve been doing until now is (more or less)  :

if ($(#item-info-reading).children(“h2”).text() == “Important Readings (onyomi)”)
 //do something
I don’t really know how the client side reviews works but I assume I can’t convert the readings to katakana in Jstorage without messing with the client side reviews.
Therefore, my userscript is still dependent on the layout of the “item info” in order to convert the reading. Using Jstorage before that would add just another factor that could break my script in future updates and that’s always annoying ^^

However, looking at your code, I’m interested in using unsafeWindow (my script has been running in “sandbox mode”) to get better hooks during lessons/reviews.
I still have some reading to do about javascript though (it took me a few minutes to understand what you were doing with jQuery.jStorage.set ^^).

But lessons and reviews are easy, what’s really annoying are all those pages that don’t provide information on whether a reading is on or kun. So my userscript comes with a big json object (17KB) that tells me whether a kanji’s important reading is on or kun. (I don’t have to ask for the user’s API key that way.)




Thanks, I think this will become useful later on.

Thanks for helping me practice those darn katakanas

腹 is now fixed, with the correct on’yomi being フク. Thought I’d make you aware of it. :slight_smile:

floe said... 腹 is now fixed, with the correct on'yomi being フク. Thought I'd make you aware of it. :)
 Thanks! I updated my script :)

ワンダフル!とってもビエン!感謝してますわ!