59 2
Contact Author Sign in to rate

Japanese Pitch Accent

5.70MB. Updated 2022-03-26.

Description

—————<[ P U R P O S E ]>————— Automatically adds pitch accent information to cards. —————<[ B A S I C U S A G E ]>————— ① Tools → Pitch Accent → bulk add ② Choose a deck ③ Select a note type (is skipped if whole deck is one note type) ④ Select the field containing the Japanese expression ⑤ Select the field containing the reading ⑥ Select the field to which the pitch accent info will be added ⑦ Done Result —————<[ A D D I T I O N A L F E A T U R E S ]>————— To manually add, edit, or remove annotations, use the card editor's 'set pitch accent' button. Annotations sync to mobile (e.g. AnkiDroid) as well as AnkiWeb Annotations are customizable via CSS Example usage: svg.pitch { height: 150px; width: auto; } svg.pitch text { font-weight: bold !important; } svg.pitch > path { stroke: #fa7 !important; } svg.pitch > circle[r="5"] { fill: #fa7 !important; } svg.pitch > circle[r="3.25"] { fill: #cf9 !important; } If you’re using night mode, use the following style to invert the pitch accent color. .nightMode svg.pitch { filter: invert(1); } —————<[ L I M I T A T I O N S ]>————— ① Does only support words (and some expressions), but not whole sentences. ② If the field in a card with the Japanese expression contains additional text, pitch accent lookup might fail (e.g. “<number>頭” in a card for the counter of large animals). ③ When an expression has several possible readings (e.g. 汚れ) the script tries to determine which one is used by inspecting the reading field of the card. This does not always work. —————<[ M I S C ]>————— Code Issues & Suggestions —————<[ C H A N G E L O G ]>————— 2022/03/26 -- Fixed bugs concerning functionality to manually add/edit/remove annotations. (Thanks kclisp) 2022/01/23 -- Updated pitch accent DB (from roughly 100k to 200k entries). 2021/08/22 -- Added cancel buttons to selection dialogs. 2021/01/26 -- Added support for successive bulk adding of annotations to different fields of notes. 2020/10/05 -- Added functionality to manually add/edit/remove annotations. 2020/08/02 -- Made code compatible with new Anki 2.1.29 DB schema. 2019/09/22 -- Added support for multiple note types within a single deck.

Download

As add-ons are programs downloaded from the internet, they are potentially malicious. You should only download add-ons you trust.

Supported Anki versions:

To download this add-on, please copy and paste the following code into Anki 2.1:

148002038

If you were linked to this page from the internet, please open Anki on your computer, go to the Tools menu and then Add-ons>Browse & Install to paste in the code.

All Anki 2.1.x Add-Ons Contact Author

Reviews

on 1670174194
Love that we can customize it from the card styling without having to mess with the files.
Cool features would be: Being able to automatically generate to selected cards from browser (or from inside a card without having to research the pitch accent) and the ability to add multiple pitches in one field.

Edit: The author actually responded super quickly and posted a version with the per-card button functionality on github, if anyone else is interested, it's working perfectly on 2.1.49 for me <3
on 1669136093
Excellent! Thanks for this!
on 1664833178
Amazing QOL
on 1663210779
Definitely the best pitch accent generator i've tried
on 1661087712
Simple, good UI and really helpful.
on 1658286997
The addon I can't live without <3
on 1656478698
great Addon
on 1653742172
Best pitch accent add-on but I have a problem; whenever I add cards and want to bulk add pitch accents to newer cards, it does also re-add previously already added cards. I don't want it to mess with cards that had the pitch accents already added cards from this add-on; but only the new cards. Previous cards should be left alone or simply refreshed, but not creating doubles, triples quadruples of the same graph
Comment from author
Hi, glad you like the add-on.
Bulk add should add graphs incrementally without leading to duplicates.

As you’ve created an issue report on Github I replied there to investigate your problem case.
on 1652959061
cool
on 1652140879
it works great. From what I can tell, there's no way to change the font color from the default black, so if anyone's looking for a way to make it readable in Night mode, consider just editing the attributes of the <div> where the Pitch Accent note is displayed in.

<div style='font-family: Arial; font-size: 20px; background-color: white'><br>{{pitch accent}}<br></div>

that should work to display the graph generated by the add-on inside a white element. It's not the most elegant solution but it works.

update: actually never mind, just saw that the elements are customizable through CSS. Feel free to ignore this
on 1651196170
Excellent add-on! Definitely recommend this to everyone. Really wish I had known about this when I started learning.

If I may, i'd like to suggest a feature. Currently, you have to iterate through your subdecks indivdually. for exxample, let's say i have a master deck "Cooking", and "Cooking" has 2 subdecks "western food" & "eastern food". if you try bulk adding by selecting "Cooking", then you get a pop up saying "No Cards found". You have to do "Cooking:western food" and "Cooking:eastern food" individually.

