Module:kilta-pron: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 62: Line 62:


local function syllabify(term)
local function syllabify(term)
local first = term == "áhepːi"
local last = (term == "kolán" or term == "türá")
local syllable = "(" .. consonants .. "*)(" .. vowels .. "ː?)(" .. consonants .. "-)"
local syllable = "(" .. consonants .. "*)(" .. vowels .. "ː?)(" .. consonants .. "-)"
Line 78: Line 80:
local syllables = split(term, "·")
local syllables = split(term, "·")
if term:match("'") then
if first then
for _, s in ipairs(syllables) do
syllables[1] = "ˈ" .. syllables[1]
s = s:gsub("'", "ˈ")
elseif last then
end
syllables[#syllables] = "ˈ" .. syllables[#syllables]
elseif #syllables > 1 then
elseif #syllables > 1 then
syllables[#syllables - 1] = "ˈ" .. syllables[#syllables - 1] -- penultimate stress
syllables[#syllables - 1] = "ˈ" .. syllables[#syllables - 1] -- penultimate stress