Pinyin on top of Hanzi

AnkiWeb addon 417709332

Generates Pinyin ruby annotations above Hanzi in selected fields, matching existing Pinyin or producing it via word segmentation and a bundled dictionary, and can build HTML definition tables.
AI-generated summary; may contain mistakes.

card-creationformattingdictionary

Open on AnkiWeb GitHub Find alternatives

AnkiWeb

Votes
27 (πŸ‘ 21 Β· πŸ‘Ž 6)
Updated
2018-01-30
Anki versions
unknown
License
Not found (this does not mean that the addon has no license)
Virus scan
No ClamAV match A match does not prove malware. No match does not prove that the code is safe.
Languages
Python, CSV, JSON
Description language
en

Maintenance

abandoned

  • Last update or commit: 2018-02-18 (3178 days before the snapshot).
  • Commits in the last year: 0.
  • Issues: 2 open, 0 closed.
  • Pull requests: 0 open, 0 merged.

Will it work on my Anki?

Version branches
Min AnkiMax AnkiUpdated
2.1.0–2018-01-30
History across monthly snapshots

Loading…

Similar addons

Hanzi2Pinyin

Converts Chinese characters in any Anki field into Pinyin or Zhuyin ruby annotations displayed above the Hanzi, supporting simplified and traditional text.

card-creationformatting

6 votes 61% approval πŸ‘ 6 Β· πŸ‘Ž 0 ⭐ 13 Anki 25.09~ Updated 2025-09-23
anki_ruby_support

Adds customizable ruby annotations (furigana/pinyin) to selected card text via toolbar button or shortcut key, with adjustable font size, text color, and error logging.

formattingshortcuts

1 votes 21% approval πŸ‘ 1 Β· πŸ‘Ž 0 Anki 2.1.1~ Updated 2025-01-14

Description

For the source code, the GitHub link. In a nutshell, this addon turns into The way the addon achieves this is really quite simple. At its core is the recent addition of ruby characters to HTML. Here is a part of above example's ruby HTML: <ruby>θ€εΈˆ<rt>lǎo shΔ«</rt></ruby>. Because it's pure HTML we can directly add the ruby to one of the note's fields. Make sure to add a field beforehand to your note, as the addon can (currently) only work with existing fields. The addon works whether you already have matching Pinyin. It helps to have matching Pinyin, but the addon is smart enough to generate (usually correct) Pinyin on its own. The interface was designed for ease of use. After installation, to start the Pinyin generation, go to Tools β†’ Chinese tools β†’ Pinyin helper. Then choose the deck, note type, and field with the Hanzi characters. If you already have a field with matching Pinyin, select the first option. The addon will match Hanzi and Pinyin together to the best of its ability. You can preview the output by selecting any one of the Hanzi on the left (from your own cards) and see the matched Hanzi and Pinyin on the right. Make sure to select a field for where the ruby output should go. Here is an example of the addon generating Pinyin when there is no pre-existing Pinyin to match with the Hanzi. The addon goes beyond assigning Pinyin to individual Hanzi, which is error-prone β€” there are many Hanzi with multiple Pinyin readings. It instead first splits the Hanzi sentence (in which there are usually no spaces) into words, then looks up each word in an internal dictionary. While it may make the occasional mistake it is remarkably adept at assigning the right Pinyin. There is also the option of generating a table of definitions from the internal dictionary: The addon restricts the dictionary entries to match the Pinyin readings, which it finds in the note if you specified a Pinyin field, or generates on its own if you haven't. The dictionary entries are also entirely in HTML, and come with CSS selectors for the word, Pinyin, and definitions columns. Remember to specify another field in the note where the table of definitions will go. This addon would not have been possible without two third-party Python modules. I've used
  • jieba for segmenting Hanzi into words, and
  • zhon for correctly splitting joined-up Pinyin
as well as the free Chinese dictionary CEDICT. Everything is bundled in the addon, which explains its large download size. Notes
  • Although ruby generation works for all Pinyin options, when Pinyin is generated where there is none currently existing, the Pinyin will not be saved to the note, despite the option Pinyin output.
  • I have some pretty bare-bones CSS for the definitions table, which I'll publish soon.
  • I include spacing between Hanzi in the ruby.If you want to preserve the spacing of the original Hanzi, I'll add that as another option in the addon window.

README

anki-chinese