thanks again for the super awesome addon!!
on 1649867562
This function is absolutely insanely useful. Can't believe I haven't had it for 4 months.
Thanks for making it
on 1649599359
In principle great tool! However, the generated pitch&kana are not affected by the styling section of the card and the font-size/font cannot be adjusted otherwise to match the style of the customized card. Therefore, at least in Anki 2.1.49, the overall outcome can look pretty inconsistent.
on 1647717195
Manual mode is throwing an error in Anki version 2.1.49. I didn't want to run the batch on the ~3700 cards from the All in One Kanji deck, so I tried adding a pitch manually. The error is thrown after pressing "OK" or "Cancel" on the pitch pattern input. "Cancel" also doesn't cancel the operation at either of the 2 steps.

Otherwise, batch mode worked great on a test deck.
Comment from author
Hi, thank you for your feedback. The problem you’re describing with manual mode should now be fixed.

(The plugin needs the field in which to insert/edit the pitch annotation to be selected. In previous Anki versions, the pitch button was automatically greyed out when no text field was selected. For some reason this is not the case any more. Now, if you click the pitch button without having a text field selected, a message is displayed accordingly.)
on 1645545352
Updated to the latest Anki and recently let go of Migaku's addons so lost the availability to add pitch to the card. Right after installing adding the extra bit at the top and generating the bulk edit using the images provided it worked. Having this along with Yomichan, MPV using animecards method and that cool android app. This is going to be epic! Thanks for making this!! It's so easy to use and even works with ankidroid! :D
on 1645512414
Thank you for making this add-on!
on 1644680506
super good
on 1643283231
It's a useful add-on, but I would like, if I could change the size of the added accent. For me, these are too big right now and I don't know, how to make it smaller. Tried to change some things in HTML but failed.

Also, sometimes there are mistakes despite the right reading! e.g. 定規 can be read as ていき (unchangeable rule) or じょうぎ (ruler for measurement). In my case, I wanted to study the word for ruler, but it had the accent for unchangeable rule.
on 1641969148
nice extension
on 1640945492
thank you!
on 1639447346
It just works
追記 Ive use this plugin like 1000 times its so good
on 1637981065
So simple yet amazing. Thank you!
on 1636829699
I'm speechless, this addon is amazing and beyond helpful. Thank you.
on 1634051315
Good
on 1631966884
this is 2 good
on 1629728830
A word of warning for those who consider using this addon.

The algorithm itself is all good, but Wadoku's database is just cancer.. After noticing some discrepancy with other pitch accent dictionaries I looked through this database. It turned out I've already had a bunch of experience with it on another platform, so I have something to warn you about.

Pretty often Wadoku takes Heiban verbs for Odaka (i.e. 乗る, 失う, 広がる, 広げる, etc). It might not look like a big deal, but when it comes to conjugation the differences in these two patterns start to reveal itself. I consider this a serious issue.
Less often Wadoku messes up with nouns. For some words it has no pitch accent patterns at all.

This doesn't mean I do not recommend using this addon, I just want you to be somewhat sceptical about the pitches it generates. It's always good to have several sources of information.

In case the dev would consider switching to another database, I'll leave links to Kanjium dictionary and it's accents source file. This source data is better than Wadoku's in every way. It also isn't strictly copyrighted.

https://github.com/mifunetoshiro/kanjium
https://github.com/mifunetoshiro/kanjium/blob/master/data/source_files/raw/accents.txt
Comment from author
Hi, thanks for the feedback!

I've checked the verbs you mention in the NHK日本語発音アクセント辞典 which indeed lists them as heiban.

As for the alternative source of accent data you mention, the only problem I see is copyright. While Wadoku explicitly allows the free use of their data for non-commercial software (e.g. this add-on), the origin of the Kanjium accent data seems a bit fishy. To quote the repositories creator:
> [The source of the accent data is] not listed due to potential copyright issues, but it's from 2-3 legitimate sources. It is free, enjoy.
(https://github.com/mifunetoshiro/kanjium/issues/13)

I therefore see problems with directly “shipping” the add-on with their data, but I'll see if I can convert the accents.txt file to the format the add-on uses such that people can use it as their user_pitchdb.csv (see Tools→Pitch Accent→show custom DB path).
on 1629689941
Really useful and simple add-on. Just two things:
At least in the current version that I am using, there is no way to cancel the procedure when you want to add words. When I use bulk add words and change my mind I can't cancel the operation. Clicking the 'X' just selects the field. Bit annoying but probably just a bug.

I was also wondering from where the addon gets its data. What database does it use?
Great add-on though!

Answer to comment:
Thanks a lot man! Really helpful.
Comment from author before post was edited
Hi, thanks for the feedback. I just added cancel buttons. :)

