Giter Site home page Giter Site logo

seanghay / khmer-latin-name-transformer Goto Github PK

View Code? Open in Web Editor NEW
3.0 1.0 0.0 3.06 MB

Transform Khmer Personal Name into Latin and vice-versa.

Home Page: https://pypi.org/project/khmer-latin-name-transformer

License: Apache License 2.0

Python 95.00% Dockerfile 5.00%
cambodia khmer pynini

khmer-latin-name-transformer's Introduction

Khmer Latin Name Transformer

Transform Khmer Personal Name into Latin and vice-versa.

[Google Colab]

Important!

Make sure you have pynini installed on your current environment before install this library. To install pynini, use this

conda install -c conda-forge pynini

Install khmer_latin_name_transformer from PyPI

pip install khmer-latin-name-transformer

Usage

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

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 file

optional 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

khmer-latin-name-transformer's People

Contributors

seanghay avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.