[Userscript] WaniKani Pitch Info

Hey folks,
I’m on version 0.64 - admittedly, I never used this script before - so maybe I’m missing something obvious, but - I don’t see any pitch accents, neither on /subjects/review (during review sessions), nor on /vocabulary/*, /kanji/*, is that a problem for everyone using this script with the new (seeing as 25 days ago, @Sinyaven was talking about v0.63) version or is that a ‘me’-problem?

A few more details: when I scroll to the readings I am presented with a tabular view (2x3 horizontal table) of On’yomi, Kun’yomi and Nanori.
I do not see the diagrams where they (probably) should be according to the very first screenshot I’ve seen at the top of this thread.

Regardless of whether this will be resolved - thank you for your work and patience, userscript devs :smiley: !

1 Like

The script is supposed to add the pitch diagram to vocabulary readings that are in its database, which should apply to most (but not all) vocabulary items in WaniKani. Just to be sure, can you go to WaniKani / Vocabulary / 大人 and check if the pitch diagram is missing from the displayed reading?

1 Like

It is missing from the displayed reading for me.

1 Like

What browser and script manager are you using? Or, if you (or anyone else with this issue) have the time, can you go through the steps suggested in this guide to gather more information about the problem?

I am on Chrome with tampermonkey on Windows 10 Professional. I am too busy to follow the steps on the guide right now. I will do so when I have time in a few days.

1 Like

Hey, sorry for getting back to you so late @Sinyaven , I, also, was busy these days, but I got the opportunity to check a few things, so here are my findings; firstly the missing pitch accents for otona:


This is the page: https://www.wanikani.com/vocabulary/大人

Secondly, the error in the browser console that is likely preventing them from being displayed:

Lastly:
Browser: Waterfox (fork of Firefox): G5.1.5
Extensions: Tampermonkey with:

  • Wanikani Open Framework v1.1.2
  • Wanikani: Woah Burns v1.0.6
  • Tofugu Latest v1.3
  • WaniKani Katakana For On’yomi v2.2.0
  • WaniKani Pitch Info v0.64
  • WaniKani Heatmap v3.0.55
    (written in the same order as on the Tampermonkey Dashboard, since order seems relevant)

OS: Linux (Arch on Wayland - Hyprland)

If I’ll find the time, I can look into digging for that function in the User Script, but I thought I’d mention it in case you have a clue on where and what it might be!

I assume the issue is something like JavaScript compatibility, similar to how some browsers have str.contains(other) whereas others only have str.includes(other) or something like that, but you’d probably know better.

*uploaded the same image twice, here is the one that is meant to be there instead of the first:

I suspect that line 75 #under() is the one that breaks stuff, according to the browser console - is that a function from a WKOF or is that a WK internal?

wkItemInfo.forType('vocabulary').under('reading').notifyWhenVisible(injectPitchInfo);

Correct – findLast() only found its way into browsers at the beginning of last year, and Waterfox seems to be a bit behind. In version 0.65 of Pitch Info, this should be fixed.

I have tested it with Chrome, Edge, Firefox, and now also Waterfox on Windows 10, and it works in all cases. I’m wondering if there is a conflict with another script that I do not have installed.

Thanks a lot for your immaculate work and inhuman reaction time, I can confirm that it does indeed work now!

2 Likes

I’ve been getting the following error:

Uncaught TypeError: currentItem is undefined
    _updateCurrentStateReview 
    _initReviewPage 
    _initOnNewPage 
    handleTurboBeforeFrameRender

This occurs seemingly after doing more than 100 reviews.

Potential Cause
This element, which contains a list of subjects does not seem to be kept up to date and seems to carry a maximum of 100 subjects.

document.querySelector(`[data-quiz-queue-target="subjects"]`)

Environment

  • Windows 11
  • Firefox 116.0.1
  • WaniKani Pitch Info 0.66
  • WaniKani Double Check 3.1.9
  • WaniKani Open Framework 1.1.5
  • ConfusionGuesser 1.16
  • WKCM2 0.3.1
2 Likes

@Sinyaven FYI, I was having trouble with this script until I manually updated the WK item info injector version to your latest release. Thanks for all your hard work.

1 Like

Feature Request:
Add pitch information underneath the “pronunciation” section in kana-only vocab.

1 Like

This should already work in version 0.67. Can you give an example where it does not display the pitch accent?

Example

Item page for “ホテル”:

image

There are some words it just doesn’t recognize there being pitch accent data for, so you’ll have to be on the lookout for that as well. For example, おはよう does not show any pitch accent, but this is because pitch accent dictionaries seem to only show the pitch accent for this word when it is written with the kanji (お早う).

1 Like

I wish the pitch info were displayed not just in the lessons, but somehow during reviews also. Right now, if I want memorize the pitch (including the “final” mora that is not included in the audio), it seems that I would need to awkwardly look it up in the vocabulary section. Couldn’t you add the info in the “readings” tab, or even better, have it displayed somewhere automatically after typing in the answer, so that it doesn’t require any extra clicks?

Also by the way, I think your pitch info world also fit in nicely with the “compact item info” in the review summary add-on [Userscript] Review Summary on the dashboard .

It’s included in reviews too. Expand the item info (no need to even click the button the keyboard shortcut is F) and it’s there with readings.

Note: pitch info is only for vocabulary, so it won’t be there for kanji readings.

1 Like

You’re right. Maybe I had set my item info to not expand automatically, either way, I forgot about that earlier when I wrote my post.

That being said, I do still feel like I’m having a hard time memorizing the pitch, especially that last mora.

But thanks.

1 Like

I think that’s just part of the difficulty of learning pitch accent. For me I look at them and say the words out loud a few times, trying to get the pitch right. Then every time it comes up in review I say it, and focus on whether it feels like I’m saying it in the same way as I practiced. I also go off of whether my pronunciation sounds similar to how I’ve heard it before. And then, since so many things are heiban, I find that’s a good one to fall back on (and sometimes I’ll be able to quickly tell whether that sounds right or not). If I’m not sure or just want to double check I’ll expand the item info and practice some more if I got it wrong. So basically trying to go off of feel rather than rote memorization.

Oh, and for the last mora (that is, the mora of any attaching particle, except maybe の because it does weird things to pitch accent), it’s only ever high pitch in heiban, so maybe you mean you’re having a hard time remembering if a word is odaka or heiban? I have to remember to always practice speaking the word with a particle in order to try and distinguish those. Then I start to get a feel for whether pronouncing the particle high or low sounds right.

It’s still not very easy though. And it’s easy to accidentally form a bad habit.

That’s what I meant. In a sense, I even wish the audio would extend to the particle, since I do remember the audio somewhat better than the written info.

How do you handle the cases that you got wrong? Do you mark the whole word as wrong?

(Feel free to move our conversation elsewhere, I feel like we’re going somewhat off topic.)