Module:qhv-pron: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 38: Line 38:
for i, syllable in ipairs(syllables) do
for i, syllable in ipairs(syllables) do
weight[i] = match(syllable, "[aeiouy" .. NONSYLLABIC .. "]$") and "l" or "h"
weight[i] = match(syllable, "[aeiouy" .. NONSYLLABIC .. "]$") and "l" or "h"
end
end
local a, p, antepenult, penult= weight[#weight-2], weight[#weight-1], syllables[#syllables-2], syllables[#syllables-1]
if p == "l" and a == "l" then penult = "ˈ" .. penult
elseif p == "h" then penult = "ˈ" .. penult
elseif p == "l" and a == "h" then antepenult = "ˈ" .. antepenult
elseif p == nil then syllables[#syllables] = "ˈ" .. syllables[#syllables]
else penult = "ˈ" .. penult end
return #syllables
return #syllables