Crates.io | prettify_pinyin |
lib.rs | prettify_pinyin |
version | 2.0.0 |
source | src |
created_at | 2017-12-08 17:56:16.171542 |
updated_at | 2023-06-03 14:51:19.69556 |
description | Turn tone numbers into tone marks |
homepage | |
repository | https://github.com/sotch-pr35mac/prettify_pinyin |
max_upload_size | |
id | 42176 |
size | 9,423 |
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".
use prettify_pinyin::prettify;
let formatted: String = prettify("ma1 ma2 ma3 ma4 ma");
println!("{}", formatted); // --> mā má mǎ mà ma