Module:ábḫ-ipa: Difference between revisions

Jump to navigation Jump to search
no edit summary
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), "[^.ˈ]", "")
x = stresses
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(word) do
for i,val in ipairs(stresses) do
if mw.ustring.match(word[i], "ˈ") then
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(word[i], ".") and i ~= syllables then
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 x --"/" .. word .. "/"
return "/" .. word .. "/"
end
end


return export
return export

Navigation menu