Text transliteration from English to Indian languages – Using indic-transliteration
Transliteration is the process of transferring a word from the alphabet of one language to another. Transliteration helps people pronounce words and names in foreign languages. It is also useful for non-Latin script language speakers to use in their own language, as typing in Latin is more convenient.
Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.
To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course. And to begin with your Machine Learning Journey, join the Machine Learning - Basic Level Course
Input : namaskaara Output : Transliterating from English(Latin) to Hindi(Devanagari) Input : namaskaara Output : Transliterating from English(Latin) to Telugu(Telugu)
To implement transliteration of Latin to Indian scripts we will use the
pip install indic-transliteration
We will use the
transliterate() method of the
sanscript class of the
Syntax : transliterate(text, romanization_style, script)
test : The text totransliterated
romanization_style : The following romanization styles are available :
- HK = ‘hk’
- IAST = ‘iast’
- ITRANS = ‘itrans’
- OPTITRANS = ‘optitrans’
- KOLKATA = ‘kolkata’
- SLP1 = ‘slp1’
- VELTHUIS = ‘velthuis’
- WX = ‘wx’
script : The script to be transliterated into. The following scripts are available :
- Gurmukhi/ Punjabi/ Panjabi
Returns : A string of the transliterated text.
Example 1:Transliterating from Latin to Devanagari.
Example 2:Transliterating from Latin to Gujarati.