GithubHelp home page GithubHelp logo

hpbyte / myanmar_number_to_words Goto Github PK

View Code? Open in Web Editor NEW
5.0 1.0 2.0 8 KB

for converting Myanmar numbers into words

Python 100.00%
python nlp myanmar-language burmese-nlp myanmar-text number-to-words

myanmar_number_to_words's Introduction

Myanmar Number to Words

Basically, this is a simple python script for converting Myanmar numbers into Myanmar spoken words.

It is expected to be able to detect and convert the following types:

  • Dates (DD-MM-YYYY or DD/MM/YYYY)
  • Time (H:mm)
  • Digit Number
  • Decimal Number
  • Range
  • Fraction
  • Amount

This is an essential part in the preprocessing stage of the Myanmar Text-to-Speech Project in which the numbers in the text dataset needs to be converted into spoken words.

Examples

# Amount
၁၀၇         =>  တစ်ရာ့ ခုနှစ်
၁၂၀         =>  တစ်ရာ့ နှစ်ဆယ်
၃၂၁         =>  သုံ:ရာ နှစ်ဆယ့် တစ်
၃၂၅၉၇၀၀၀၃၀  =>  သုံ:သောင်: နှစ်ထောင့် ငါ:ရာ ကို:ဆယ့် ခုနှစ်သိန်: သုံ:ဆယ်
၅၀,၀၅၁,၂၃၀  =>  သိန်: ငါ:ရာ ငါ:သောင်: တစ်ထောင့် နှစ်ရာ့ သုံ:ဆယ်


# Phone Number
၀၁၅၂၈၈၂၃    =>  သုည တစ် ငါ: နှစ် ရှစ် ရှစ် နှစ် သုံ:


# Date
၁၅-၁၂-၂၀၁၉  =>  နှစ်ထောင့် ဆယ့် ကို: ခုနှစ် ဆယ့် နှစ် လပိုင်: ဆယ့် ငါ: ရက်


# Time
၃:၂၅        =>  သုံ: နာရီ နှစ်ဆယ့် ငါ: မိနစ်
၄:၃၀        =>  လေ: နာရီ ခွဲ


# Decimal
၃၂.၄၂၈      =>  သုံ:ဆယ့် နှစ် ဒဿမ လေ: နှစ် ရှစ်

Usage

Clone or download this repository

git clone https://github.com/hpbyte/Myanmar_Number_to_Words.git

You will see two files under the cloned directory

Myanmar_Number_to_Words
  | mm_num2word.py
  | convert.py

mm_num2word.py contains all the logics needed (from extracting numbers from a string to detecting and converting).

convert.py is the tool that is able to take an input file, transform the numbers from the file into words accordingly and then output the result file.

python3 convert.py --input path/to/your/input.txt --output path/for/output.txt 

myanmar_number_to_words's People

Contributors

hpbyte avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

vpnry fanfanbmo

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.