Skip to content

Rust library for reading and parsing XML-dictionary from opencorpora.org

License

Notifications You must be signed in to change notification settings

antage/opencorpora

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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);
        },
    }
}

About

Rust library for reading and parsing XML-dictionary from opencorpora.org

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages