Skip to content

Instantly share code, notes, and snippets.

Created July 18, 2023 14:25
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
# For more information on this transliteration scheme, please go to
import re
consonants = {'க்க':'kk','ச்ச':'cc','ட்ட':'ṭṭ','த்த':'tt','ப்ப':'pp',
'ஜ':'j','ஶ':'s','ஷ':'sh', 'ஸ':'s','ஹ':'h'}
vowels1 = {'ா':'aa','ி':'i','ீ':'ii','ு':'u','ூ':'uu','ெ':'e','ே':'ee','ை':'ai','ொ':'o','ோ':'oo','ௌ':'au','்':'','':'a',}
vowels2 = {'அ':'a','ஆ':'aa','இ':'i','ஈ':'ii','உ':'u','ஊ':'uu',
def transliterate(str):
for c1, c2 in consonants.items():
for v1, v2 in vowels1.items():
str = re.sub(c1+v1, c2+v2, str)
for v1, v2 in vowels2.items():
str = re.sub(v1, v2, str)
return str
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment