This is a private module sandbox of DerekWinters, for their own experimentation. Items in this module may be added and removed at DerekWinters's discretion; do not rely on this module's stability.
local export = {}
local consonants = {
--consonants
='ᜣ', ='ᜤ', ='ᜥ',
='ᜦ', ='ᜧ', ='ᜨ',
='ᜩ', ='ᜪ', ='ᜫ',
='ᜬ', ='ᜮ', ='ᜭ',
='ᜯ', ='ᜰ', ='ᜱ',
}
local diacritics = {
--vowels
='', ='ᜲ', ='ᜲ', ='ᜳ', ='ᜳ',
}
local tt = {
--vowels
='ᜠ', ='ᜡ', ='ᜡ', ='ᜢ', ='ᜢ',
}
function export.tr(text, lang, sc)
if sc ~= "Latn" then
return nil
end
text = mw.ustring.gsub(text, 'ng', 'ŋ')
text = mw.ustring.gsub(
text,
'()'..
'(?)',
function(c, d)
if d == "" then
return consonants .. '᜴'
else
return consonants .. diacritics
end
end)
text = mw.ustring.gsub(text, '.', tt)
return text
end
return export