[Userscript] WaniKani Pitch Info

@Invertex
Thank you for making this plugin. I’ve found it really useful. I have just one suggestion you may want to implement.
I’m using the plugin, funnily enough, to make sure I’m using the right pitch accent when saying vocabulary out loud as I review them. However, at the moment I can only check the pitch accent after I have input the reading and opened the tab. I would really appreciate being able to know the pitch accent before doing so. At the moment I’m using an excel table to match the word to the accent (pictured below). My suggestion would be to change the background colour behind each word when inputting the reading from a standard purple to a colour that matches each accent (orange, green, purple, blue).
I do realise that I can just say the word after inputting the reading, and I’m not sure that you can change the UI colour like that, but I think it would be a worthwhile change (especially if it could be toggled - some people may prefer having to memorise the accent)

Alternatively, you mentioned the possibility of requiring the pitch accent number when answering. Have you made any progress on this or have you decided against it? In the long term, requiring us to memorise the accent would probably improve the usefulness of the tool and I would support it.

(As an aside, I just realised how large the images I attached were, schwoopsie!)

@Invertex I’ve submitted a PR for the script so it runs on preview.wanikani.com and doesn’t run on every wanikani page :slight_smile:

2 Likes

Is there any way to change the colours? I want it to match my Anki pitch accent thanks.

@nihonjustin

Should be right here:

image

How do i access the code and change it? and does this change the little graphs too?

I’m going to assume you’re using TamperMonkey.

  1. Click this image
  2. Click this image
  3. Find this image
  4. Click this image
  5. You’ll now be in edit view, so you find the section that @_josh linked above
  6. Double click on the text like this: image
  7. Change it to a different hex code colour Color Picker — HTML Color Codes
  8. Finally, click image

Then see if you like the colours. If not, return to step 1.

4 Likes

Does anyone know if it´s possible to see the pitch on this graphic instead of having to enter each word individually? Maybe even having the replay button there would be great…
I really like learning this way so far… So having all the informations on one place would be really helpful…
Or does anyone have an alternative idea? :slight_smile:
Still trying to find my way through this huge forum… So if I missed the answer I´m sorry :sweat_smile:

What a nice idea. The Item Inspector script puts a lot of information in the format you want but not pitch info. This would be a nice addition. I put this on my to do list. It is quite long. You will have to wait. (I am the author of Item Inspector) If you are interested to check it out it is here.

2 Likes

Thanks for the link that looks great :smiley:
And also for condiering my suggestion

1 Like

@Invertex I want to add pitch info information to my script Item Inspector. I would like to reuse some of your code and data. Do you give me permission to do so?

Thanks, I haven’t spent enough time on pitch, this will help

Seems to me the pitch info for 未だ is not right. It’s noted down as 平板 but should be 頭高, at least it sounds that way(?).

1 Like

Yes, I noticed that, too.

Both speakers pronounce it 頭高, which agrees with the NHK accent dictionary,
but the pitch pattern displayed doesn’t match.

I remember thinking at the time that whoever did the data entry may have been confusing it with また.

未だ(まだ)is 頭高
又(また)is 平板

2 Likes

This is an exceptionally useful script. I wish I’d started using this years ago. It’s also helpful for Classical Greek Attic pronunciation.

Been using this script for a long time now, thanks for that. One thing I kept forgetting to report though is the following:
Does anyone else have the issue with the ようおん (Kana with the small や, ゆ and よ attached) in the reading sections to appear squashed with this script activated? I skimmed a little through the thread and there seems to be no mention of any issue of that kind. Here are a few examples:

Screenshots

In the vocabulary details page:
Screenshot_20210306_081513 Screenshot_20210306_081540
During reviews with pitch graph:
pitch-graph-reading-squashed

I have this issue on both Firefox and Chrome, on at least two computers and made sure to check this with only this script activated.

1 Like

Oh, I noticed that too but did not realize it was caused by a script - I thought WK had changed something :woman_facepalming:

Well, I’m kind of glad that I’m not the only one here :smile:. I thought this must be the case though, since I had this problem appear on multiple setups.
The only other thing I found out now through inspection is that the script injects some weird HTML into the reading part:
Script turned off

<p class="pronunciation-variant" lang="ja">かんじょう</p>

Script activated

<p class="pronunciation-variant" style="position: relative;" lang="ja">かん<span style="display:inline-block;letter-spacing:-4.05px;margin:0 -4.95px;transform:scaleX(0.7) translateX(-2.025px);">じょ</span>う</p>

Exactly where the ようおん part is…
Is the author still around? :see_no_evil:

1 Like

According to their profile they last visited the forums in May 2020, so…

If the author does not respond any time soon, I think it would be ok to take over the management of the script. If you don’t feel up to the task, I could have a look into it.

1 Like

I mean, actually maintaining a script for a topic I’m not too knowledgeable about right now is a bit… :sweat_smile: . I want to tinker with it though later and see what happens.
I just took a quick look at the script and it does have a section to convert digraphs. Possibly in order to treat them as one mora? IDK. So yeah, the code seems to be there for a reason.