5 releases (1 stable)

1.0.1 Jun 23, 2020
0.2.1 Jul 10, 2019
0.2.0 Jul 7, 2019
0.1.1 Jul 6, 2019
0.1.0 Jul 6, 2019

#1068 in Machine learning

Download history 893/week @ 2024-07-23 908/week @ 2024-07-30 887/week @ 2024-08-06 707/week @ 2024-08-13 458/week @ 2024-08-20 680/week @ 2024-08-27 615/week @ 2024-09-03 585/week @ 2024-09-10 484/week @ 2024-09-17 624/week @ 2024-09-24 539/week @ 2024-10-01 567/week @ 2024-10-08 601/week @ 2024-10-15 500/week @ 2024-10-22 618/week @ 2024-10-29 578/week @ 2024-11-05

2,397 downloads per month
Used in blingfire

MIT license

5MB
66K SLoC

C++ 66K SLoC // 0.0% comments Jupyter Notebooks 121 SLoC // 0.2% comments Rust 69 SLoC

Build Status Documentation

BlingFire in Rust

blingfire is a thin Rust wrapper for the BlingFire tokenization library.

Add the library to Cargo.toml to get started

cargo add blingfire

The library exposes two functions text_to_words and text_to_sentences

use blingfire;

fn main() {
    let mut parsed = String::new();

    blingfire::text_to_words("Cat,sat on   the mat.", &mut parsed).unwrap();
    assert_eq!(parsed.as_str(), "Cat , sat on the mat .");

    blingfire::text_to_sentences("Cat sat. Dog barked.", &mut parsed).unwrap();
    assert_eq!(parsed.as_str(), "Cat sat.\nDog barked.");
}

The code is licensed under the MIT License.

Dependencies