Module:siwa-pron: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 43: Line 43:
end
end


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


for vc in gmatch(v, ".") do
for vc in gmatch(v, ".") do
Line 142: Line 132:
{"ɣ([mn])", "ŋ%1ː"}, {"ɣ([vsl])", "k%1"},
{"ɣ([mn])", "ŋ%1ː"}, {"ɣ([vsl])", "k%1"},
-- closed vowels
-- closed vowels
{"(" .. vowel .. "*)(" .. consonant .. consonant .. ")", function(s1, s2) return wopen_to_closed(s1) .. s2 end, {"w"}},
{"(" .. vowel .. "*)(" .. consonant .. consonant .. ")", function(s1, s2) return open_to_closed(s1) .. s2 end, {"w"}},
{"(" .. vowel .. "*)(" .. consonant .. consonant .. ")", function(s1, s2) return open_to_closed(s1) .. s2 end},
{"(" .. vowel .. "*)(" .. consonant .. consonant .. ")", function(s1, s2) return open_to_closed(s1) .. s2 end},
{"(" .. vowel .. "*)(" .. consonant .. ")$", function(s1, s2) return wopen_to_closed(s1) .. s2 end, {"w"}},
{"(" .. vowel .. "*)(" .. consonant .. ")$", function(s1, s2) return open_to_closed(s1) .. s2 end, {"w"}},
{"(" .. vowel .. "*)(" .. consonant .. ")$", function(s1, s2) return open_to_closed(s1) .. s2 end},
{"(" .. vowel .. "*)(" .. consonant .. ")$", function(s1, s2) return open_to_closed(s1) .. s2 end},
{"ɑ$", "a"},
{"ɑ$", "a"},