Skip to main content

Transliteration tools to convert text in one indic script encoding to another

Project description

Indic transliteration tools

Build Status Documentation Status Actions Status PyPI version

For users

Installation or upgrade:

  • sudo pip install indic_transliteration -U

  • sudo pip install git+https://github.com/sanskrit-coders/indic_transliteration/@master -U

  • Web.

Usage

In [1]: from indic_transliteration import sanscript
   ...: from indic_transliteration.sanscript import SchemeMap, SCHEMES, transliterate
   ...:

In [2]: data = 'idam adbhutam'

In [3]: print(transliterate(data, sanscript.HK, sanscript.TELUGU))
ఇదమ్ అద్భుతమ్

In [4]: print(transliterate(data, sanscript.ITRANS, sanscript.DEVANAGARI))
इदम् अद्भुतम्

In [5]: scheme_map = SchemeMap(SCHEMES[sanscript.VELTHUIS], SCHEMES[sanscript.TELUGU])

In [6]: print(transliterate(data, scheme_map=scheme_map))
ఇదమ్ అద్భుతమ్

Lazy anusvaara-s

assert sanscript.SCHEMES[sanscript.ITRANS].fix_lazy_anusvaara("shaMkara") == "sha~Nkara"
assert sanscript.SCHEMES[sanscript.ITRANS].fix_lazy_anusvaara("saMchara") == "sa~nchara"
assert sanscript.SCHEMES[sanscript.ITRANS].fix_lazy_anusvaara("saMvara") == "sav.Nvara"
assert sanscript.SCHEMES[sanscript.ITRANS].fix_lazy_anusvaara("saMyukta") == "say.Nyukta"
assert sanscript.SCHEMES[sanscript.ITRANS].fix_lazy_anusvaara("saMlagna") == "sal.Nlagna"

Lazy visarga-s

assert sanscript.SCHEMES[sanscript.DEVANAGARI].fix_lazy_visarga("अन्तः पश्य") == "अन्तᳶ पश्य"
assert sanscript.SCHEMES[sanscript.DEVANAGARI].fix_lazy_visarga("अन्तः कुरु") == "अन्तᳵ कुरु"

Lay Indian search terms

assert sanscript.SCHEMES[sanscript.OPTITRANS].to_lay_indian("taM jitvA") == "tam jitva"
assert sanscript.SCHEMES[sanscript.OPTITRANS].to_lay_indian("kRShNa") == "krishna"

Dravidian language extension

In [1]: from indic_transliteration import xsanscript
   ...: from indic_transliteration.xsanscript import SchemeMap, SCHEMES, transliterate
   ...:

In [2]: data = 'असय औषधिः ग्रन्थः। ऎ ऒ यॆक्ककॊ?'

In [3]: print(transliterate(data, xsanscript.DEVANAGARI, xsanscript.KANNADA))
ಅಸಯ ಔಷಧಿಃ ಗ್ರನ್ಥಃ   ಯೆಕ್ಕಕೊ?

Font converters

converter = tech_hindi.DVTTVedicConverter()
text_in = "    +<=hÉ *1* +EòÉ®úÉä Ê´É´ÉÞiÉ ={ÉÊnù¹]õ& |ÉÉÊGòªÉÉnù¶ÉɪÉÉÆ SÉäiªÉjÉ \"+ +' (ºÉÚ.8-4-68)  "
output = converter.convert(text_in)

For contributors

Contact

Have a problem or question? Please head to github.

Packaging

  • ~/.pypirc should have your pypi login credentials.

python setup.py bdist_wheel
twine upload dist/* --skip-existing

Build documentation

  • sphinx html docs can be generated with cd docs; make html

Testing

Run pytest in the root directory.

Auxiliary tools

Project details


Release history Release notifications | RSS feed

This version

2.0.1

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

indic_transliteration-2.0.1-py3-none-any.whl (97.7 kB view details)

Uploaded Python 3

File details

Details for the file indic_transliteration-2.0.1-py3-none-any.whl.

File metadata

  • Download URL: indic_transliteration-2.0.1-py3-none-any.whl
  • Upload date:
  • Size: 97.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.8.5

File hashes

Hashes for indic_transliteration-2.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9e98365c1b053908b14e81147e571a7fe550b87d26080f96341567940b56adbf
MD5 253d912a48acd1b107fc2d2490c74f14
BLAKE2b-256 6889f0ec25257e6ac3c52e3517be49ff179df25d10ffcf2a7bd36417c7bdd5d9

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page