Module:ábḫ-ipa/remake: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 29: Line 29:
}
}


local vowels = "[aeɛʊiɪɔɐ]"
local vowels = "[aäeɛʊiɪɔɐ]"
local tones = "[ˆˇ´]"


local rules = {
local rules = {
{"áa", "aa^"}, {"aá", "aaˇ"}, {"íi", "ii^"}, {"ií", "iiˇ"},  
{"([áíó])", function(v) return sub(mw.ustring.toNFD(v), 1, 1) .. "´" end},
{"aa", "aː"}, {"ii", "iː"},  
{vowels .. "i", ""}, {"", ""}, {"", ""}, {"", ""}, {"", ""}, {"", ""}, {"", ""}, {"", ""}, {"", ""},  
{"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)
return mw.ustring.toNFC("ġṡõ")
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