Skip to content

ltrc/python-irtrans

Folders and files

NameName
Last commit message
Last commit date

Latest commit

┬а

History

12 Commits
┬а
┬а
┬а
┬а
┬а
┬а
┬а
┬а
┬а
┬а
┬а
┬а

Repository files navigation

python-irtrans

Indic-to-Roman and Roman-to-Indic transliterator.

Installation

Dependencies

python-irtrans requires cython, SciPy and indic-wx-converter.

To install the dependencies do something like (Ubuntu):

pip install cython
pip install python-scipy
pip install git+git://github.com/irshadbhat/indic-wx-converter.git

Download

Download python-irtrans from github.

Install

pip install git+git://github.com/irshadbhat/python-irtrans.git

Examples

1. Work with Files:

irtrans --h

--v           show program's version number and exit
--s source    select language (3 letter ISO-639 code) [hin|tel|guj|eng]
--t target    select language (3 letter ISO-639 code) [hin|tel|guj|eng]
--i input     <input-file>
--f format    select output format [text|ssf|conll|bio|tnt]
--p ssf-type  specify ssf-type [inter|intra] in case file format (--f) is
              ssf
--n           set this flag for nested ssf
--o output    <output-file>

Example ::

    irtrans < tests/hindi.txt --s hin --t eng > tests/hindi-rom.txt
    irtrans < tests/roman.txt --s hin --t eng > tests/roman-hin.txt

2. Using Python:

a. Text:
>>> from irtrans import transliterator
>>> trn = transliterator(source='hin', target='eng')
>>>
>>> text = """рдЖрдЬрд╛ рд╕рдирдо рдордзреБрд░ рдЪрд╛рдВрджрдиреА рдореЗрдВ рд╣рдо-рддреБрдо рдорд┐рд▓реЗ
... рддреЛ рд╡реАрд░рд╛рдиреЗ рдореЗрдВ рднреА рдЖ рдЬрд╛рдПрдЧреА рдмрд╣рд╛рд░
... рдЭреБрдордиреЗ рд▓рдЧреЗрдЧрд╛ рдЖрд╕рдорд╛рди
... рдХрд╣рддрд╛ рд╣реИ рджрд┐рд▓ рдФрд░ рдордЪрд▓рддрд╛ рд╣реИ рджрд┐рд▓
... рдореЛрд░реЗ рд╕рд╛рдЬрди рд▓реЗ рдЪрд▓ рдореБрдЭреЗ рддрд╛рд░реЛрдВ рдХреЗ рдкрд╛рд░
... рд▓рдЧрддрд╛ рдирд╣реАрдВ рд╣реИ рджрд┐рд▓ рдпрд╣рд╛рдБ
...
... рднреАрдЧреА-рднреАрдЧреА рд░рд╛рдд рдореЗрдВ, рджрд┐рд▓ рдХрд╛ рджрд╛рдорди рдерд╛рдо рд▓реЗ
... рдЦреЛрдпреА рдЦреЛрдпреА рдЬрд╝рд┐рдиреНрджрдЧреА, рд╣рд░ рджрдо рддреЗрд░рд╛ рдирд╛рдо рд▓реЗ
... рдЪрд╛рдБрдж рдХреА рдмрд╣рдХреА рдиреЫрд░, рдХрд╣ рд░рд╣реА рд╣реИ рдкреНрдпрд╛рд░ рдХрд░
... рдЬрд╝рд┐рдиреНрджрдЧреА рд╣реИ рдПрдХ рд╕рдлрд╝рд░, рдХреМрди рдЬрд╛рдиреЗ рдХрд▓ рдХрд┐рдзрд░
... рдЖрдЬрд╛ рд╕рдирдо рдордзреБрд░ рдЪрд╛рдВрджрдиреА...
...
... рджрд┐рд▓ рдпреЗ рдЪрд╛рд╣реЗ рдЖрдЬ рддреЛ, рдмрд╛рджрд▓ рдмрди рдЙреЬ рдЬрд╛рдКрдВ рдореИрдВ
... рджреБрд▓реНрд╣рди рдЬреИрд╕рд╛ рдЖрд╕рдорд╛рдВ, рдзрд░рддреА рдкрд░ рд▓реЗ рдЖрдКрдБ рдореИрдВ
... рдЪрд╛рдБрдж рдХрд╛ рдбреЛрд▓рд╛ рд╕рдЬреЗ, рдзреВрдо рддрд╛рд░реЛрдВ рдореЗрдВ рдордЪреЗ
... рдЭреВрдо рдХреЗ рджреБрдирд┐рдпрд╛ рдХрд╣реЗ, рдкреНрдпрд╛рд░ рдореЗрдВ рджреЛ рджрд┐рд▓ рдорд┐рд▓
... рдЖрдЬрд╛ рд╕рдирдо рдордзреБрд░ рдЪрд╛рдВрджрдиреА..."""
>>>
>>> print trn.transform(text)
aaja sanam madhur chaandani men hum-tum mile
to viraane men bhi a jaaegi bahaar
jhumne lagega aasmaan
kahata he dil or machalata he dil
more saajan le chal mujhe taaron ke paar
lagta naheen he dil yahan

bheegi-bheegi raat men, dil ka daman tham le
khoyi khoyi zindagi, har dam tera nam le
chaand ki baheki nazar, kaha rahi he pyar kar
zindagi he ek safar, kaun jaane kal kidar
aaja sanam madhur chaandani...

dil ye chaahe aaj to, badal ban ud jaaun mein
dulhan jaisa aasmaan, dhrati par le aaun mein
chaand ka dola saje, dhum taaron men mache
jhum ke duniya kahe, pyar men do dil mill
aaja sanam madhur chaandani...
>>>

About

Indic to Roman and Roman to Indic Transliterator

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages