Function pinyin_zhuyin::decode_pinyin [] [src]

pub fn decode_pinyin<S>(s: S) -> Option<String> where
    S: AsRef<str>, 

Decode pinyin

Returns None if invalid input.

Example

assert_eq!(decode_pinyin("mǎ"), Some("ma3".to_owned()));
assert_eq!(decode_pinyin("ér"), Some("er2".to_owned()));
assert_eq!(decode_pinyin("r"), Some("r5".to_owned()));