# Seema
Khmer, Lao, Myanmar, and Thai word segmentation/breaking library in Python written in Rust

# Develop

## Prerequisite

* maturin
* venv
* Rust and Cargo

## Create and use venv

```Shell
python -mvenv venv
. venv/bin/activate
```

## Build Seema

```Shell
maturin build
pip install target/wheels/seema-0.3.0-cp313-cp313-manylinux_2_34_x86_64.whl 
```

## Download dictionaries and rules

```Shell
wget https://codeberg.org/mekong-lang/mekong-lang-data/archive/main.tar.gz -O - | tar xzvf -
```




## Run Seema

```Python
>>> from seema import Seema
>>> Seema("mekong-lang-data/dictionaries/mixed/chamkho-dict.txt", "mekong-lang-data/cluster-rules/thai_cluster_rules.txt")
>>> s.segment_into_strings("វេវចនានុក្រមពហុភាសាដោយឥតគិតថ្លៃฉันกินข้าวຈະຊອກຫາອີ່ຫຍັງ本日のお仕事終了 しましたpop musicရှေး")
['វេ',
 'វចនានុក្រម',
 'ពហុ',
 'ភាសា',
 'ដោយ',
 'ឥត',
 'គិតថ្លៃ',
 'ฉัน',
 'กินข้าว',
 'ຈະ',
 'ຊອກ',
 'ຫາ',
 'ອີ',
 '່',
 'ຫຍັງ',
 '本日',
 'の',
 'お仕事',
 '終了',
 ' ',
 'しま',
 'した',
 'pop',
 ' ',
 'music',
 'ရှေး']

```
