Module:mg-pron: Difference between revisions

No edit summary
No edit summary
Line 26: Line 26:
end
end


local function remove_acute(str)
local function remove_acute(str, with_stress)
str = mw.ustring.toNFD(str)
str = mw.ustring.toNFD(str)
str = gsub(str, ACUTE, "")
str = gsub(str, ACUTE, "")
str = mw.ustring.toNFC(str)
str = mw.ustring.toNFC(str)
return str
return (with_stress and "ˈ" or "") .. str
end
end


Line 63: Line 63:
if match(term, "[áéíóú]") then
if match(term, "[áéíóú]") then
for _, s in ipairs(syll) do
for _, s in ipairs(syll) do
s = "ˈ" .. remove_acute(s)
s = remove_acute(s, true)
table.insert(noa, s)
table.insert(noa, s)
end
end