Module:qay-pron: Difference between revisions

Jump to navigation Jump to search
no edit summary
No edit summary
No edit summary
Line 66: Line 66:
term = gsub(term, "·(" .. consonants .. ")·", "%1·")
term = gsub(term, "·(" .. consonants .. ")·", "%1·")
local syllables = split(term, "·"); local weight = {}; local st = "";
local syllables = split(term, "·"); local weight = {};
for i, syll in ipairs(syllables) do
for i, syll in ipairs(syllables) do
if match(syll, "´") then -- if the user inputted manual stress, ignore all the rest
if match(syll, "´") or match(syll, "ː") then
table.insert(syllables, i, "ˈ")
table.insert(syllables, i, "ˈ")
return table.concat(syllables)
return table.concat(syllables, "·")
end
elseif match(syll, "ŋ$") or match(syll, "[aɛɪɔʊ][ɪʊ]") then
if match(syll, "ː") then weight[i] = "sh"
table.insert(syllables, #syllables, "ˈ")
elseif match(syll, "ŋ$") or match(syll, "[aɛɪɔʊ][ɪʊ]") then weight[i] = "h"
else
else weight[i] = "l"
table.insert(syllables, #syllables-1, "ˈ")
end
end
if weight[i] == "sh" then
table.insert(syllables, i, "ˈ")
st = true
end
end
if (#syllables ~= 1) and (not st) then
local p, f = weight[#weight-1], weight[#weight] -- penultimate and final syllables
if p == "l" and f == "h" then table.insert(syllables, #syllables, "ˈ")
else table.insert(syllables, #syllables-1, "ˈ") end
end
end


Line 100: Line 89:
end
end
--term = syllabify(term)
term = syllabify(term)
for _, micrule in ipairs(phonemic_rules) do
for _, micrule in ipairs(phonemic_rules) do
Line 118: Line 107:
end
end
--term = syllabify(term)
term = syllabify(term)
for _, ticrule in ipairs(phonetic_rules) do
for _, ticrule in ipairs(phonetic_rules) do

Navigation menu