Module:siwa-pron: Difference between revisions

No edit summary
No edit summary
Line 84: Line 84:
{
{
["h"] = "ʔ", ["ɡį"] = "jː", ["hh"] = "hː"
["h"] = "ʔ", ["ɡį"] = "jː", ["hh"] = "hː"
},
}
local unstressed_rules = {
{ --undo ligatures
["ʨ"] = "t͡ɕ", ["ʥ"] = "d͡ʑ", ["ł"] = "tɬ", ["ʣ"] = "d͡z", ["ʦ"] = "t͡s",
},
{
["·"] = "", --remove morpheme separator
},
},
}
}
Line 119: Line 128:
local ss = mw.ustring.match(term, stpattern)
local ss = mw.ustring.match(term, stpattern)
--local i,j = string.find(term, ss)
local i,j = mw.ustring.find(term, ss)
for _, srule in ipairs(stressed_rules) do
for _, srule in ipairs(stressed_rules) do
for regex, replacement in pairs(srule) do
for regex, replacement in pairs(srule) do
ss = gsub(ss, regex, replacement)
xx = gsub(ss, regex, replacement)
end
end
end
end
term = ss
term = sub(term,1,i) .. xx .. sub(term,i+#xx)
table.insert(IPA, term)
table.insert(IPA, term)