Module:qay-pron: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 73: Line 73:
term = gsub(term, "(" .. consonants .. ")·(" .. consonants .. ")([pbmvstdnrɾlkɡŋhxçʤʧçx])", "%1%2·%3")
term = gsub(term, "(" .. consonants .. ")·(" .. consonants .. ")([pbmvstdnrɾlkɡŋhxçʤʧçx])", "%1%2·%3")
local syllables = split(term, "·")
local syllables = split(term, "·"); local ret = table.concat(syllables, "·")
if #syllables ~= 1 then
if #syllables ~= 1 then
Line 79: Line 79:
if match(syll, "´") or match(syll, "ː") then
if match(syll, "´") or match(syll, "ː") then
table.insert(syllables, i, "ˈ")
table.insert(syllables, i, "ˈ")
return table.concat(syllables, "·")
return ret
elseif match(term, "ŋ$") or match(syllables[#syllables], "[aɛɪɔʊ][ɪʊ]") then
elseif match(term, "ŋ$") or match(syllables[#syllables], "[aɛɪɔʊ][ɪʊ]") then
table.insert(syllables, #syllables, "ˈ")
table.insert(syllables, #syllables, "ˈ")
--syllables[#syllables-1] = gsub(syllables[#syllables-1], "ˈ", "")
--syllables[#syllables-1] = gsub(syllables[#syllables-1], "ˈ", "")
return table.concat(syllables, "·")
return ret
else
table.insert(syllables, #syllables-1, "ˈ")
end
end
end
end
if not match(ret, "ˈ") then
ret = string.reverse(ret)
ret = gsub(ret, "·", "ˈ·", 2)
ret = gsub(ret, "ˈ·", "·", 1)
ret = string.reverse(ret)
end
end
end
return table.concat(syllables, "·")
return table.concat(syllables, "·")