[Userscript] WaniKani Pitch Info

#1

As a result of the discussions in this thread, I made a userscript that displays the pitch type for a given vocabulary reading. The data has been automatically generated from results on http://www.weblio.jp and will auto-lookup any new ones WaniKani may add in the future.

Script:

https://greasyfork.org/en/scripts/31070-wanikani-pitch-info

Requirements:

A userscript app for you given browser, tested working with:

Tampermonkey (Most Browsers, Preferred)

a20c7a57763c9a189a09e9cac19e7481

TODO List:

-Check if pitch info is different for secondary readings and display it
-Handle checking for contextual pitch info
-Look into Greasemonkey compatibility issues

—(Maybe) Implement some more colorful/visual modifications of the readings themselves instead of just a description. Done! Big thanks to nasatitan for programming this visual representation of pitch.

-(Maybe) Give occasional knowledge about general pitch rules.
-(Maybe) Option to require writing the correct tone number in your answer.

Github

46 Likes
人工 vs 人口 (homophones?)
Pitch-Accent Awareness Corner
About the voice actor and pitch
Userscripts on Android (Browser)
Effectively Including WaniKani in Japanese Language Studies
Pitch Accents? Where did these come from..?
The New And Improved List Of API and Third Party Apps
Must have scripts?
Who Wants to Challenge Me to a Race?
[Unsupported] App Store script
Wanikani screenshots :camera_flash:
How long do you take on lessons?
Sum up your recent WaniKani Review sessions with a short clip/gif
Wanikani screenshots :camera_flash:
Both "municipal" and "private" are pronounced "shiritsu". How does this not cause a lot of confusion?
Writing kanji - what resources do you use?
Powerpunching my way to the golden badge! (AKA my level 60 thread)
The New And Improved List Of API and Third Party Apps
[iOS] Tsurukame - native app with offline lessons and reviews
Favorite or Must Have Scripts and Apps?
How do you practice pronunciation?
Telling apart the meanings behind 写るand 写す?
The Most Interesting Thing
Wanikani screenshots :camera_flash:
Pitch accent on vocab
Let's praise these USERSCRIPTS and their awesome CREATORS
I'm level 29 and I just now noticed this
WaniKani Routine Thread
I just became a subscriber ! But I just saw a video that threw me a bit off
Trial Period Graduation
Worried about my accuracy?
Wanikani screenshots :camera_flash:
Does anyone here study the pitch accent as well?
#2

[quote=“seanblue, post:54, topic:18721”]
@Invertex It might make sense to create a dedicated forum topic for your script for feedback and updates. My only suggestion at the moment would be to also include the raw number from Weblio, in addition to your description of the number’s meaning.[/quote]
Done :smiley:
And will do for the next update.

I had some conflicting information on this, but looking into it further I seems mora is the most used term so I’ll switch to that, thanks.

No I’ve not, but I will for sure!

#3

Pushed out new update, 0.17, it should fix that issue, but with it new bugs may be introduced due to unknown edge-cases with how weblio formats their results. I already caught a couple, hopefully shouldn’t be any other but keep an eye out!

Also now displays the pitch value and uses mora instead of moji.

1 Like
#4

This is the best thing ever, thank you so much! I was already wondering what would be the best way to incorporate pitch accents into my learning since I wanted to get this information into my head as soon as possible.

I may be wrong (since I’m a beginner and have no experience with pitch accents) but I just installed 0.17 and I think the bug that was mentioned before still exists (or a similar one).
For example:
http://www.weblio.jp/content/父
ちち
Pitch starts low, stays high for 2 mora, ends low. [2]

2 Likes
#5

edit: Nvm, it seems correct.

ちち [2] [1] 【父】

親のうちの,男の方。実父・継父・養父の総称。 :left_right_arrow: 母 「二児の-となる」

新しい物事の開拓者。先駆者。また,偉大な貢献をした人。 「近代経済学の-」 「独立の-」

