Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/seanghay/khmer-latin-name-transformer
Transform Khmer Personal Name into Latin and vice-versa.
https://github.com/seanghay/khmer-latin-name-transformer
cambodia khmer pynini
Last synced: 2 days ago
JSON representation
Transform Khmer Personal Name into Latin and vice-versa.
- Host: GitHub
- URL: https://github.com/seanghay/khmer-latin-name-transformer
- Owner: seanghay
- License: apache-2.0
- Created: 2023-09-08T07:04:13.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2023-10-17T11:54:16.000Z (about 1 year ago)
- Last Synced: 2024-02-24T04:33:03.161Z (9 months ago)
- Topics: cambodia, khmer, pynini
- Language: Python
- Homepage: https://pypi.org/project/khmer-latin-name-transformer
- Size: 2.99 MB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-khmer-language - khmer-latin-name-transformer
README
# Khmer Latin Name Transformer
Transform **Khmer Personal Name** into Latin and vice-versa.
[[Google Colab]](https://colab.research.google.com/drive/17r-9ubY_oGWfQMaaH2xFPPS8DKe1fsvi?usp=sharing)
**Important!**
Make sure you have `pynini` installed on your current environment before install this library. To install `pynini`, use this
```shell
conda install -c conda-forge pynini
```Install khmer_latin_name_transformer from PyPI
```shell
pip install khmer-latin-name-transformer
```## Usage
```python
from khmer_latin_name_transformer import (
to_khmer,
to_khmer_pronounce,
to_latin
)to_khmer("DARA VISAL")
# => "តារា វិសាល"to_khmer("linda sokha")
# => "លីនដា សុខា"to_latin("តារា វិសាល")
# => "DARA VISAL"to_khmer_pronounce("ភក្ត្រា")
# => ភ័ក-ត្រាto_khmer_pronounce("និន្ទ្រា")
# => និន-ទ្រា
```## Docker CLI
Let's say you have a file like below called `sample.txt` and separated by new line
```
សុខ លីណា
គឹម សុខា
ជា សីហា
```To convert them to latin forms, run
```shell
docker run -it --rm -v "$PWD/sample.txt:/app/sample.txt" \
ghcr.io/seanghay/khmer-latin-name-transformer sample.txt -t latin > output.txt
````output.txt` will be
```
SOK LINA
KIM SOKHA
CHEA SYHA
```### Command-line Info
```
usage: transform.py [-h] -t {khmer,latin,pro} [-j JOB] files [files ...]Transform Text to Text
positional arguments:
files Path to input fileoptional arguments:
-h, --help show this help message and exit
-t {khmer,latin,pro}, --to {khmer,latin,pro}
-j JOB, --job JOB Number of processors
```---
## License
`Apache 2.0`