Module:tevo-translit: Difference between revisions

Melinoë (talk | contribs)
No edit summary
Melinoë (talk | contribs)
No edit summary
 
(15 intermediate revisions by 2 users not shown)
Line 13: Line 13:
local anud = U(0x952)
local anud = U(0x952)
local d_svar = U(0x1CDA) -- double svarita, sometimes used for long vowel with svarita
local d_svar = U(0x1CDA) -- double svarita, sometimes used for long vowel with svarita
local nuq = U(0x93C)


local consonants = {
local consonants = {
Line 92: Line 91:
-- avagraha
-- avagraha
['ऽ']='ʼ',
['ऽ']='ʼ',
['़']='',
--numerals
--numerals
['०']='0', ['१']='1', ['२']='2', ['३']='3', ['४']='4', ['५']='5', ['६']='6', ['७']='7', ['८']='8', ['९']='9',
['०']='0', ['१']='1', ['२']='2', ['३']='3', ['४']='4', ['५']='5', ['६']='6', ['७']='7', ['८']='8', ['९']='9',
Line 109: Line 109:
return nil
return nil
end
end
text = gsub(
text = gsub(text,'([क-ह]़?)'..'([ािीुूृॄॢॣेैोौ्ॅॆॊॉ]?)'..'([अ-औ]?)',function(c, d, e)
text,
'([क-ह])'..
'([ािीुूृॄॢॣेैोौ्ॅॆॊॉ]?)'..
'([अ-औ]?)',
function(c, d, e)
if d == "" and e ~= "" then         
if d == "" and e ~= "" then         
if tt[e] == "i" or tt[e] == "u" then return consonants[c] .. 'a' .. tt[e] .. diaeresis
if tt[e] == "i" or tt[e] == "u" then return consonants[c] .. 'a' .. tt[e] .. diaeresis
Line 127: Line 122:
end)
end)
text = gsub(text, "़", "")
text = gsub(text, "ज़","z")
text = gsub(text, "झ़","ź")
text = gsub(text, "ढ़","ẓ")
text = gsub(text, "ः॑","́h")
text = gsub(text, "ः॑","́h")
text = gsub(text, '([aअ][' .. acute .. grave .. ']?[इउ])', '%1' .. diaeresis)
text = gsub(text, '([aअ][' .. acute .. grave .. ']?[इउ])', '%1' .. diaeresis)
text = gsub(text, '.', tt)
text = gsub(text, '.', tt)
text = gsub(text, 'a([iu])([' .. acute .. grave .. '])', 'a%2%1')
text = gsub(text, 'a([iu])([' .. acute .. grave .. '])', 'a%2%1')
text = gsub(text, 'e([i])([' .. acute .. grave .. '])', 'e%2%1')
text = gsub(text, 'o([u])([' .. acute .. grave .. '])', 'o%2%1')
text = gsub(text, 'ē([i])([' .. acute .. grave .. '])', 'ē%2%1')
text = gsub(text, 'ō([u])([' .. acute .. grave .. '])', 'ō%2%1')
text = gsub(text, " ?[।॥]", ".")
text = gsub(text, " ?[।॥]", ".")
text = gsub(text, "(ā" .. acute .. "3[iu])" .. acute, "%1") -- for pluti vowels
text = gsub(text, "(ā" .. acute .. "3[iu])" .. acute, "%1") -- for pluti vowels