45,633
edits
No edit summary |
No edit summary |
||
Line 29: | Line 29: | ||
} | } | ||
local vowels = "[ | local vowels = "[aäeɛʊiɪɔɐ]" | ||
local tones = "[ˆˇ´]" | |||
local rules = { | local rules = { | ||
{" | {"([áíó])", function(v) return sub(mw.ustring.toNFD(v), 1, 1) .. "´" end}, | ||
{"aa", "aː"}, {"ii", "iː"}, | |||
{vowels .. " | {"aá", "aaˇ"}, {"áa", "aaˆ"}, {"ií", "iiˇ"}, {"íi", "iiˆ"}, | ||
{"eí", "eːˇi"}, {"oú", "oːˇu"}, {"aa", "aː"}, {"ii", "iː"}, {"o", "ɔ"}, | |||
{"(" .. vowels .. "ː?" .. tones .. "?).", "%1ɪ" .. NONSYLL}, {"(" .. vowels .. "ː?" .. tones .. "?o)", "%1" .. NONSYLL}, | |||
{"(" .. vowels .. "ː?" .. tones .. "?)u", "%1ʊ" .. NONSYLL}, | |||
{".", { | |||
["r"] = "ɺ", | |||
["b"] = "β", | |||
["g"] = "ɡ", -- double- to single-storey | |||
["o"] = "ɔ", | |||
["a"] = "ä", | |||
["ḫ"] = "x", | |||
["s"] = "ɕ", | |||
["z"] = "θ", | |||
}}, {"jh", "ʑ"}, {"j", "ɲ"}, {"y", "j"}, {"", ""}, {"", ""}, | |||
{"", ""}, {"", ""}, {"", ""}, {"", ""}, {"", ""}, {"", ""}, {"", ""}, {"", ""}, {"", ""}, | {"", ""}, {"", ""}, {"", ""}, {"", ""}, {"", ""}, {"", ""}, {"", ""}, {"", ""}, {"", ""}, | ||
{"", ""}, {"", ""}, {"", ""}, {"", ""}, {"", ""}, {"", ""}, {"", ""}, {"", ""}, {"", ""}, | {"", ""}, {"", ""}, {"", ""}, {"", ""}, {"", ""}, {"", ""}, {"", ""}, {"", ""}, {"", ""}, | ||
{"", ""}, {"", ""}, {"", ""}, {"", ""}, {"", ""}, {"", ""}, {"", ""}, {"", ""}, {"", ""}, | {"", ""}, {"", ""}, {"", ""}, {"", ""}, {"", ""}, {"", ""}, {"", ""}, {"", ""}, {"", ""}, | ||
} | } | ||
function export.test(frame) | function export.test(frame) | ||
local word = frame.args[1] | |||
for _, rule in ipairs(rules) do | |||
word = word:gsub(rule[1], rule[2]) | |||
end | |||
return word | |||
end | end | ||
return export | return export |