Crates.io | opencorpora |
lib.rs | opencorpora |
version | 0.3.0 |
source | src |
created_at | 2016-04-20 10:34:53.130186 |
updated_at | 2022-06-17 07:37:25.362065 |
description | Reading and parsing opencorpora.org XML-dictionary. |
homepage | |
repository | https://github.com/antage/opencorpora |
max_upload_size | |
id | 4797 |
size | 48,274 |
Данная библиотека написана для парсинга словаря проекта 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);
},
}
}