Module:kilta-pron: Difference between revisions

Jump to navigation Jump to search
no edit summary
No edit summary
No edit summary
Line 54: Line 54:


local function syllabify(term)
local function syllabify(term)
local iskolan = term == "kolán"
local syllable = "(" .. consonants .. "*" .. vowels .. "ː?" .. consonants .. "-)"
local syllable = "(" .. consonants .. "*" .. vowels .. "ː?" .. consonants .. "-)"
term = term:gsub("(" .. consonants .. ")ː", "%1·%1")
term = term:gsub("(" .. consonants .. ")ː", "%1·%1")
Line 66: Line 67:
local syllables = split(term, "·")
local syllables = split(term, "·")
syllables[#syllables - 1] = "ˈ" .. syllables[#syllables - 1] -- penultimate stress
if iskolan then
syllables[#syllables] = "ˈ" .. syllables[#syllables] -- ultimate stress
elseif #syllables ~= 1 then
syllables[#syllables - 1] = "ˈ" .. syllables[#syllables - 1] -- penultimate stress
end
return table.concat(syllables, "·")
return table.concat(syllables, "·")

Navigation menu