to_bopomofo

Crates.ioto_bopomofo
lib.rsto_bopomofo
version0.1.2
sourcesrc
created_at2024-01-23 14:52:53.593224
updated_at2024-01-23 15:06:48.222904
descriptionConverts a pinyin string to a Bopomofo string.
homepage
repositoryhttps://www.github.com/super1207/to_bopomofo
max_upload_size
id1110907
size17,402
(super1207)

documentation

README

to_bopomofo

Converts a pinyin string to a Bopomofo string

install

cargo add to_bopomofo

use

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
}

Commit count: 0

cargo fmt