キリスト教で,神の呼称。三位一体内の子キリストに対して父。

Should I be using the second number out of those two numbers or something? Or should I be displaying both in some way?

#6

I believe you should be showing both. This means that they are both valid pitches.

1 Like
#7

I don’t see the pitch info.

#8

That’s weird @netpapa , the script is working correctly for me here.

1 Like
#9

@Invertex
Spotted this item that came up with having no pitch accent found, likely because there are two possible readings, I’m guessing. The handy link you included in the number gives the information on the Weblio page however.

Nice job on the script so far :smiley:

1 Like
#10

Alright, implemented it in the latest version, 0.18! Thanks.

Also, does anyone know of any words that might have more than 2 acceptable pitches? I hard coded it for two since it was simpler but if there is the possibility of a word having more than two I’ll make it dynamic.

Hmm, well I guess I should add that my script is programmed in TamperMonkey. So it could be my script has issues with Greasemonkey? Could you give TamperMonkey a try and see if it works? It supports most browsers.

Thanks, I’ll have a look into it!

#11

I don’t offhand, but I did find another case with two pitches that is interesting. It’s a more complicated case, where the pitch accent depends on the part of speech.

http://www.weblio.jp/content/多分

When used as a noun or na-adjective, it seems that 多分 has a pitch accent of [0]. But when used as an adverb, it has a pitch accent of [1].

1 Like
#12

Alright, fixed that! Indeed, it was because of the two readings so it was breaking the string matching.

Hrmm interesting, yeah I had seen a few pages like that but didn’t know enough to interpret them. I guess I’l have to add that to a TODO list, as that will be a bit more of an undertaking to create handling for.

1 Like
#13

I haven’t tried the script so far, but it looks like a welcome addition!

What I would change is the way information is displayed. In a related (now defunct?) thread I made the following proposal:

If what you have is a number, then one way to do this would be to split the word into kana, and apply the relevant style to the appropriate character. The one thing that might be tricky is that compound kana should be treated as one.

It might be helpful to know that so-called “defficient” mora (long vowels, ん, and the small っ) cannot bear the accent (but are still counted).

1 Like
#14

Yeah, and I just found an even better one. Two parts of speech, one has two valid pitches and the other has one.

1 Like
#15

Why does this strike you as wrong? Is it because it adds up to 3 mora? This includes any attached particles.

EDIT: oh you mean the description. Yeah… A 2 mora character can’t start low, stay high for 2 and the go low. It would start low, go high, then go low for the attached particle

#16

Thanks for this!

So I was curious to look up the pitch accent on 当たり and 辺り. 当たり starts low, ends high, and 辺り starts high ends low. But the audio on WK totally doesn’t match (at least to me). 辺り sounds like it starts low, goes high, then goes in the middle (is that even a thing?) and 当たり sounds like it goes from high to low. Is this just my imagination? I am pretty confused now. :confused:

1 Like
#17

I was thinking that the right part of the picture would be the best way to display this. It’s not obvious how it should work for words that have more than one valid pitch though.

So just to make sure I understand, a word like がっこう has four mora, but such a word could not downstep on the っ or う? However, digraphs count as a single mora, so かいしゃ has three mora, right?

Thanks :blush:

1 Like
#18

That was the first one I had looked up as well and was confused, so instead I went and listened to other vocab and most others seemed to match the pitch info. I think the case might just be whoever did the recordings has some pitch influence from their own region of Japan?

#19

Cool :slight_smile:

The idea I’m suggesting has a similar feel actually to this extension. This extension points out not only when a Kanji has a certain (on’yomi) pronounciation, but also points out when its a Rule or an exception for that radical, so you can learn the rules from it. http://userscripts-mirror.org/scripts/show/184072

Of course that extension is teaching on’yomi, whereas yours is teaching pitch accent so its different, but the way-of-teaching could be similar.

#20

Thanks, it works in TamperMonkey.

1 Like