Chamkho

Lao/Thai word segmentation library in Rust

Usage

As library

Lao

```rust extern crate chamkho;

use chamkho::wordcut::Wordcut; use chamkho::dict::Dict;

fn main() { let dict = Dict::load(Dict::laopath()); let wordcut = Wordcut::new(dict.unwrap()); let segmentedstring = wordcut.putdelimiters(&"ພາສາລາວມີ".tostring(), "|"); println!("{}", segmented_string); } ```

Thai

```rust extern crate chamkho;

use chamkho::wordcut::Wordcut; use chamkho::dict::Dict;

fn main() { let dict = Dict::load(Dict::defaultpath()); let wordcut = Wordcut::new(dict.unwrap()); let segmentedstring = wordcut.putdelimiters(&"กากกา".tostring(), "|"); println!("{}", segmented_string); } ```

As command line

echo "กากกา" | wordcut

External dictionary

echo "กากกา" | wordcut -d <path to dictionary>

Specific language

echo "ພາສາລາວມີ" | wordcut -l lao