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

#1183 in Machine learning

Download history 449/week @ 2024-11-15 345/week @ 2024-11-22 624/week @ 2024-11-29 617/week @ 2024-12-06 586/week @ 2024-12-13 243/week @ 2024-12-20 156/week @ 2024-12-27 356/week @ 2025-01-03 440/week @ 2025-01-10 435/week @ 2025-01-17 355/week @ 2025-01-24 398/week @ 2025-01-31 469/week @ 2025-02-07 474/week @ 2025-02-14 463/week @ 2025-02-21 418/week @ 2025-02-28

1,923 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