| Crates.io | budoux-phf-rs |
| lib.rs | budoux-phf-rs |
| version | 0.1.0 |
| created_at | 2026-01-21 03:12:15.490289+00 |
| updated_at | 2026-01-21 03:12:15.490289+00 |
| description | Rust implementation of BudouX |
| homepage | |
| repository | https://github.com/holrock/budoux-phf-rs |
| max_upload_size | |
| id | 2058144 |
| size | 442,322 |
Rust implementation of BudouX, the machine learning-based line break organizer tool.
Add this to your Cargo.toml:
[dependencies]
budoux-phf-rs = "0.1"
use budoux_phf_rs::Parser;
fn main() {
// Create a parser with Japanese model
let parser = Parser::japanese_parser();
let text = "今日は天気です。";
let chunks: Vec<&str> = parser.parse(text);
println!("{:?}", chunks);
// => ["今日は", "天気です。"]
}
use budoux_phf_rs::Parser;
fn main() {
// Simplified Chinese
let parser_zh_hans = Parser::simplified_chinese_parser();
// Traditional Chinese
let parser_zh_hant = Parser::traditional_chinese_parser();
// Thai
let parser_th = Parser::thai_parser();
}
By default, all language models are included. You can select specific languages to reduce binary size:
[dependencies]
# Include only Japanese
budoux_phf_rs = { version = "0.1", default-features = false, features = ["ja"] }
# Include Japanese and Simplified Chinese
budoux_phf_rs = { version = "0.1", default-features = false, features = ["ja", "zh_hans"] }
Available features:
| Feature | Language | Description |
|---|---|---|
ja |
Japanese | Japanese model |
zh_hans |
Simplified Chinese | Simplified Chinese model |
zh_hant |
Traditional Chinese | Traditional Chinese model |
th |
Thai | Thai model |
$ cargo run -p codegen <path/to/budoux/budoux/models> lib/src/
Licensed under the Apache License, Version 2.0. See LICENSE for details.