Function wordshk_tools::parse_rich_def[][src]

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

Parse a rich definition

Rich definitions start with an tag and contains one or more tags.

For example, here’s part of the rich definition for the word 便:

<explanation>
yue:用於方位詞之後書寫時亦會用# 代替本字
eng:suffix for directional/positional noun
<eg>
yue:#開便 (hoi1 bin6)
eng:outside
<eg>
yue:#呢便 (nei1 bin6)
eng:this side

// which parses to:

Def {
    yue: vec![vec![(Text, "用於方位詞之後。書寫時,亦會用".into()), (Link, "邊".into()), (Text, "代替本字".into())]],
    eng: Some(vec![vec![(Text, "suffix for directional/positional noun".into())]]),
    alts: vec![],
    egs: vec![ Eg {
            zho: None,
            yue: Some((vec![vec![(Link, "開便".into())]], Some("hoi1 bin6".into()))),
            eng: Some(vec![vec![(Text, "outside".into())]]),
        },
        Eg {
            zho: None,
            yue: Some((vec![vec![(Link, "呢便".into())]], Some("nei1 bin6".into()))),
            eng: Some(vec![vec![(Text, "this side".into())]]),
        },
    ],
}