Skip to content

A conllu parser in rust.

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT
Notifications You must be signed in to change notification settings

dahelb/rs-conllu

Repository files navigation

rs-conllu

This project aims to provide a parser for the CoNLL-U format of the Universal Dependencies project: https://universaldependencies.org/format.html.

Basic Usage

Parse a file in CoNLL-U format and iterate over the containing sentences.

use rs_conllu::parse_file;
use std::fs::File;

let file = File::open("tests/example.conllu")?;

let parsed = parse_file(file)?;

// Iterate over the contained sentences.
for sentence in parsed {
    // We can also iterate over the tokens in the sentence.
    for token in sentence {
        // Process token, e.g. access individual fields.
        println!("{}", token.form)
    }
}

Features

  • Tested on version 2.11 UD treebanks
  • Handles different types of token ids (single, range, empty)

Limitations

Parsing happens in a "flat" manner, relations between tokens are not respected.

About

A conllu parser in rust.

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •  

Languages