[Userscript] WaniKani Pitch Info

@nasatitan What do the colors represent? Different color for each number?

Yes, colors represent each number. The description and number are still below with a link to the dictionary.

I’m not sure how useful coloring by numbers is. I’ve watched a few of Dogen’s phonetics videos and he splits them into four groups (with official names) if I remember correctly. He might mention more later, as I said I need to research more. That might be better than following the numbers from a dictionary.

Gotcha. Honestly, I would remove the description below the words. As we’ve mentioned in the thread a few times, it’s actually inaccurate, so it causes more harm than good. With your diagram, you don’t really need the number either in my opinion.

2 Likes

That definitely seems like an ideal solution, what web API are you using to have the correct ones automatically drawn?

I put the Apple dictionary chart into an array. The y axis is the number of kana. And then I use the pitch number you’re pulling from weblio as the X axis.

But it doesn’t take into account compound kana or deficient mora (as per @jjatria’s comment) or any other rules there might be.

I’m keeping track of it on github if you want to try it out, there’s a list of todo and bugs inside the script as well.

https://github.com/blaketrahan/wanikani-pitch-info/blob/master/wanikani-pitch-diagram.js

I removed the description and replaced it with the name of the pitch pattern and kept the link. The colors now correspond to the 平板、尾高、中高、頭高 patterns.

I did not expect to spend my Saturday doing this :sweat_smile::cold_sweat:

2 Likes

Nice work! I just submitted a quick PR to make it only check the length of the first reading, in case multiple readings exist (like what you were seeing for Nine and Seven).

This is very minor, but I find it a bit tricky to read the kana and the pitch graph at the same time. If the high pitch kana were slightly superscripted, or alternatively the low pitch kana were subscripted, it could visually incorporate the pitch information into the kana directly, which is where I have my focus when reading.

For example, imagine this: image

Don’t get me wrong, the graph is very useful. Once I have the basic flow down, I can say it repeatedly to see if it feels like I’m matching that shape.

Slightly unrelated… while I appreciate the information density and typographic simplicity of the red line annotations someone pointed out above, the visual busyness seems to slow down my recognition of the kana.

I think shifting the kana looks terrible. The chart with the dots looks much better.

3 Likes

How would you propose to show the difference between heiban and odaka with that format?

1 Like

It wouldn’t. Apparently, I’m not understanding what I’m seeing. I have to think of the right questions yet.

Alright, I’ve integrated your approach @nasatitan , and created a Github and invited you as Collaborator on it. It should automatically sync pushes done to the Github to the Greasyfork.

I refactored some stuff and made some improvements. It will show two readings now too. The update has been pushed out and should automatically update for users (if not you may need to go into Greasemonkey/Tampermonkey and manually hit update this once.)

a20c7a57763c9a189a09e9cac19e7481

I was thinking this might be useful too, this site shows pitch curves instead of just points, and not just a curve representation of the points but supposedly based off various research into the pitch changes of words.
http://www.gavo.t.u-tokyo.ac.jp/ojad/search/index/sortprefix:accent/narabi1:kata_asc/narabi2:accent_asc/narabi3:mola_asc/yure:visible/curve:fujisaki/details:invisible/limit:20/word:入場

2 Likes

@Invertex @nasatitan I believe the script still has to be updated to handle digraphs. For example, 遮断機 (しゃだんき) has four mora and drops after the second.

Current Graph:
image

Correct Graph (I think)
image

I don’t have a Mac so I can’t verify this myself, but I think that’s how it should look.

1 Like

That’s correct, I hadn’t taken that into account yet. I am thinking along the lines of your solution of skipping the dot, but I wonder if that’s technically correct, phonetically speaking? Is it more correct to do this for example:

example3

Right now I am collecting all the patterns for all the vocab and storing them into an array (using the weblio part of the script, that is. Not doing this by hand). I would like to manually correct the ones coming up as -1, and you don’t have to parse weblio as well.

This is what OJAD gives me for 遮断機

ojad

1 Like

I believe skipping the dot would be correct. It makes sense to have one dot per mora, plus the extra one for the particle.

Here’s another variation for the diagram, which I think is better than my original one and yours. In this case I put the first dot halfway between the し and the ゃ to show that the dot is for both characters / the entire mora.
image

In the end though, it’s probably best to go with whatever the Mac dictionary does since that’s what you based your diagram on to begin with (though looking at this image, it’s ambiguous which way they do it; some look like my first diagram, and some look like this diagram).


Not having to load from Weblio would be awesome, with the slight downside that the script would miss new vocabulary words. Have you thought about what to do with those cases?

1 Like

Could simply retain the Weblio lookup as backup if local definition is not found.

It’s now checking for digraphs, so words like 女王 will display correctly with the accent on お.

However, concerning the 中高 pattern: If the accent falls on a digraph, long vowels, ん, or small っ and the pitch also drops before the particle, are all high pitch notes pushed back? Problem is I don’t know any words to double check on this on OJAD. I imagine there are only a few edge cases like this.

Also this seems like it could be a helpful post too

Looking at the new version, I think having the dot above the small ゃ (for example) is misleading because it misrepresents the number of mora in the word. Regardless of the angle of the line you choose, I think you should have exactly one dot per mora, plus the extra one for the particle.


Also, this may be a small thing, but I think having some padding (around 3-5px) between the type of pitch (like 平板) and the number (like [0]) would make it easier on the eyes.


I got an error when looking up 小学校. Cannot read property '3' of undefined - VM609:404


What do you mean by this? By definition, if the pitch falls anywhere in the word, it falls before the particle as well. I believe someone explained that long vowels, ん, and small っ all count as their own mora, but a digraph only counts as a single mora, meaning that small ゃ, etc. do not count separately. Can you give an example, even if it’s with a fake word to demonstrate?

EDIT: Related to this, looking at your code I don’t think you should be including little っ and ッ in your list of digraphs.

EDIT 2: I temporarily added handling for 7 kana so I could see the diagram for 小学校, and unless I messed something up completely, the diagram didn’t look right. It dropped after the う when it should have dropped after the が. Maybe this answers your question.

2 Likes