#pinyin #chinese #zhuyin

pinyin_zhuyin

Convert between pinyin forms and zhuyin

4 releases

0.2.0 Jun 11, 2023
0.1.2 Dec 26, 2017
0.1.1 Dec 23, 2017
0.1.0 Dec 23, 2017

#192 in Internationalization (i18n)

Download history 17/week @ 2024-09-23 8/week @ 2024-09-30 1/week @ 2024-10-14 164/week @ 2024-12-09

164 downloads per month

MIT license

29KB
609 lines

pinyin_zhuyin

A library to convert between pinyin and zhuyin.

The original library is Bomin Zhang's Go library "zhuyin".

https://github.com/localvar/zhuyin (Golang version)

https://github.com/DictPedia/ZhuyinPinyin (PHP version)

Usage

Add this to your Cargo.toml:

[dependencies]
pinyin_zhuyin = "0.2"

API

encode_pinyin("zhang1") // zhāng
decode_pinyin("zhāng") // zhang1

encode_zhuyin("zhang1") // ㄓㄤ
decode_zhuyin("ㄓㄤ") // zhang1

pinyin_to_zhuyin("zhāng") // ㄓㄤ
zhuyin_to_pinyin("ㄓㄤ") // zhāng

split("zhang1") // ("zh", "ang", 1)

lib.rs:

Convert between pinyin forms and zhuyin.

Dependencies

~135KB