The purpose of this add-on is to automatically generate and bulk-generate furigana readings. To do its job, the add-on relies on mecab_controller. Additionally, the add-on allows you to look up Japanese pitch accents of a particular expression and add them to your cards.
Furigana | Pitch accent |
---|---|
For example, if you have fields named VocabKanji
, VocabFurigana
and VocabPitchPattern
on your notes,
the lookups will be performed on the VocabKanji
field,
furigana will be added to the VocabFurigana
field,
and the accents will be added to the VocabPitchPattern
field.
To generate readings or accents, focus in the VocabKanji
field and press "Tab" or switch focus away from the field.
You can change field names or add more source and destination fields in the config.
- Furigana.
After you type in a word or phrase into the
SentKanji
orVocabKanji
fields and hitTab
, Anki will automatically generate furigana for you and place it inSentFurigana
andVocabFurigana
fields respectfully. Field names can be configured in settings. - Furigana when a note is added. Automatic furigana generation when a new note gets created with AnkiConnect.
- Furigana from selection.
You can convert any selected text to furigana by clicking
Furigana for selection
in the context menu while using the note editor. - Bulk-add. To add furigana to multiple cards in bulk, open the Anki Browser and press "Edit" > "Bulk-add furigana".
- Toolbar button.
You can replace the content of any selected field with furigana by pressing
振
on the toolbar. - Compound words properly split.
Words like
取って置き
or言い方
produce correct furigana, unlike the previous add-on.
Install from AnkiWeb,
or manually with git
:
git clone 'https://github.com/Ajatt-Tools/Japanese.git' ~/.local/share/Anki2/addons21/ajt_japanese
To configure the add-on, open the Anki and select "AJT" > "Japanese Options...".
To edit the config file, open the Anki Add-on Menu via "Tools" > "Add-ons" and select "AJT Japanese". Then click the "Config" button on the right-side of the screen.
Mecab is not perfect and sometimes generates incorrect readings. There's nothing that can be done about it in a big picture, so make sure you check the generated text and adjust it if necessary.
The add-on can perform additional dictionary lookups independently of Mecab and add multiple furigana readings for one word. This may help you notice words with multiple readings and edit your card to learn the right one.
Note: It is preferable to use a compatible Note Type with this addon. Our recommended example deck contains Note Types for Japanese, Japanese fonts and the helpful templates to properly show the generated kanji readings.
When adding cards with AnkiConnect, pronunciations and readings are automatically looked-up and added to the cards.
When adding cards manually, fill the VocabKanji
field and press "Tab" to trigger generation.
There's a context menu item. Select the expression you would like to look up, then right-click and choose "NHK pitch accent lookup". Alternatively, go to "Tools" > "NHK pitch accent lookup".
When using the Anki Browser, you can mass-generate pitch accents and readings in bulk.
To do this, select several notes first,
and then choose "Edit" > "AJT: Bulk-generate".
By default, the "bulk generate" feature will not overwrite the destination fields if they are already filled,
but you can change this by setting overwrite readings
on per-profie basis.
If the add-on can't find any pitch accent data for the word spelled in kanji, it tries searching using the kana reading of the word. This behavior can be toggled off in settings.
If the add-on detects furigana reading in the source field, it will add pitch accents for the specified reading and skip other readings if they're present in the pitch accent database.
For more information on the Japanese pitch accent, I would like to refer you to http://en.wikipedia.org/wiki/Japanese_pitch_accent.
In short, the following notations can be found:
- Overline: Indicates "High" pitch (see "Binary pitch" in Wikipedia article).
- Downfall arrow: usually means stressing the mora/syllable before.
- Red circle mark: Nasal pronunciation、e.g.
げ
would be a nasalけ
. - Blue color: barely pronounced at all.
For example, a blue ヒ
would be closer to h
than hi
.
Likewise, a blue ク
would be more like a k
than ku
.
I can't speak for someone else, but for me, just knowing about the pitch accent and how it might affect the meaning has helped me a great deal. There are some tricky words like はし and じどう, where different pronunciations have wildly varying meanings. Aside from that, knowing about these rules might help you avoid speaking with a distinct foreign accent.
This add-on uses two databases to generate pronunciations from:
- NHK data from
NHK日本語発音アクセント辞典
. - Kanjium data. The repository can be found here.
The two databases produce 229295 entries total.
Some code of this add-on is based off of: