Skip to main content

A missing toolkit for Khmer Natural Language Processing.

Project description

Khmer Normalizer

A missing toolkit for Khmer Natural Language Processing.

  • Character Reordering
  • Duplicate Whitespaces
  • Remove zero width space
  • Remove emojis
  • Fix Common misspellings
  • Fix Unicode issues
  • Fix Khmer trailing vowels
  • URL Replacements
  • Unicode Normalization (NFKC)
  • Quotes symbols normalization
  • Remove repeated punctuations

Installation

pip install khmernormalizer

Usage

from khmernormalizer import normalize

input_str = """
តាម៖៖​សេចក្តី​រាយ​ការណ៍​​ឲ្យ​ដឹង​ថា!!!!!
https://google.com/a?x=1
កាល 😂 ពីវេលាម៉ោង    ៗ      ប្រមាណ១១យប់ថ្ងៃទី៤ 😂😂😂😂😂 ??
កាាាាត់
មិិិិិន 
មួយរយះះះះះះះ
រយះពេល
""".strip()

normalize(input_str, 
          emoji_replacement="", 
          remove_zwsp=True, 
          url_replacement="")

Result:

តាម៖សេចក្តីរាយការណ៍ឱ្យដឹងថា!

កាល ពីវេលាម៉ោងៗ ប្រមាណ១១យប់ថ្ងៃទី៤?
កាត់
មិន 
មួយរយៈ
រយៈពេល

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

khmernormalizer-0.0.4.tar.gz (10.0 kB view hashes)

Uploaded Source

Built Distribution

khmernormalizer-0.0.4-py3-none-any.whl (9.9 kB view hashes)

Uploaded Python 3

Supported by

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