Module:pine-translit: Difference between revisions

Jump to navigation Jump to search
no edit summary
No edit summary
No edit summary
 
(4 intermediate revisions by the same user not shown)
Line 4: Line 4:


-- from Teulgi to Tuġvut font
-- from Teulgi to Tuġvut font
tt["Latn"] = {
tt = {
["-t"] = '_0', ["-"] = '_',
    { "%-", "_" }, { "_t", "_0" },
-- Synthetic diphthongs
-- Voicelessness in consonant clusters
["uo"]='aa-', ["ay"]='aa--',
{ "m(p[^p])", "ṃ%1" }, { "n([ktƛ][^ktƛ])", "ṇ%1" },
{ "r([tkpƛġ][^tkpƛġ])", "ṛ%1" },
{ "l([ptkġ][^ptkġ])", "ḷ%1" },
-- Short vowels
    -- Synthetic diphthongs
["o"]='u-', ["e"]='i-',
    { "uo", "aa-" }, { "ay", "aa--" },
["y"]='a-', ["ů"]='u--',
 
    -- Short vowels
-- Geminate vowels
    { "o", "u-" }, { "e", "i-" },
["ả"]='aa', ["ủ"]='uu',
    { "y", "a-" }, { "ů", "u--" },
["ỏ"]='u-u-', ["ỉ"]='ii',
 
["ẻ"]='i-i-', ["ỷ"]='a-a-',
    -- Geminate vowels
    { "ả", "aa" }, { "ủ", "uu" },
-- m-series
    { "ỏ", "u-u-" }, { "ỉ", "ii" },
["bm"]='pm', ["ṃṃ"]='m-m', ["ṃ"]='m-',  
    { "ẻ", "i-i-" }, { "ỷ", "a-a-" },
 
-- n-series
    -- m-series
["ng"]='N-', ["dn"]='t-n', ["tṇ"]='t-n-',
    { "bm", "pm" }, { "ṃṃ", "m-m" }, { "ṃ", "m-" },
["nnį"]='n--', ["ṇṇį"]='N',
 
["nį"]='n--', ["ṇį"]='N',
    -- n-series
["ṇṇ"]='n-n',
    { "ng", "N-" }, { "dn", "t-n" }, { "tṇ", "t-n-" },
    { "nnį", "n--" }, { "ṇṇį", "N" },
-- v-series
    { "nį", "n--" }, { "ṇį", "N" },
["v"]='f', -- synthetic <p> has to be manual
    { "ṇṇ", "n-n" }, { "", "n-" },
 
-- p-series
    -- p-series
["bb"]='p-p', ["b"]='p-',
    { "bb", "p-p" }, { "b", "p-" },
 
-- t-series
    -- t-series
["ḍḍ"]='t--t', ["dd"]='t-t',
    { "ḍḍ", "t--t" }, { "dd", "t-t" },
["ḍ"]='t--', ["d"]='t-',
    { "ḍv", "tf--" }, { "dv", "tf-" },
    { "ḍ", "t--" }, { "d", "t-" },
-- ġ-series
 
["ḥḥ"]='h--h', ["ġġ"]='g-g',
    -- ġ-series
["ḥ"]='h--', ["ġ"]='g-',
    { "ḥḥ", "h--h" }, { "ġġ", "g-g" },
["ġf"]='hf',
    { "ḥ", "h--" },  
["tġv"]='hf--', [""]='hf-',
    { "tġv", "hf--" }, { "tġ", "hf-" },
    { "ġv", "hf" }, { "ġ", "g-" },
-- h-series
 
["hhį"]='h-h', ["hį"]='h-',
    -- h-series
    { "hhį", "h-h" }, { "hį", "h-" },
-- s-series
 
["ttṡ"]='c--c', ["tts"]='c-c',
    -- s-series
["tṡ"]='c--', ["ts"]='c-',
    { "ttṡ", "c--c" }, { "tts", "c-c" },
["ṡ"]='c',
    { "tṡ", "c--" }, { "ts", "c-" },
    { "ṡ", "c" },
-- r-series
 
["ṛṛ"]='r-r', ["ṛ"]='r-',
    -- r-series
    { "ṛṛ", "r-r" }, { "ṛ", "r-" },
-- l-series
 
    -- l-series
["ḷḷį"]='L--L', ["llį"]='L-L',
    { "ḷḷį", "L--L" }, { "llį", "L-L" },
["ḷį"]='L--', ["lį"]='L-',
    { "ḷį", "L--" }, { "lį", "L-" },
["ḷ"]='L', ["ƛ"]='T',
    { "ḷ", "L" }, { "ƛ", "T" },


-- į-series
    -- į-series
["į"]='j',
    { "į", "j" },
};
   
    -- v-series
    { "v", "f" },
}


function export.tr(text, lang, sc)
function export.tr(text, lang, sc)
text = mw.ustring.lower(text)
text = mw.ustring.lower(text)
for pat, repl in pairs(tt[sc]) do
for _, rule in ipairs(tt) do
        text = mw.ustring.gsub(text, pat, repl)
text = mw.ustring.gsub(text, rule[1], rule[2])
end
end


Navigation menu