khmercut
A (fast) Khmer word segmentation toolkit.
pip install khmercut
Python
from khmercut import tokenize
tokenize("ឃាត់ខ្លួនជនសង្ស័យ០៤នាក់ ករណីលួចខ្សែភ្លើង នៅស្រុកព្រៃនប់")
# => ['ឃាត់ខ្លួន', 'ជនសង្ស័យ', '០៤', 'នាក់', ' ', 'ករណី', 'លួច', 'ខ្សែភ្លើង', ' ', 'នៅ', 'ស្រុក', 'ព្រៃនប់']
Neural model
A distilled neural segmenter. More accurate, and it can split compound words.
pip install khmercut[nn]
from khmercut.nn import tokenize
tokenize("ឃាត់ខ្លួនជនសង្ស័យ០៤នាក់")
# => ['ឃាត់ខ្លួន', 'ជនសង្ស័យ', '០៤', 'នាក់']
tokenize("ឃាត់ខ្លួនជនសង្ស័យ០៤នាក់", deep=True)
# => [['ឃាត់', 'ខ្លួន'], ['ជន', 'សង្ស័យ'], ['០៤'], ['នាក់']]
With deep=True each word becomes a list of its sub-words. Spaces are returned
as ' ' and newlines as '\n'.
Both backends load lazily, so importing one does not pull in the other.
Reference
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
khmercut-0.2.0.tar.gz
(7.8 MB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file khmercut-0.2.0.tar.gz.
File metadata
- Download URL: khmercut-0.2.0.tar.gz
- Upload date:
- Size: 7.8 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.14.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6b0f07b898559ce74fd4e8adc12092c80cabe4d9fb69d7a52c01a5b84465daf6
|
|
| MD5 |
46c02c76b18289be1d3c797628b309bf
|
|
| BLAKE2b-256 |
090ae1f08e2fc39586b67bed0c5776caccf31e184c25e11e6f794e943cc7ee5b
|
File details
Details for the file khmercut-0.2.0-py3-none-any.whl.
File metadata
- Download URL: khmercut-0.2.0-py3-none-any.whl
- Upload date:
- Size: 7.8 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.14.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d92123f4d682ed976d3b5cb4491af8d753ded4f404493166cdd5f527771eac80
|
|
| MD5 |
047ac005b294b8373aeb600d0a42bf58
|
|
| BLAKE2b-256 |
1d51a999684cb54951c7798f2ac863940b31c2a1989ebc8105ef9bd38ebb3245
|