Function wordshk_tools::parse_defs[][src]

pub fn parse_defs<'a>() -> BoxedParser<'a, Vec<Def>, ()>
Expand description

Parse a series of definitions for a word, separated by “----”

For example, here’s a series of definitions for the word 兄

<explanation>
yue:同父母或者同監護人年紀比你大嘅男性
eng:elder brother
<eg>
yue:#兄弟 (hing1 dai6)
eng:brothers
----
yue:對男性朋友嘅尊稱
eng:politely addressing a male friend

// which parses to:

vec![
    Def {
        yue: vec![vec![(Text, "同父母或者同監護人,年紀比你大嘅男性".into())]],
        eng: Some(vec![vec![(Text, "elder brother".into())]]),
        alts: vec![],
        egs: vec![
            Eg {
                zho: None,
                yue: Some((vec![vec![(Link, "兄弟".into())]], Some("hing1 dai6".into()))),
                eng: Some(vec![vec![(Text, "brothers".into())]]),
            }
        ],
    },
    Def {
        yue: vec![vec![(Text, "對男性朋友嘅尊稱".into())]],
        eng: Some(vec![vec![(Text, "politely addressing a male friend".into())]]),
        alts: vec![],
        egs: vec![],
    },
]