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

For users

  • Docs.

  • For detailed examples and help, please see individual module files in this package.

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))
ఇదమ్ అద్భుతమ్

Optitrans extension

Optitransv1 is described in this page. OPTITRANS, while staying close to ITRANS it provides a more intuitive transliteration compared to ITRANS (shankara manju - शङ्कर मञ्जु).

assert sanscript.optitrans_to_itrans("shankara") == "sha~Nkara"
assert sanscript.itrans_to_optitrans("sha~Nkara") == "shankara"

See sanscript_pytest_test.py for more examples.

Lazy anusvaara-s

assert sanscript.fix_lazy_anusvaara_itrans("shaMkara") == "sha~Nkara"
assert sanscript.fix_lazy_anusvaara_itrans("saMchara") == "sa~nchara"
assert sanscript.fix_lazy_anusvaara_itrans("saMvara") == "sav.Nvara"
assert sanscript.fix_lazy_anusvaara_itrans("saMyukta") == "say.Nyukta"
assert sanscript.fix_lazy_anusvaara_itrans("saMlagna") == "sal.Nlagna"

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))
ಅಸಯ ಔಷಧಿಃ ಗ್ರನ್ಥಃ   ಯೆಕ್ಕಕೊ?

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

Testing

Run pytest in the root directory.

Auxiliary tools

Project details


Release history Release notifications | RSS feed

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

If you're not sure about the file name format, learn more about wheel file names.

indic_transliteration-1.6.7-py2.py3-none-any.whl (42.1 kB view details)

Uploaded Python 2Python 3

File details

Details for the file indic_transliteration-1.6.7-py2.py3-none-any.whl.

File metadata

  • Download URL: indic_transliteration-1.6.7-py2.py3-none-any.whl
  • Upload date:
  • Size: 42.1 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.7.0

File hashes

Hashes for indic_transliteration-1.6.7-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 0c285aec91d00077a2d85be2f7dc725fb2ea5a469a670e3811fbd78ca3bdb71d
MD5 549a59c83d2cafb9e31fd097b3f86812
BLAKE2b-256 a4f4b74a4af1e034bbf3cd12402d65d90609563a6e51f63ff97c6dd90e66346c

See more details on using hashes here.

Supported by

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