Crates.io | budoux |
lib.rs | budoux |
version | 0.1.1 |
source | src |
created_at | 2022-01-11 13:56:00.566266 |
updated_at | 2022-05-15 12:46:21.769207 |
description | Rust port of BudouX (machine learning powered line break organizer tool). |
homepage | |
repository | https://github.com/sg0hsmt/budoux-rs |
max_upload_size | |
id | 512235 |
size | 117,264 |
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/
Split sentences with internal model.
let model = budoux::models::default_japanese_model();
let words = budoux::parse(model, "これはテストです。");
assert_eq!(words, vec!["これは", "テストです。"])
Load model from json file and split sentences using the loaded model.
let file = File::open(path_to_json).unwrap();
let reader = BufReader::new(file);
let model: budoux::Model = serde_json::from_reader(reader).unwrap();
let words = budoux::parse(&model, "これはテストです。");
assert_eq!(words, vec!["これは", "テストです。"])
cargo test
You can use GitHub Actions locally by act.
act -j test
go generate ./...
Note: Generate model is require Go 1.13 or later.