Khmer Phonemizer
A Free, Standalone and Open-Source Khmer Grapheme-to-Phonemes.
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
-
phonemizeTokenize input text into words and phonemize each word and returns a tuple with tokens and phonemes.input_str: strText with multiple words.beam: int = 500number of beam search.min_beam: int = 100: minimum number of beam search.beam_score: float = 0.6beam search score.use_lexicon: bool = TrueUse lexicon dictionary for known words.
-
phonemize_singlePhonemize a single word.word: strText with single Khmer or English word only.beam: int = 500number of beam search.min_beam: int = 100: minimum number of beam search.beam_score: float = 0.6beam search score.use_lexicon: bool = TrueUse lexicon dictionary for known words.
License
MIT
References
Without these awesome projects from awesome people, this wouldn't be possible.
- Khmer Word Search: Challenges, Solutions, and Semantic-Aware Search (Rina Buoy and Nguonly Taing and Sovisal Chenda)
- CUNY-CL/wikipron (Kyle Gorman, Jackson Lee, and contributors, 2019)
- rhasspy/gruut (Michael Hansen et al., 2020)
- OpenFst (Kyle Gorman et al.)
- AdolfVonKleist/Phonetisaurus (Josef Novak et al., 2017)
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)
| File | Size | Uploaded | |
|---|---|---|---|
| khmerphonemizer-0.0.3.tar.gz | 11.1 MB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| 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
|