12 3 12 Sign in to rate

Pinyin on top of Hanzi

10.83MB. Updated 2018-01-31. Only supports Anki 2.1.x.

The author has shared 2 other item(s).

This item is large, and may take some time to download.

Description

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 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 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 .

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 . 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. For the source code, the GitHub link this addon turnsintois really quite simple. At its core is the recent addition of ruby characters to HTML. Here is a part of above example'sHTML:. Because it's pure HTML we can directly add theto 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.was designed for ease of use. After installation, to start the Pinyin generation, go toThen 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 theoutput 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.without two third-party Python modules. I've usedas well as the free Chinese dictionary CEDICT . Everything is bundled in the addon, which explains its large download size.

Download

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

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

417709332

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

Reviews

This is really good though i have a question, once I click close for adding cards in a deck, then using the pinyin helper (I click on the generate for all cards, replacing existing pinyin), the problem is when i make new cards and apply the same add-on it adds a second line of pinyin for my previous cards that I already used the add-on to, so essentially it is not replacing existing pinyin, what is the solution for this?

As a (Windows) How-To see Anki forum:

"Pinyin on top of Hanzi (417709332) - getting started"



https://anki.tenderapp.com/discussions/add-ons/44015-pinyin-on-top-of-hanzi-417709332-getting-started?unresolve=true



It works!

Doesn't work with traditional characters. What a shame.

tip if you have text that happens to have spaces between the words in hanzi, if you replace the space with \ this plugin will parse better. i don't think you can find and replace it in anki (you'd have to export, import etc )

holy crap. this plus wordquery (for j-k-e dictionaries as well as when pinyin on top of hanzi doesn't parse correctly which is RARE), subs2srs decks, morphman (priority.db etc), Search cards based on length, Automatically show answer after X seconds have made learning mandarin very easy and fun! https://massimmersionapproach.com/table-of-contents/anki/morphman/ I'm all for avoiding manually copy pasting and clicking crap 5 billion times!



BE SURE YOU DESIGNATE THE CORRECT FIELD OTHERWISE IT WILL WRITE OVER YOUR HANZI FIELD ETC.



wordquery autohtokey script https://www.reddit.com/r/ChineseLanguage/comments/d054pv/authotkey_scripts_for_wordquery_plugin_in_anki/

hi this looks like a great addon but because of my stupid mistake i apply this and now my front card has all the pinyin and i cant practice reading them anymore... i only have 1 question, how do i remove pinyin above hanzi? i can manually remove them but i have 2k cards affected by this... is this the only way??

Great idea, but I found it doesn't work on complicated sentences. A lot of times the add-on gets confused wether a character is related to the character before or after. Also, when I add pinyin to a sentence, some characters just disappear. Would be awesome if we could just select the words we wanted to generate pinyin for in the "Add card" editor!

Is anyone else here trying to install the anki 2.0 version of this add-on that is found in the Github link above?



I don't know whether the interface is different with this version, or if I am simply not installing it correctly when I manually put the file into the add-on folder.



Any help would be much appreciated...

It's the most useful Chinese addon available.

Works really well!

Love it!

Thank you for the Add-on, but I am not able to download it. Error message:



"Download failed: Error downloading: 404"



I am able to install other add-ons though. Could you please take a look? Thank you so much!

Haven't tried this yet, seems like a GOD idea.

Addon is quite useful. Much more aesthetic than separate fields.

Though in my opionion the pinyin should not written to the hanzi field, but instead still added as separate pinyin field.

This way you can train to read the hanzi.

The addon allows this. But maybe the default configuration or the documentation should mention this.

Also, better have a working backup before applying the update, the hanzi fields get overrridden.

Really cool!



I don't use Anki for learning Chinese, but I'll definitely be recommending this add-on to other users. Great job!



– G