Module:pine-translit: Difference between revisions
Jump to navigation
Jump to search
(Created page with "local export = {} local tt = {} -- from Teulgi to Tuġvut font tt["Latn"] = { ["-t"] = '_0', ["-"] = '_', -- Synthetic diphthongs ["uo"]='aa-', ["ay"]='aa--', -- Short vowels ["o"]='u-', ["e"]='i-', ["y"]='a-', ["ů"]='u--', -- Geminate vowels ["ả"]='aa', ["ủ"]='uu', ["ỏ"]='u-u-', ["ỉ"]='ii', ["ẻ"]='i-i-', ["ỷ"]='a-a-', -- m-series ["bm"]='pm', ["ṃṃ"]='m-m', ["ṃ"]='m-', -- n-series ["ng"]='N-', ["dn"]='t-n', ["tṇ"]='t-n-',...") |
No edit summary |
||
| Line 66: | Line 66: | ||
function export.tr(text, lang, sc) | function export.tr(text, lang, sc) | ||
text = mw.ustring.lower(text) | |||
for pat, repl in pairs(tt[sc]) do | |||
text = mw.ustring.gsub(text, pat, repl) | |||
end | |||
return text | |||
end | end | ||
return export | return export | ||
Revision as of 13:57, 21 November 2025
- The following documentation is located at Module:pine-translit/doc.[edit]
- Useful links: subpage list • links • transclusions • testcases • sandbox
local export = {}
local tt = {}
-- from Teulgi to Tuġvut font
tt["Latn"] = {
["-t"] = '_0', ["-"] = '_',
-- Synthetic diphthongs
["uo"]='aa-', ["ay"]='aa--',
-- Short vowels
["o"]='u-', ["e"]='i-',
["y"]='a-', ["ů"]='u--',
-- Geminate vowels
["ả"]='aa', ["ủ"]='uu',
["ỏ"]='u-u-', ["ỉ"]='ii',
["ẻ"]='i-i-', ["ỷ"]='a-a-',
-- m-series
["bm"]='pm', ["ṃṃ"]='m-m', ["ṃ"]='m-',
-- n-series
["ng"]='N-', ["dn"]='t-n', ["tṇ"]='t-n-',
["nnį"]='n--', ["ṇṇį"]='N',
["nį"]='n--', ["ṇį"]='N',
["ṇṇ"]='n-n',
-- v-series
["v"]='f', -- synthetic <p> has to be manual
-- p-series
["bb"]='p-p', ["b"]='p-',
-- t-series
["ḍḍ"]='t--t', ["dd"]='t-t',
["ḍ"]='t--', ["d"]='t-',
-- ġ-series
["ḥḥ"]='h--h', ["ġġ"]='g-g',
["ḥ"]='h--', ["ġ"]='g-',
["ġf"]='hf',
["tġv"]='hf--', ["tġ"]='hf-',
-- h-series
["hhį"]='h-h', ["hį"]='h-',
-- s-series
["ttṡ"]='c--c', ["tts"]='c-c',
["tṡ"]='c--', ["ts"]='c-',
["ṡ"]='c',
-- r-series
["ṛṛ"]='r-r', ["ṛ"]='r-',
-- l-series
["ḷḷį"]='L--L', ["llį"]='L-L',
["ḷį"]='L--', ["lį"]='L-',
["ḷ"]='L', ["ƛ"]='T',
-- į-series
["į"]='j',
};
function export.tr(text, lang, sc)
text = mw.ustring.lower(text)
for pat, repl in pairs(tt[sc]) do
text = mw.ustring.gsub(text, pat, repl)
end
return text
end
return export