A comprehensive transliteration scheme for Indian languages
Project description
IITHLP
A comprehensive transliteration scheme for Indian languages with a strict one-to-one character mapping.
Overview
IITHLP is a Python package that provides a comprehensive transliteration scheme for 9 major Indian scripts covering 21 scheduled Indian languages. It ensures a strict one-to-one mapping between each Indic character and a single Roman character (with diacritics as needed), ensuring perfect reversibility while maintaining phonetic similarity.
Supported Scripts
The package supports the following 9 scripts:
- Devanagari (Hindi, Marathi, Sanskrit, Nepali, Konkani, Bodo, Maithili, Dogri)
- Bengali (Bengali, Assamese)
- Tamil
- Malayalam
- Telugu
- Kannada
- Gurmukhi (Punjabi)
- Gujarati
- Odia
Note: Urdu is currently not supported in this version.
Features
- Strict one-to-one mapping: Each Indic character maps to exactly one Roman character (with diacritics as needed)
- Perfect reversibility: Guaranteed round-trip conversion without information loss
- Script detection: Automatically detects the script of input text
- Comprehensive coverage: Supports all characters, including vowels, consonants, matras, and special symbols
- Easy to use: Simple API for both script-to-Roman and Roman-to-script conversion
Installation
# You can install directly from the provided Python file
pip install iithlp
Usage
Basic Usage
from iithlp import to_roman, to_script
# Transliterate from an Indian script to Roman
roman_text = to_roman("नमस्ते दुनिया") # Devanagari
print(roman_text) # "nmsⁿté dúníyā́"
# Transliterate from Roman to an Indian script
devanagari_text = to_script("nmsⁿté dúníyā́", script="devanagari")
print(devanagari_text) # "नमस्ते दुनिया"
Script Detection
from iithlp import IITHLP
# Create a transliterator instance
transliterator = IITHLP()
# Detect script of text
text = "ಕನ್ನಡ"
detected_script = transliterator.detect_script(text)
print(detected_script) # 'kannada'
Getting Supported Scripts
from iithlp import get_supported_scripts
# Get all supported scripts
scripts = get_supported_scripts()
print(scripts) # ['devanagari', 'bengali', 'tamil', ...]
Mapping Scheme
The mapping scheme follows these principles:
- Phonetic similarity: Similar sounds have similar representations
- Diacritics for disambiguation: Diacritics are used to distinguish between similar sounds
- Consistency: Similar patterns across scripts are represented consistently
- Reversibility: The scheme ensures perfect round-trip conversion
Example Mappings
Vowels (Independent Form)
| Roman | Devanagari | Bengali | Tamil | Malayalam | Telugu | Kannada | Gurmukhi | Gujarati | Odia |
|---|---|---|---|---|---|---|---|---|---|
| a | अ | অ | அ | അ | అ | ಅ | ਅ | અ | ଅ |
| ā | आ | আ | ஆ | ആ | ఆ | ಆ | ਆ | આ | ଆ |
| i | इ | ই | இ | ഇ | ఇ | ಇ | ਇ | ઇ | ଇ |
| ī | ई | ঈ | ஈ | ഈ | ఈ | ಈ | ਈ | ઈ | ଈ |
| u | उ | উ | உ | ഉ | ఉ | ಉ | ਉ | ઉ | ଉ |
| ū | ऊ | ঊ | ஊ | ഊ | ఊ | ಊ | ਊ | ઊ | ଊ |
| e | ए | এ | எ | എ | ఎ | ಎ | ਏ | એ | ଏ |
| ê | ऐ | ঐ | ஐ | ഐ | ఐ | ಐ | ਐ | ઐ | ଐ |
| o | ओ | ও | ஒ | ഒ | ఒ | ಒ | ਓ | ઓ | ଓ |
| ô | औ | ঔ | ஔ | ഔ | ఔ | ಔ | ਔ | ઔ | ଔ |
Consonants (Sample)
| Roman | Devanagari | Bengali | Tamil | Malayalam | Telugu | Kannada | Gurmukhi | Gujarati | Odia |
|---|---|---|---|---|---|---|---|---|---|
| k | क | ক | க | ക | క | ಕ | ਕ | ક | କ |
| g | ग | গ | - | ഗ | గ | ಗ | ਗ | ગ | ଗ |
| c | च | চ | ச | ച | చ | ಚ | ਚ | ચ | ଚ |
| j | ज | জ | ஜ | ജ | జ | ಜ | ਜ | જ | ଜ |
| ṭ | ट | ট | ட | ട | ట | ಟ | ਟ | ટ | ଟ |
| t | त | ত | த | ത | త | ತ | ਤ | ત | ତ |
| p | प | প | ப | പ | ప | ಪ | ਪ | પ | ପ |
| m | म | ম | ம | മ | మ | ಮ | ਮ | મ | ମ |
| y | य | য | ய | യ | య | ಯ | ਯ | ય | ଯ |
| l | ल | ল | ல | ല | ల | ಲ | ਲ | લ | ଲ |
License
MIT License
Acknowledgements
This package is an extension of the original IITHLP package, with comprehensive support for 9 major Indian scripts and a strict one-to-one mapping scheme.
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 Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file iithlp-0.2.0.tar.gz.
File metadata
- Download URL: iithlp-0.2.0.tar.gz
- Upload date:
- Size: 12.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b83980f94b61fcea56904c1bf9f53677233b7d49517e73fadfe780dc8d8a13e7
|
|
| MD5 |
51e27a3a6a7dd3a52fe624edec83ff9b
|
|
| BLAKE2b-256 |
dd65ec9f21ad472c05c9907ce801197dcbd6af4fb4fcde1094463cbf9fc53a8d
|
File details
Details for the file iithlp-0.2.0-py3-none-any.whl.
File metadata
- Download URL: iithlp-0.2.0-py3-none-any.whl
- Upload date:
- Size: 12.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
162644cf73494f149c1f3698705740606cfcf22e8af46180187cd78d846f68c5
|
|
| MD5 |
cd39c53a9c5876440a62f9f9a3ef6afd
|
|
| BLAKE2b-256 |
bd66ffdd636142ecc5414d4f286ccf19d8346b4659a8e062eeddc1fa900f8a24
|