Skip to main content

A simple library for Khmer text processing, with optional dependencies for different features.

Project description

Khmer Easy Tools

A simple, user-friendly Python library for common Khmer Natural Language Processing (NLP) tasks. This package uses optional dependencies to provide different features.

Installation

Install the base package (which includes is_khmer and stop word utilities):

pip install khmereasytools

Installing Optional Features

You can install the features you need. This is useful if one of the dependencies has installation issues on your system.

# To install support for khmercut (khfilter)
pip install khmereasytools[khmercut]

# To install support for khmernltk (khseg, pos_tag, syllable_segment)
pip install khmereasytools[khmernltk]

# To install support for OCR
pip install khmereasytools[ocr]

# To install everything
pip install khmereasytools[all]

For OCR functionality, you must also install Google's Tesseract OCR engine on your system.

How to Use

Khmer Character Validation (is_khmer)

import khmereasytools as ket
print(ket.is_khmer("សួស្តី"))  # True

Keyword Extraction (khfilter)

Requires khmercut to be installed.

import khmereasytools as ket
# pip install khmereasytools[khmercut]
text = "នេះគឺជាប្រាសាទអង្គរវត្តស្ថិតនៅក្នុងខេត្តសៀមរាប"
keywords = ket.khfilter(text)
print(f"Keywords: '{{keywords}}'")

Text Segmentation (khseg)

Requires khmernltk to be installed.

import khmereasytools as ket
# pip install khmereasytools[khmernltk]
text = "នេះគឺជាប្រាសាទអង្គរវត្ត"
words = ket.khseg(text)
print(f"Segmented Words: {words}")

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

khmereasytools-0.3.3.tar.gz (6.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

khmereasytools-0.3.3-py3-none-any.whl (6.5 kB view details)

Uploaded Python 3

File details

Details for the file khmereasytools-0.3.3.tar.gz.

File metadata

  • Download URL: khmereasytools-0.3.3.tar.gz
  • Upload date:
  • Size: 6.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.16

File hashes

Hashes for khmereasytools-0.3.3.tar.gz
Algorithm Hash digest
SHA256 080bf8538884b11a3e208d58c22188426004620d0014ecfdd686da862a9dd09e
MD5 c575dc1398dd9c6788235fef78d0b335
BLAKE2b-256 dafead8a6df5e7927cf60c698f2fb79fa47f5edc6998380ce7891547be4e1fe6

See more details on using hashes here.

File details

Details for the file khmereasytools-0.3.3-py3-none-any.whl.

File metadata

  • Download URL: khmereasytools-0.3.3-py3-none-any.whl
  • Upload date:
  • Size: 6.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.16

File hashes

Hashes for khmereasytools-0.3.3-py3-none-any.whl
Algorithm Hash digest
SHA256 3960fe1e65267c60bda12cf93a5905ed78013886b68380c3b3f7931209ac14fe
MD5 5455445bea14cb307a691000a1d6c6c2
BLAKE2b-256 547026118ae6387777e1e7e6977c9e411a5341d570f9d32a310efc15c952fb22

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page