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 17/week @ 2018-07-31 54/week @ 2018-08-07 9/week @ 2018-08-14 4/week @ 2018-08-28 6/week @ 2018-09-04 2/week @ 2018-09-18 15/week @ 2018-10-02 4/week @ 2018-10-09 6/week @ 2018-10-16

18 downloads per month

MIT license

8KB
80 lines

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

No runtime deps