Module:qlu-pron: Difference between revisions

No edit summary
No edit summary
Line 110: Line 110:
local unstressed = "[ăĕ" .. c.breve .. "]"
local unstressed = "[ăĕ" .. c.breve .. "]"
for i, syll in ipairs(syllables) do
for i, syll in ipairs(syllables) do
if match(word, "ˈ") then -- keep looking for secondary stresses but don't apply penultimate rule
if match(word, first_stress) then
if match(syll, first_stress) then
syll = "ˈ" .. gsub(mw.ustring.toNFD(syll), c.circ, "")
end
else
table.insert(syllables, #syllables-1, "ˈ")
return table.concat(syllables, "·")
end
--[[if match(word, "ˈ") then -- keep looking for secondary stresses but don't apply penultimate rule
if match(syll, second_stress) then
if match(syll, second_stress) then
syll = "ˈ" .. gsub(mw.ustring.toNFD(syll), c.acute, "")
syll = "ˈ" .. gsub(mw.ustring.toNFD(syll), c.acute, "")
Line 116: Line 128:
elseif match(syll, first_stress) then
elseif match(syll, first_stress) then
syll = "ˈ" .. gsub(mw.ustring.toNFD(syll), c.circ, "")
syll = "ˈ" .. gsub(mw.ustring.toNFD(syll), c.circ, "")
return table.concat(syllables, "·")
break
elseif match(syll, second_stress) then
elseif match(syll, second_stress) then
syll = "ˌ" .. gsub(mw.ustring.toNFD(syll), c.acute, "")
syll = "ˌ" .. gsub(mw.ustring.toNFD(syll), c.acute, "")
Line 134: Line 146:
table.insert(syllables, #syllables-1, "ˈ")
table.insert(syllables, #syllables-1, "ˈ")
return table.concat(syllables, "·")
return table.concat(syllables, "·")
end
end]]
end
end