Skip to main content

A simple, self-contained library for Khmer text processing, with optional OCR and POS tagging support.

Project description

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.

How to Use

Keyword Extraction (khfilter)

Uses a built-in segmentation algorithm to find words and remove stop words.

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}")

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}")

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.7.tar.gz (7.8 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.7-py3-none-any.whl (8.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: khmereasytools-0.3.7.tar.gz
  • Upload date:
  • Size: 7.8 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.7.tar.gz
Algorithm Hash digest
SHA256 4a0b692636b39b957a2f0c8643d92f44b6d902cdb69e1abe792d0c21d079e80d
MD5 ba74a68bfe505b5ea2b58b1890b2835d
BLAKE2b-256 a8acfffeaff4d5f3a8515d13e79b19117ae35005d4a70b167940a960257e931f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: khmereasytools-0.3.7-py3-none-any.whl
  • Upload date:
  • Size: 8.1 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.7-py3-none-any.whl
Algorithm Hash digest
SHA256 b5504f774f069491699dc2c940b88fdea05165cb3db95ac5713e0b638b146a22
MD5 340223acf4543b63bfa83649b0f7b788
BLAKE2b-256 68f1b0ab181602678cd109ac9e520ae02eb5e7d60005b381b4ab5ed0ad632d21

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