182
edits
No edit summary |
No edit summary |
||
Line 85: | Line 85: | ||
-- isolate syllable boundary marks | -- isolate syllable boundary marks | ||
stresses = string.gsub(table.concat(result), "[^.ˈ]", "") | stresses = string.gsub(table.concat(result), "[^.ˈ]", "") | ||
syllables = string.len(stresses) | syllables = string.len(stresses) | ||
stresses = mw.text.split(stresses, "", true) | stresses = mw.text.split(stresses, "", true) | ||
Line 92: | Line 91: | ||
-- compute position of stress | -- compute position of stress | ||
pos = 0 | pos = 0 | ||
for i,val in ipairs( | for i,val in ipairs(stresses) do | ||
if mw.ustring.match( | if mw.ustring.match(stresses[i], "ˈ") then | ||
pos = i | pos = i | ||
end | end | ||
Line 102: | 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( | if mw.ustring.match(stresses[i], ".") and i ~= syllables then | ||
if (i - pos) % 2 == 0 then | if (i - pos) % 2 == 0 then | ||
table.insert(newStresses, "ˌ") | table.insert(newStresses, "ˌ") | ||
Line 173: | Line 172: | ||
word = string.gsub(word, "Ǒ", "ǎːɔ̯") | word = string.gsub(word, "Ǒ", "ǎːɔ̯") | ||
return | return "/" .. word .. "/" | ||
end | end | ||
return export | return export |
edits