https://github.com/reinfer/blingfire-rs
Rust wrapper for the BlingFire tokenization library
https://github.com/reinfer/blingfire-rs
machine-learning nlp rust rust-wrapper tokenizer
Last synced: 12 months ago
JSON representation
Rust wrapper for the BlingFire tokenization library
- Host: GitHub
- URL: https://github.com/reinfer/blingfire-rs
- Owner: reinfer
- License: mit
- Created: 2019-07-06T13:50:14.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2020-06-23T16:31:02.000Z (almost 6 years ago)
- Last Synced: 2025-05-15T15:58:36.766Z (12 months ago)
- Topics: machine-learning, nlp, rust, rust-wrapper, tokenizer
- Language: Rust
- Size: 24.4 KB
- Stars: 15
- Watchers: 13
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
[](https://travis-ci.com/reinfer/blingfire-rs)
[](https://docs.rs/blingfire)
[](https://crates.io/crates/blingfire)
# BlingFire in Rust
`blingfire` is a thin Rust wrapper for the [BlingFire](https://github.com/microsoft/BlingFire) tokenization library.
Add the library to `Cargo.toml` to get started
```bash
cargo add blingfire
```
The library exposes two functions `text_to_words` and `text_to_sentences`
```rust
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.