local export = {}
local U = require("Module:string/char")
local acute = U(0x301) -- combining acute
local grave = U(0x300) -- combining grave
local tt = {
= {
-- consonants
= 'kh', = 'gh', = 'ṅ',
= 'ch', = 'jh', = 'ñ',
= 'ṭ', = 'ṭh', = 'ḍ', = 'ḍh', = 'ṇ',
= 'th', = 'dh', = 'ph', = 'bh',
= 'ḷ', = 'ś', = 'ṣ',
-- vowels
= 'ā',
= 'ī',
= 'ū',
= 'ṛ', = 'ṝ',
= 'ḷ', = 'ḹ',
= 'ai',
= 'au',
-- chandrabindu
= 'm̐', --until a better method is found
-- anusvara
= 'ṃ', --until a better method is found
-- visarga
= 'ḥ',
-- avagraha
= '’',
--Vedic extensions
= acute,
= grave,
},
= {
--Vedic extensions
= 'x',
= 'f',
},
}
function export.tr(text, lang, sc)
text = mw.ustring.gsub(text, '.', tt)
text = mw.ustring.gsub(text, '.', tt)
return mw.ustring.toNFC(text)
end
return export