Module:kilta-pron: Difference between revisions

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


local function syllabify(term)
local function syllabify(term)
--[[local iskolan = term == "kolaːn"
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, "·")
local syllables = split(term, "·")
local syllables = {}
for m in term:gmatch("[^·]+") do
table.insert(syllables, m)
end
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
error("debug: " .. #syllables)
term = term:gsub(syllable .. "$", "·%1")
end]]
syllables = split(term, "·")
syllables[#syllables - 1] = "ˈ" .. syllables[#syllables - 1]
end
return term --table.concat(syllables, "·")
return table.concat(syllables, "·")
end
end


Navigation menu