Khmer Easy Tools
A simple, user-friendly, and self-contained Python library for common Khmer Natural Language Processing (NLP) tasks. This package provides easy-to-use functions for keyword extraction and segmentation without requiring complex external dependencies for its core features.
Installation
Install the base package:
pip install khmereasytools
Installing Optional Features
You can install the features you need.
# To install support for POS tagging (khpos)
pip install khmereasytools[khmernltk]
# To install support for OCR (khocr)
pip install khmereasytools[ocr]
# To install all optional features
pip install khmereasytools[all]
For OCR functionality, you must also install Google's Tesseract OCR engine on your system.
- Tesseract Installation Guide
- Make sure to install the Khmer (
khm) language data.
How to Use
Keyword Extraction (khfilter)
Uses a built-in segmentation algorithm to find words and remove stop words by using Khmer Stop Word and Segmentaion Dictionary.
import khmereasytools as ket
text = "នេះគឺជាប្រាសាទអង្គរវត្តស្ថិតនៅក្នុងខេត្តសៀមរាប"
keywords = ket.khfilter(text)
print(f"Keywords: '{keywords}'")
Text Segmentation (khseg)
Uses a built-in segmentation algorithm to split text into words.
import khmereasytools as ket
text = "នេះគឺជាប្រាសាទអង្គរវត្ត"
words = ket.khseg(text)
print(f"Segmented Words: {words}")
Syllable Segmentation (khsyllable)
Uses a built-in rule-based method to split text into syllables.
import khmereasytools as ket
text = "សាលារៀន"
syllables = ket.khsyllable(text)
print(f"Syllables: {syllables}")
Part-of-Speech Tagging (khpos)
Requires khmernltk to be installed.
import khmereasytools as ket
# pip install khmereasytools[khmernltk]
text = "ខ្ញុំស្រឡាញ់ភាសាខ្មែរ"
tags = ket.khpos(text)
print(f"POS Tags: {tags}")
OCR from Image (khocr)
Requires ocr dependencies to be installed.
import khmereasytools as ket
# pip install khmereasytools[ocr]
# text_from_image = ket.khocr('khmer_text.png')
# print(f"Text from OCR: {text_from_image}")
Metadata
Release files for khmereasytools 0.3.8
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| khmereasytools-0.3.8.tar.gz | 8.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| khmereasytools-0.3.8-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 17.3 kB
Release files / khmereasytools-0.3.8.tar.gz
| Download URL | khmereasytools-0.3.8.tar.gz |
|---|---|
| Size | 8.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5333e0b356be2f45ec54b7f91c1db56ad4b73d68a283452f85f078f77e54479e
|
|
BLAKE2b-256 checksum How to use checksums |
b103a6d72cfdbb7bb031d8df47f2608ff1b9fb6c673fec0e255b3ae0a380baf5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.10.16
|
Release files / khmereasytools-0.3.8-py3-none-any.whl
| Download URL | khmereasytools-0.3.8-py3-none-any.whl |
|---|---|
| Size | 8.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e56c572520e2c56ce026a9ce10dbb925103363f9b67fa4274d9b17368203ec3e
|
|
BLAKE2b-256 checksum How to use checksums |
8fe3173df0956ff27a9bc63af5248f06e36b0012a339f2c59d8d93b88df93f7c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.10.16
|