Module:siwa-pron: Difference between revisions

No edit summary
No edit summary
Line 21: Line 21:
local back_vowel = "uɔ" .. NASALIZED .. "?ɑʊ"
local back_vowel = "uɔ" .. NASALIZED .. "?ɑʊ"
local vowel = "[" .. front_vowel .. back_vowel .. "]"
local vowel = "[" .. front_vowel .. back_vowel .. "]"
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.."?)"
 




Line 33: Line 33:
end
end
return table.concat(otc)
return table.concat(otc)
end
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 ss = mw.ustring.match(word, stpattern)
local stressed_rules = {["h"] = "ʔ", ["ɡį"] = "jː", ["hh"] = "hː",}
--local i,j = mw.ustring.find(term, ss)
for qwerty in gmatch(word, stpattern) do
qwerty[1] = gsub(qwerty[1], qwerty[1], stressed_rules[qwerty])
end
--[[for regex, replacement in pairs(stressed_rules) do
xx = gsub(ss, regex, replacement)
end]]
return sub(word,1,i-1) .. qwerty .. sub(word,j+1)
end
end


Line 46: Line 62:
["ṡ"] = "ɕ", ["tṡ"] = "ʨ", ["dį"] = "ʥ",
["ṡ"] = "ɕ", ["tṡ"] = "ʨ", ["dį"] = "ʥ",
["ḍ"] = "ð", ["dl"] = "ł", ["kį"] = "c",
["ḍ"] = "ð", ["dl"] = "ł", ["kį"] = "c",
["nį"] = "ɲ", ["ġ"] = "x", ["ts"] = "ʦ", ["g"] = "ɡ"
["nį"] = "ɲ", ["ġ"] = "x", ["ts"] = "ʦ", ["g"] = "ɡ" -- IPA g
},
},
{ --all vowels as open (open-closed distinctions are computed later)
{ --all vowels as open (open-closed distinctions are computed later)
Line 78: Line 94:
["mn"] = "mnː", ["mʔk"] = "m̥kː", ["mkː"] = "m̥kː",
["mn"] = "mnː", ["mʔk"] = "m̥kː", ["mkː"] = "m̥kː",
["ġl"] = "xɬ",
["ġl"] = "xɬ",
},
{
["(.*)"] = function(s1) return stressed(s1) end
},
},
}
}


local stressed_rules = {["h"] = "ʔ", ["ɡį"] = "jː", ["hh"] = "hː"}
 


local unstressed_rules = {
local unstressed_rules = {
Line 122: Line 141:
end
end
end
end
local ss = mw.ustring.match(term, stpattern)
local i,j = mw.ustring.find(term, ss)
for regex, replacement in pairs(stressed_rules) do
xx = gsub(ss, regex, replacement)
end
term = sub(term,1,i-1) .. xx .. sub(term,j+1)
table.insert(IPA, term)
table.insert(IPA, term)