Module:ábḫ-ipa: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 92: Line 92:
pos = 0
pos = 0
for i,val in ipairs(stresses) do
for i,val in ipairs(stresses) do
if mw.ustring.match(val, "ˈ") then
if mw.ustring.match(val, "[ˈ]") then
pos = i
pos = i
end
end
Line 101: Line 101:
-- mark secondary stress
-- mark secondary stress
for i,val in ipairs(stresses) do
for i,val in ipairs(stresses) do
if mw.ustring.match(val, ".") and (i ~= syllables) then
if mw.ustring.match(val, "[%.]") and (i ~= syllables) then
if (i - pos) % 2 == 0 then
if (i - pos) % 2 == 0 then
table.insert(newStresses, "ˌ")
table.insert(newStresses, "[ˌ]")
else
else
if not (mw.ustring.match(result[1], ".") and (i == 1)) then
if not (mw.ustring.match(result[1], "[%.]") and (i == 1)) then
table.insert(newStresses, val)
table.insert(newStresses, val)
end
end