hanzi-sort 0.2.1

Sort Chinese text by pinyin or stroke count, with polyphonic overrides and terminal-friendly output
1
2
3
4
5
6
7
8
9
10
11
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct PinYinRecord {
    pub pinyin: Vec<String>,
    pub character: char,
}

impl PinYinRecord {
    pub fn primary_pinyin(&self) -> Option<&str> {
        self.pinyin.first().map(String::as_str)
    }
}