Skip to main content

Khmer Phonemizer

A Free, Standalone and Open-Source Khmer Grapheme-to-Phonemes.

[Colab]

Installation

pip install khmerphonemizer

Usage

from khmerphonemizer import phonemize

text = "នៅលើលោកនេះមិនមានមនុស្សណាម្នាក់ចេះអស់ទេ"
result = phonemize(text)

print(result)

Output

(['នៅលើ',
  'លោក',
  'នេះ',
  'មិន',
  'មាន',
  'មនុស្ស',
  'ណា',
  'ម្នាក់',
  'ចេះ',
  'អស់',
  'ទេ'],
 [['n', 'ɨ', 'w', 'l', 'əː'],
  ['l', 'oː', 'k'],
  ['n', 'i', 'h'],
  ['m', 'ɨ', 'n'],
  ['m', 'i', 'ə', 'n'],
  ['m', 'ɔ', 'n', 'u', 'h'],
  ['n', 'aː'],
  ['m', 'n', 'ĕ', 'ə', 'ʔ'],
  ['c', 'e', 'h'],
  ['ʔ', 'ɑ', 'h'],
  ['t', 'eː']])

Check out the examples/ for more examples.

API

  • phonemize Tokenize input text into words and phonemize each word and returns a tuple with tokens and phonemes.

    • input_str: str Text with multiple words.
    • beam: int = 500 number of beam search.
    • min_beam: int = 100: minimum number of beam search.
    • beam_score: float = 0.6 beam search score.
    • use_lexicon: bool = True Use lexicon dictionary for known words.
  • phonemize_single Phonemize a single word.

    • word: str Text with single Khmer or English word only.
    • beam: int = 500 number of beam search.
    • min_beam: int = 100: minimum number of beam search.
    • beam_score: float = 0.6 beam search score.
    • use_lexicon: bool = True Use lexicon dictionary for known words.

License

MIT


References

Without these awesome projects from awesome people, this wouldn't be possible.

Related

Metadata

Release files for khmerphonemizer 0.0.3

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

Source distribution (sdist)

Source distribution for khmerphonemizer 0.0.3
File Size Uploaded
khmerphonemizer-0.0.3.tar.gz 11.1 MB Details

Built distribution (wheel)

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

Total release size: 22.2 MB

Release files / khmerphonemizer-0.0.3.tar.gz

Download URL khmerphonemizer-0.0.3.tar.gz
Size 11.1 MB
Tags Source
SHA-256 checksum
How to use checksums
0b0a5b1ec4e7d78986dde7960085ca0101c4830c945bb6bece6807dea1d6a9e9
BLAKE2b-256 checksum
How to use checksums
be006a46e4e0a9ceca4aa8701f8fdf97f1d35a18a14b5e76b557150c832fa3b8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.8.1

Release files / khmerphonemizer-0.0.3-py3-none-any.whl

Download URL khmerphonemizer-0.0.3-py3-none-any.whl
Size 11.2 MB
Tags Python 3
SHA-256 checksum
How to use checksums
82441879e01c9d52671f806725b0ba53770bfaef9e7352df44d3efc01eda3588
BLAKE2b-256 checksum
How to use checksums
178cab921d5733033871952c569f33f80b366190ce4ced158240ac91c8fc6abe
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.8.1

Release history Release notifications | RSS feed

This release

0.0.3 This release

2 release files

0.0.2

2 release files

0.0.1

2 release files

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