Normalize and segment
Normalize Khmer Unicode, score dictionary paths by frequency, and recover unknown words with deterministic rules.
Khmer language engine
A dictionary-based Viterbi segmenter for NLP preprocessing, search, formal documents, and embedded applications, without a runtime machine-learning model.
Language processing
Normalize Khmer Unicode, score dictionary paths by frequency, and recover unknown words with deterministic rules.
Return whole-span typo diagnostics and Khmer-aware ranked suggestions instead of silently changing input.
Generate safe word-break opportunities and typed token metadata with offsets for downstream systems.
Stable pipeline
The same deterministic core can support search indexing, document review, OCR post-processing, or browser applications.
# Python 3.10 or newer python -m venv .venv # Activate .venv, then install from PyPI python -m pip install khmer-viterbi-segmenter # Segment Khmer text khmer-segment segment "ខ្ញុំស្រឡាញ់ប្រទេសកម្ពុជា"
Quick start
Create a virtual environment and install the published package from PyPI. The bundled runtime data works immediately without a separate download.
source .venv/bin/activate on Linux or macOS.venv\Scripts\Activate.ps1 in Windows PowerShellkhmer_segmenterPublished for Python
Install version 0.2.0 from PyPI, or review the API, ports, data terms, benchmarks, and examples in the project repository.