harper-pos-utils 1.3.0

The language checker for developers.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
use std::{fs::File, path::Path};

use rs_conllu::{Sentence, parse_file};

/// Produce an iterator over the sentences in a `.conllu` file.
/// Will panic on error, so this should not be used outside of training.
pub fn iter_sentences_in_conllu(path: impl AsRef<Path>) -> impl Iterator<Item = Sentence> {
    let file = File::open(path).unwrap();
    let doc = parse_file(file);

    doc.map(|v| v.unwrap())
}