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 = 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( | for qwerty in gmatch(ss, stpattern) do | ||
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 | ||