Skip to main content

Khmer Spelling

Khmer Spelling or Unicode Character Reordering which corrects the ordering of Khmer unicode character by following the rule / specification in the khmer character specification.

Features

  1. khnormal: Fixes Khmer Unicode Character ordering or incorrect spelling. This work is cloned from specification's python script.
  2. ...

Installation

pip install khmerspell

Usage

To correct the spelling khmer text.

from khmerspell import khnormal

text = "ខ្ញំុជាស្រ្តីខ្មែរ" # wrong encoding ordering

encoded_text = khnormal(text)

print(encoded_text) # correct encoding ordering, according to the specification

Further more, you can print out each unicode character to see what has been changed, as following:

def get_hex_code_points(sentence):
    """
    Get the Unicode code points of each character in the token.
    """
    return [f"U+{ord(char):04X}" for char in sentence]

text = "ខ្ញំុជាស្រ្តីខ្មែរ"
# Print the text
print(text)

# Print unicode code of each character
print(get_hex_code_points(text))

# Encode the text
encoded_text = khnormal(text)

# Print the encoded text
print(encoded_text)

# Print the unicode code of each encoded character
print(get_hex_code_points(encoded_text))

Contribution

You are welcomed to contribute to this project so long as you abide by the license below. You can either create issues for us to fix or a PR for us to review.

License

Creative Commons License
Khmer Character Specification/Usages by SIL is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.

Metadata

Release files for khmerspell 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for khmerspell 0.1.1
File Size Uploaded Provenance Actions
khmerspell-0.1.1.tar.gz 5.9 kB Without provenance Details for khmerspell-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for khmerspell 0.1.1
File Interpreter ABI Platform Actions
khmerspell-0.1.1-py3-none-any.whl Python 3 none any Details for khmerspell-0.1.1-py3-none-any.whl

Total release size: 12.0 kB

Release files / khmerspell-0.1.1.tar.gz

Download URL khmerspell-0.1.1.tar.gz
Size 5.9 kB
Tags Source
SHA-256 checksum
How to use checksums
6cd3cc90da938264e1753b6936c0cccff5fd6cd10e03524730cb6fe7834ffaca
BLAKE2b-256 checksum
How to use checksums
24d330d78a95ea092c1d33ca196e0684061a26f370ebcd1d32e21a1f98c63561
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.2

Release files / khmerspell-0.1.1-py3-none-any.whl

Download URL khmerspell-0.1.1-py3-none-any.whl
Size 6.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
207e0304279a7e46e74f2abb45f322db2865cd262ab83698a34c80254b96dbf6
BLAKE2b-256 checksum
How to use checksums
c5c0f7f32239bf40bf50fb6e8963d798f7d54efdb4661febcdcbd6980265afa2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.2

Security for khmerspell 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page