Module:siwa-pron: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 22: Line 22:


local function open_to_closed(v)
local function open_to_closed(v)
local tab = {}
local switch = {
local switch = {
     ["ɑ"] = "a", ["e"] = "ɛ", ["i"] = "ɪ", ["u"] = "ʊ", ["y"] = "œ", ["ø"] = "œ",  
     ["ɑ"] = "a", ["e"] = "ɛ", ["i"] = "ɪ", ["u"] = "ʊ", ["y"] = "œ", ["ø"] = "œ",  
}
}
tab = mw.text.split(v,"")
for openv, closedv in ipairs(switch) do
for openv, closedv in ipairs(switch) do
return gsub(v, openv, closedv)
return gsub(tostring(tab), openv, closedv)
end
end
end
end
Line 77: Line 79:
},
},
{
{
["([" .. table.concat(m_sm.diphthongs, "|") .. "])(" .. consonant .. ")"] = open_to_closed("%1"),
["(" .. m_sm.data.triphthongs[vowel..vowel..vowel] .. ")"] = open_to_closed("%1")
},
},
{
{