7 个版本

0.3.0 2022年6月17日
0.2.0 2017年12月23日
0.1.4 2017年3月21日
0.1.2 2016年4月22日

#2050解析器实现

MIT 许可证

30KB
541

opencorpora

Build Status

本库是为了解析 opencorpora.org 项目的词典而编写的。库读取 XML 格式的词典并形成结构化数据集。

文档

链接

使用示例

use opencorpora::Dict;

fn main() {
    use std::fs::File;

    let file = File::open("dict.xml").unwrap();
    match Dict::read_from_xml(&file) {
        Ok(dict) => {
            println!("Version: {}", dict.version);
            println!("Revision: {}", dict.revision);
            println!("Grammemes count: {}", dict.grammemes.len());
            println!("Restrictions count: {}", dict.restrictions.len());
            println!("Lemmata count: {}", dict.lemmata.len());
            println!("Link types count: {}", dict.link_kinds.len());
            println!("Links count: {}", dict.links.len());
        },
        Err(e) => {
            println!("ERROR: {}", e);
        },
    }
}

依赖关系

~1.5–2.1MB
~39K SLoC