An open API service indexing awesome lists of open source software.

https://github.com/alyssabedard/hanzi2pinyin

Anki add-on that adds Pinyin and Zhuyin readings above Chinese characters in any field.
https://github.com/alyssabedard/hanzi2pinyin

anki anki-addon bopomofo cantonese chinese flashcards jyutping mandarin pinyin sentence-mining xiaoerjing zhuyin

Last synced: 3 months ago
JSON representation

Anki add-on that adds Pinyin and Zhuyin readings above Chinese characters in any field.

Awesome Lists containing this project

README

        


Hanzi2Pinyin







Demo of Hanzi2Pinyin




💜 For the Quick Start Guide click here💜


To download the companion Anki note type click here

## Description
This [Anki](https://apps.ankiweb.net/) add-on lets you add **Pinyin** and **Zhuyin** readings above Chinese characters
(Hanzi) in **any field**.

It works by converting your Chinese text into [ruby](https://en.wikipedia.org/wiki/Ruby_character) annotations, where
the Pinyin appears as small text
above the original characters, making it easier to read and study Chinese text.

_[Why Hanzi2Pinyin when there are other great add-ons?](#why-Hanzi2Pinyin-when-there-are-other-great-add-ons)_

> ⚠️ For the [ruby](https://en.wikipedia.org/wiki/Ruby_character) annotation to work
> use this [Anki note type](https://github.com/alyssabedard/Hanzi2Pinyin-notetype) made specifically for this add-on.
>
> Read the [Anki documentation on Ruby characters](https://docs.ankiweb.net/templates/fields.html?highlight=furigana#ruby-characters).

_Looking for the Quick Start Guide? Need help? Want to raise an issue? Looking for documentation? See [Contributing & Support](#contributing--support)_


Example

| Type | Pinyin | Zhuyin |
|---------------|-------------------------------------------------------------------------------|--------------------------------------------------------------------------------|
| Hanzi | 你好 | 你好 |
| Hanzi to Ruby | `你[nǐ]好[hǎo]` | `你[ㄋㄧˇ]好[ㄏㄠˇ]` |
| HTML Code | `你nǐ好hǎo` | `你ㄋㄧˇ好ㄏㄠˇ` |
| HTML Output |

你nǐ好hǎo
|
你ㄋㄧˇ好ㄏㄠˇ
|

## Demo




Demo of Hanzi2Pinyin
Demo
⬇️

Demo

Demo with Zhuyin




Demo of Hanzi2Pinyin

Demo Tools settings (macOS)




Demo of Hanzi2Pinyin

## Features
- [x] Pinyin support - _Browse_ editor dialog
- [x] Pinyin support - _Add_ editor dialog
- [x] Zhuyin (Bopomofo) support
- [x] Note Type that supports ruby text for Chinese

Key benefits:
- Works with any field name of your choosing (No restrictions)
- Simple and reliable functionality
- Support both Simplified and Traditional Chinese Characters

### Planned Features

| Status | Feature | Details |
|--------|------------------------|----------------------------------------------------------------------|
| 🔄 | Bulk add/remove | Available in tools menu |
| 🔄 | Jyutping and Cantonese | Support for Cantonese pronunciation |
| 🔄 | Xiao'erjing | Support for Arabic-Persian script (also known as Xiaor jin/Xiaojing) |
| 🔄 | Sandhi | Support for phonological changes between adjacent tones _(Note 1)_ |

> Note 1: Sandhi refers to how tones change when certain tones/words are next to each other in
> speech. For example, in Mandarin, when a hanzi with the third
> tone is followed by another hanzi with the third tone,
> the first hanzi changes to second tone instead.

I plan on making additional Chinese language tools that will be
released as separate add-ons to maintain simplicity as
I prefer single-purpose add-ons.

## Why Hanzi2Pinyin when there are other great add-ons?
This add-on focuses on simplicity and flexibility. While many add-ons offer extensive features,
they often come with drawbacks:
- Break when Anki or Qt versions are updated
- Restrict you to specific field names
- Bundle multiple features you might not need

## Contributing & Support

| Type | Description |
|--------------------------------------------------------------------------|---------------------------------|
| [Issues & Requests](https://github.com/alyssabedard/Hanzi2Pinyin/issues) | Bug reports or feature requests |
| [Contributing](.github/CONTRIBUTING.md) | Fork the repo and submit a PR |
| [Discussions](https://github.com/alyssabedard/Hanzi2Pinyin/discussions) | Getting help and questions |
| [Support](.github/SUPPORT.md) | Support |
| [Quick Start Guide](docs/quick_start_guide.md) | Quick Start Guide |
| [Technical documentation](docs/development.md) | Technical documentation |

**OS**
This script has been primarily tested on macOS and Windows. I currently don't have access
to a Linux machine for thorough testing.

## Acknowledgements

### Libraries
| Library | Links |
|---------|-------|
| jieba | [PyPi](https://pypi.org/project/jieba/), [GitHub](https://github.com/fxsjy/jieba) |
| pypinyin | [PyPi](https://pypi.org/project/pypinyin/), [GitHub](https://github.com/mozillazg/python-pinyin) |

### Other
| Description | Source |
|---------------|----------------------------------------|
| Anki SVG logo | [Glutanimate](https://glutanimate.com) |




加油


Demo of Hanzi2Pinyin