#pinyin #chinese #hanzi

prettify_pinyin

Turn tone numbers into tone marks

4 releases (2 stable)

1.0.1 Dec 20, 2017
1.0.0 Dec 9, 2017
0.1.1 Dec 8, 2017
0.1.0 Dec 8, 2017

#10 in Localization (L10n)

Download history 6/week @ 2018-05-04 1/week @ 2018-05-11 1/week @ 2018-05-18 8/week @ 2018-05-25 21/week @ 2018-06-01 1/week @ 2018-06-08 29/week @ 2018-06-15 6/week @ 2018-06-22 33/week @ 2018-06-29 4/week @ 2018-07-06 4/week @ 2018-07-13 13/week @ 2018-07-20 13/week @ 2018-07-27

18 downloads per month

prettify_pinyin

v1.0.1

About

Turn pinyin written with tone numbers and turn it into pinyin with node marks. prettify_pinyin accepts input in the CC-CEDICT pinyin format (space separated syllables with tone numbers at the end of each syllable), for example: "ni3 hao3" will get turned into "nǐ hǎo".

This project is a Rust translation of John Heroy's prettify-pinyin JavaScript project.

Usage

extern crate prettify_pinyin;

use prettify_pinyin::prettify;

let test = String::from("ma1 ma2 ma3 ma4 ma");
let formatted: String = prettify(test);

println!("{}", formatted); // --> mā má mǎ mà ma

Contributors

License

MIT


lib.rs:

About

Turn pinyin written with tone numbers and turn it into pinyin with node marks. prettify_pinyin accepts input in the CC-CEDICT pinyin format (space separated syllables with tone numbers at the end of each syllable), for example: "ni3 hao3" will get turned into "nǐ hǎo".

This project is a Rust translation of John Heroy's prettify-pinyin JavaScript project.

Usage

extern crate prettify_pinyin;

use prettify_pinyin::prettify;

let test = String::from("ma1 ma2 ma3 ma4 ma");
let formatted: String = prettify(test);

println!("{}", formatted); // --> mā má mǎ mà ma
MIT license
  • No runtime deps

Reverse deps