Module:siwa-pron: Difference between revisions

No edit summary
No edit summary
Line 37: Line 37:
local function stressed(word)
local function stressed(word)
local stpattern = "·?ˈ[mnɲŋpbtdcɟkɡʔvðsɕxɣhʨʥrlɬłʣjwʦ⁽ʰ⁾ʔː]*"..UNRELEASED.."?[iɪyeøɛœæauɔɑʊ]([mnɲŋpbtdcɟkɡʔvðsɕxɣhʨʥrlɬłʣjwʦʔː]*"..UNRELEASED.."?)"
local stpattern = "·?ˈ[mnɲŋpbtdcɟkɡʔvðsɕxɣhʨʥrlɬłʣjwʦ⁽ʰ⁾ʔː]*"..UNRELEASED.."?[iɪyeøɛœæauɔɑʊ]([mnɲŋpbtdcɟkɡʔvðsɕxɣhʨʥrlɬłʣjwʦʔː]*"..UNRELEASED.."?)"
--local ss = mw.ustring.match(word, stpattern)
local ss = gsub(word, stpattern, "%1")
local stressed_rules = {["h"] = "ʔ", ["ɡį"] = "jː", ["hh"] = "hː",}
local stressed_rules = {["h"] = "ʔ", ["ɡį"] = "jː", ["hh"] = "hː",}
--local i,j = mw.ustring.find(term, ss)
--local i,j = mw.ustring.find(term, ss)
for qwerty in gmatch(word, stpattern) do
for qwerty in gmatch(ss, stpattern) do
qwerty[1] = gsub(qwerty[1], qwerty[1], stressed_rules[qwerty])
qwerty = gsub(qwerty, qwerty, stressed_rules[qwerty])
end
end
--[[for regex, replacement in pairs(stressed_rules) do
--[[for regex, replacement in pairs(stressed_rules) do