Japanese Furigana (JoMako)
An Anki add-on that adds or removes furigana on Japanese text in your cards,
with correct readings for numbers and their counters.
Based on
Japanese Furigana by
obynio
(source code).
All the credit for the original add-on goes to its author.
This version is distributed under the same license, the
GNU GPL v3.
What this version changes
Numbers and counters
MeCab, the engine that computes the readings, splits numbers from their
counters and the original add-on left the number without a reading.
This version reads the number and its counter as one word:
| Text |
Original add-on |
This version |
| δΈδΊΊ / δΊδΊΊ |
δΈ δΊΊ[γ«γ] |
δΈδΊΊ[γ²γ¨γ] / δΊδΊΊ[γ΅γγ] |
| δΈζ₯, δΊεζ₯ |
δΈ ζ₯[γ«γ‘], δΊε ζ₯[γ«γ‘] |
δΈζ₯[γΏγ£γ], δΊεζ₯[γ―γ€γ] |
| δΈζ¬, δΈζ¬, ε
ζ¬ |
δΈ ζ¬[γ»γ] |
γγ£γ½γ, γγγΌγ, γγ£γ½γ |
| εε, δΈεε |
ε ε[γ΅γ] |
γγγ·γ, γγγγ
γ£γ·γ |
| δΊεζ³, 4ζ, δΉζ |
δΊε ζ³[γγ], 4 ζ[γ], δΉ ζ[γ] |
γ―γγ‘, γγ, γγ |
| ε
«ηΎε, 2,000ε |
ε
« ηΎ[γ²γγ]ε[γγ], 2,000 ε[γγ] |
γ―γ£γ΄γγγγ, γ«γγγγ |
| 4ζ1ζ₯ |
4 ζ[γ€γ]1 ζ₯[γ«γ‘] |
4ζ[γγγ€]1ζ₯[γ€γγγ‘] |
It handles sound changes (γγ£, γγ£, γ―γ£, γγ
γ£, γ²γγ£), voicing after
γγ / γͺγ (γγγΌγ, γͺγγγ), special day readings, Arabic and full-width
digits, δ½ (δ½ζ¬ β γͺγγΌγ), decimals and thousands separators.
All the counter rules live in the COUNTERS table in kansuji.py.
Other fixes
- θ‘γ£γ¦ / θ‘γ£γ: MeCab often read θ‘γ£γ¦ as γγγͺγ£γ¦ (θ‘γ) when it
meant γγ£γ¦ (θ‘γ), e.g. γ γγγθ‘γ£γ¦γγ γγ. It is now read γ unless a
direct object marked with γ comes before the verb (δΌθ°γθ‘γ£γ¦γγ γγ).
- Bulk generation used outdated settings: changing an option (ruby tags,
numbersβ¦) only applied to bulk generation after restarting Anki.
- Bulk generation wiped the settings: running it overwrote the add-on's
config with only the last used field names.
- Settings window: all options are in a single
Tools > Japanese Furigana Settings⦠window, with an explanation for each.
Usage
The add-on adds two buttons to the card editor toolbar:
- Add furigana: Ctrl+R (βR on macOS)
- Remove furigana: Ctrl+Alt+R (β₯βR on macOS)
If text is selected inside a field, only the selection is processed;
otherwise the whole field is.
To generate furigana for many notes at once, select them in the browser and use
Edit > Japanese Furigana : Bulk Generate.
With bracket notation, use {{furigana:MyField}} in your card template to
display the furigana above the kanji. With ruby tags, nothing needs to change
in the template.
Settings
Tools > Japanese Furigana Settingsβ¦
- Furigana format: brackets (
δΈδΊΊ[γ²γ¨γ]) or ruby tags
(<ruby>δΈδΊΊ<rt>γ²γ¨γ</rt></ruby>).
- Read numbers with their counters: δΈδΊΊ β δΈδΊΊ[γ²γ¨γ] instead of
δΈ δΊΊ[γ«γ]. Applies even when "Ignore bare numbers" is on.
- Ignore bare numbers: numbers without a counter (δΈε) get no furigana.
Installation
From AnkiWeb (recommended, you get updates automatically):
in Anki, Tools > Add-ons > Get Add-ons⦠and paste the code 994280590.
AnkiWeb page: ankiweb.net/shared/info/994280590
From GitHub: download japanese_furigana.ankiaddon from the
releases page
and open it with Anki (Tools > Add-ons > Install from fileβ¦).
If you use the original Japanese Furigana add-on, disable it in
Tools > Add-ons: both add-ons use the same shortcuts. The .ankiaddon file
from GitHub disables it automatically; the AnkiWeb version cannot.
Development
Run the tests from the add-on folder:
python -m unittest
Build the packages (.ankiaddon for GitHub releases, .zip for AnkiWeb):
python build.py
Credits
License
GNU General Public License v3.0, like the original add-on.
Each modified source file states that it was modified and when.