local export = {}
local consonants = {
='க', ='க', ='ங', ='ச', ='ஞ', ='ட', ='ட', ='ட', ='ண',
='த', ='த', ='ந', ='ப', ='ப', ='ம', ='ய', ='ர' , ='ல' , ='வ' ,
='ழ' , ='ள' , ='ற' , ='ன' , ='ஶ' , ='ஜ' , ='ஷ' ,
='ஸ' , ='ஹ' , ='ஃப' , ='ஃஜ' , ='ஃஸ' ,
}
local diacritics = {
= 'ை', = 'ௌ',
= '' ,
= 'ா' , ='ி' , ='ீ' , ='ு' , ='ூ' , ='ெ' ,
='ே' , ='ொ' , ='ோ' ,
}
local nonconsonants = {
='ஔ' , ='ஐ' ,
='அ' , ='௦' , ='ஆ' , ='இ' , ='ஈ' , ='உ' , ='ஊ' ,
='எ' , ='ஏ' , ='ஒ' , ='ஓ' , ='ஃ' ,
='௧' , ='௨' , ='௩' , ='௪' , ='௫' , ='௬' , ='௭' , ='௮' , ='௯' ,
}
-- translit any words or phrases
function export.tr(text, lang, sc)
text = mw.ustring.gsub(
text,
'()'..
'(a?)',
function(c, d)
if d ~= "" then
return consonants .. diacritics
end
end)
text = mw.ustring.gsub(
text,
'()'..
'(?)',
function(c, d)
if d ~= "" then
return consonants .. diacritics
else
return consonants .. '்'
end
end)
text = mw.ustring.gsub(text,'(a?)', function(a)
if a ~= "" then
return nonconsonants
end
end)
text = mw.ustring.gsub(text, '.', nonconsonants)
return text
end
return export