Crates.io | to_bopomofo |
lib.rs | to_bopomofo |
version | 0.1.2 |
source | src |
created_at | 2024-01-23 14:52:53.593224 |
updated_at | 2024-01-23 15:06:48.222904 |
description | Converts a pinyin string to a Bopomofo string. |
homepage | |
repository | https://www.github.com/super1207/to_bopomofo |
max_upload_size | |
id | 1110907 |
size | 17,402 |
Converts a pinyin string to a Bopomofo string
cargo add to_bopomofo
use to_bopomofo::to_bopomofo;
fn main() {
let bopomofo1 = to_bopomofo("ni");
println!("bopomofo:{bopomofo1:?}"); // bopomofo:Some("ㄋㄧ")
let bopomofo2 = to_bopomofo("wrong pinyin");
println!("bopomofo:{bopomofo2:?}"); // bopomofo:None
}