45,647
edits
No edit summary |
No edit summary |
||
Line 28: | Line 28: | ||
local function write_stress(term) | local function write_stress(term) | ||
local pattern = "(" .. consonants .. "*".. vowels .. "*" .. consonants .. "-)" | local pattern = "(" .. consonants .. "*".. vowels .. "*" .. consonants .. "-)" | ||
local | local weight = {} | ||
term = gsub(term, pattern, "·%1") | term = gsub(term, pattern, "·%1") | ||
term = gsub(term, "^·", "") | term = gsub(term, "^·", "") | ||
Line 37: | Line 37: | ||
term = gsub(term, "·$", "") | term = gsub(term, "·$", "") | ||
syllables = split(term, "·") | local syllables = split(term, "·") | ||
for i, syllable in ipairs(syllables) do | for i, syllable in ipairs(syllables) do | ||
if match(syllable, consonants .. "$") or match(syllable, "ː$") then weight[i] = "h" | if match(syllable, consonants .. "$") or match(syllable, "ː$") then weight[i] = "h" | ||
elseif match(syllable, | elseif match(syllable, NONSYLLABIC .. "$") then weight[i] = "h" | ||
else weight[i] = "l" | else weight[i] = "l" | ||
end | end |