zhtw
Traditional Chinese converter for Taiwan — Rust SDK
Simplified Chinese / HK Traditional to Taiwan Traditional Chinese converter. Build-time precompiled daachorse automaton + phf char map for zero runtime construction cost. Byte-for-byte compatible with the Python CLI and all other SDKs.
Install
[]
= "4.4.0"
Quick start
// Zero config
assert_eq!;
Builder API
use ;
let conv = builder
.sources
.custom_dict
.ambiguity_mode
.build
.expect;
conv.convert;
API
| Function | Description |
|---|---|
convert(text) |
Convert text (uses default converter) |
check(text) |
Return replacements without modifying |
lookup(word) |
Look up a single word |
Converter::builder() |
Custom converter with builder pattern |
Performance
Build-time precompiled automaton — runtime is pure matching with zero initialization overhead. Run cargo bench -p zhtw for benchmarks.
Requirements
- Rust 1.80+ (MSRV)
- Zero runtime dependencies beyond
daachorseandphf
Links
License
MIT