[Userscript] WK Reading Breakdown

This is a jukugo word, which usually means on’yomi readings from the kanji. If you know the readings of your kanji you’ll know how to read this as well.

“No, actually, I don’t”

Features

This userscript modifies the reading section during reviews to include the reading mnemonic (and hint) from the kanji that make up the word, if it’s a jukugo word. The script does its best to detect when a word can be broken up into the learned readings, sometimes this won’t work, tell me when they don’t, and I’ll try to fix them.

Usage

Just install the userscript and from then on, every time a word is cleanly split into it’s kanji readings, the script will do its magic and include the mnemonics.

Installation

The script requires Wanikani Open Framework to work (this is so I can get the mnemonics)
Visual Guide on How to Install a Userscript
Installing Wanikani Open Framework
Link to the userscript itself

Feedback

If you find a word that’s broken, the userscript is not working or it’s incompatible with another one, or you just want to request a feature, feel free to leave a reply. Please include screenshots for bug reports, it speeds up the fixing process around 10x.

6 Likes

Don’t forget to add your scripts to the list!

1 Like

I… uh… have some to add, currently I have 15 scripts for wanikani

1 Like

Seems pretty convenient for avoiding opening the kanji pages in new tabs. :slight_smile:

I’m assuming it only works for readings taught during kanji lessons? Or does it also help for items like 見当たる?


For 誇大 I get an error. In the line

&& frontRendakuTransforms[wordChar].includes(possibleChar)) {

wordChar is “だ” which is not in frontRendakuTransforms.

I have also noticed that sometimes your info is not added when I’m opening the item info – in these cases I have to close and reopen it. Maybe there is a race condition? I only took a glance at your code and noticed a setTimeout(handleNewItem, 200) – but maybe that’s unrelated to the problem.

It might be nice if your info is also added after a meaning question when the user completely expands the item info to also view the reading info.

More generally, I think it would be useful if your info would also be available during lessons, extra studies, and on the item pages.


And now some shameless self promotion :stuck_out_tongue:

Since writing code for injecting additional item info into WK can become annoying, I have written the library script “WK Item Info Injector”. You could use it to get notified when a new reading info section was created[1] and insert your DOM elements yourself, or you could let WK Item Info Injector handle the insertion[2].


  1. wkItemInfo.forType("vocabulary").under("reading").notify(yourCallbackThatInsertsTheDOMElements);
    
    ↩︎
  2. wkItemInfo.forType("vocabulary").under("reading").appendSubsection(null, yourCallbackThatReturnsDOMElements);
    
    ↩︎

Oh, thanks a lot, forgot that, if you have a character that can’t rendaku, you’ll get a nice old error.
I’ll look at it tomorrow or tonight if I can.