Module:siwa-pron: Difference between revisions

No edit summary
No edit summary
Line 21: Line 21:
local vowel = "[" .. front_vowel .. back_vowel .. "]"
local vowel = "[" .. front_vowel .. back_vowel .. "]"


local open_to_closed = {
local function open_to_closed(v)
["ɑ"] = "a", ["e"] = "ɛ", ["i"] = "ɪ", ["ɔ"] = "ɔ", ["u"] = "ʊ", ["y"] = "œ", ["ø"] = "œ",
local otc = {}
}
local switch = {["ɑ"] = "a", ["e"] = "ɛ", ["i"] = "ɪ", ["ɔ"] = "ɔ", ["u"] = "ʊ", ["y"] = "œ", ["ø"] = "œ",}
for vc in gmatch(v, ".") do
vc = gsub(vc, vc, switch[vc])
table.insert(otc, vc)
end
return table.concat(otc)
end


local rules = {
local rules = {
Line 72: Line 79:
},
},
{
{
["([ieuɔ][ɑeuɔ][eiu])(" .. consonant .. consonant .. ")"] = function(s1, s2) return open_to_closed[s1]..s2 end
["([ieuɔ][ɑeuɔ][eiu])(" .. consonant .. consonant .. ")"] = function(s1, s2) return open_to_closed(s1) .. s2 end
},
},
{
{