45,646
edits
No edit summary |
No edit summary |
||
Line 56: | Line 56: | ||
local function syllabify(term) | local function syllabify(term) | ||
local iskolan = term == "kolaːn" | |||
local syllable = "(" .. consonants .. "*" .. vowels .. consonants .. "-)" | local syllable = "(" .. consonants .. "*" .. vowels .. consonants .. "-)" | ||
term = term:gsub("(" .. consonants .. ")ː", "%1·%1") | term = term:gsub("(" .. consonants .. ")ː", "%1·%1") | ||
Line 69: | Line 69: | ||
term = term:gsub("·(" .. consonants .. ")·", "%1·") | term = term:gsub("·(" .. consonants .. ")·", "%1·") | ||
local syllables = split(term, "·") | |||
if iskolan then | if iskolan then | ||
syllables[#syllables] = "ˈ" .. syllables[#syllables] -- ultimate stress | syllables[#syllables] = "ˈ" .. syllables[#syllables] -- ultimate stress | ||
Line 80: | Line 76: | ||
syllables[#syllables - 1] = "ˈ" .. syllables[#syllables - 1] -- penultimate stress | syllables[#syllables - 1] = "ˈ" .. syllables[#syllables - 1] -- penultimate stress | ||
else | else | ||
term = term:gsub(syllable .. "$", "·%1") | |||
end | syllables = split(term, "·") | ||
syllables[#syllables - 1] = "ˈ" .. syllables[#syllables - 1] | |||
end | |||
return | return table.concat(syllables, "·") | ||
end | end | ||