BudouX-rs is a rust port of BudouX (machine learning powered line break organizer tool).
Note: This project contains the deliverables of the BudouX project.
Note: BudouX-rs supported plain text only, not supports html inputs.
https://sg0hsmt.github.io/budoux-rs/
https://docs.rs/crate/budoux/
Split sentences with internal model.
```rust let model = budoux::models::defaultjapanesemodel(); let words = budoux::parse(model, "これはテストです。");
assert_eq!(words, vec!["これは", "テストです。"]) ```
Load model from json file and split sentences using the loaded model.
```rust let file = File::open(pathtojson).unwrap(); let reader = BufReader::new(file); let model: budoux::Model = serdejson::fromreader(reader).unwrap(); let words = budoux::parse(&model, "これはテストです。");
assert_eq!(words, vec!["これは", "テストです。"]) ```
console
cargo test
You can use GitHub Actions locally by act.
console
act -j test
console
go generate ./...
Note: Generate model is require Go 1.13 or later.