As for the database used, it's from a projekt called Wadoku (wadoku.de).
A bit more information in the GitHub repository: https://github.com/IllDepence/anki_add_pitch_plugin#notes
on 1629297577
Thank you, it's awesome!
on 1628252055
Works well
on 1625790862
Amazing!
on 1625433796
Really easy to use and add pitch accent to my cards. The only problem is that the bulk add option will add the pitch accent to a deck even if you click the x button on all tabs. I had to go back and bulk remove multiple times because of this.
Comment from author
Hi, thanks for the feedback. I just added cancel buttons to the dialogs and also changed the behavior such that tasks do abort when dialog windows are closed. :)
on 1623594513
Does what it says on the tin. Gets confused sometimes, however, especially with words written with kana only e.g. なる. Nothing deal-breaking, as manually editing the graphs is dead easy, but I recommend cross-checking the info it gives you with audio from actual native speakers, though I guess that's a given anyway.
on 1623282190
Love it, had to do some trial and error, but that's because tried to change its usage a little. Other than it's impeccable.
on 1623112697
Messed up the proper pitch field but the remove feature saved my deck! a must-have addon for JP learners!
on 1622751905
Followed the process as shown, but it just continually skipped through my 14K+ cards and says it can't find but more than a few hundred. Not sure why, as it's not like fields change between cards. Nice idea, but does not work consistently. Manual input might work, but it's not automatically generated. You have to enter all the info yourself.
on 1622149743
Very lost on how to get this to work with night mode. Instructions seem unclear.
on 1622062595
Nice and easy. It can't add pitch accent to sentence cards though, as far as i understand.
on 1621723089
Very nice Add On, thank you
on 1620067331
I love that this addon exists! Great job!
on 1619388524
Super useful and easy to set up. Thank you so much !
on 1616119254
This addon is fantastic!!! thank you very much for it!
I have only one problem with it: when I add it to some decks it shows normally, and other times it appears always in the first side of the card, regardless witch field I choose it to be in, does anyone knows how to solve it?
on 1615421039
This is amazing, however there's just like one major drawback. I was wondering whether the add-on would be able to ignore any (する) parts so that it could do the pitch accents for the words themselves, because I use this on desktop before transferring to mobile and can't edit it on the fly
on 1610058962
This is such a seamless and needed addition to regular studying. Accents are a daunting task late into learning the language, but having a tool that naturally adds the awareness to pitch accent in addition to the sound bytes is so handy. Thank you.
on 1609494725
Thank you! I couldn't get any other pitch accent add-on working, but yours worked flawlessly the first time. Didn't find any problems yet, will update if I encounter any. Thanks again.
on 1603492964
Just excellent. I have even the possibility to do these manually. Thank you so much, it meant so much to me.
on 1601960377
Thank you for making this.
on 1601945264
Just want to say thank you for creating this, fantastic add-on.
on 1600731263
Apparently it only worked for about half of my deck but when it does it's seemless and absolutely amazing.
on 1599904820
Good stuff. Though, some of my vocabulary did not have a pitch pattern or had the wrong reading. I'm not sure if there is a fix for those issues.
Comment from author
Glad you like it! If you know or have a way to look up the pitch accent pattern for the correct reading, there now is a button to manually set the pattern for individual cards.
on 1597255842
Very useful and convenient addon !
on 1595004148
Fantastic! This is exactly what I needed.
on 1589892261
Great, exactly what I was looking for. It works with "Japanese Support" too.
on 1588610228
Exactly what I needed, works beautifully.
on 1587242678
SO GOOD TIER, Worked perfectly for me. Could be improved a little by being able to detect formatted single word in a sentence, however cannot complain.
on 1586977922
This is such a convenient, easy add-on, especially since it can be used retroactively on cards you've already created! I really hope more people find out about it.
on 1586011259
Very simple to add on and great diagrams. I prefer this add-on over the "Japanese Pronunciation / Pitch Accent" as the accent information is much more easily digestible on the fly.
on 1581319383
Amazing! Just what I needed!
on 1576722337
will be a great support add-on together with AwesomeTTS.
Waiting for an upgrade which cover Pitch accent of a whole sentence/ phrase.
on 1569516702
UPDATE: This issue has been fixed, so I have no problems at all with this add-on now! Thanks so much for addressing this. Highly recommended.

Original review: It's a really nice concept, but too unwieldy as it is. It assumes that the pitch accent info field will be in the same place in every single card in a deck, which is not the case in mine. I'd suggest allowing it to add pitch accent based on note type as well, or on an individual card basis.
on 1567435467
Really useful and has a lot of potential.
But still needs some work before it can be used easily without issues.
on 1567366746
Very useful!