45,646
edits
No edit summary |
No edit summary |
||
Line 50: | Line 50: | ||
local last_rules = { | local last_rules = { | ||
{"ʞ", "kʷ"}, {"ƕ", "xʷ"}, {"ʧ", "t͡ʃ"}, | {"ʞ", "kʷ"}, {"ƕ", "xʷ"}, {"ʧ", "t͡ʃ"}, | ||
{"ꜷ", "au"}, {"ꜽ", "ai"}, | {"ꜷ", "au"}, {"ꜽ", "ai"}, {"·ˈ", "ˈ"}, {"·", "."}, | ||
} | } | ||
local function syllabify(term) | local function syllabify(term) | ||
local syllable = "(" .. consonants .. "*" .. vowels .. "ː?" .. consonants .. "-)" | local syllable = "(" .. consonants .. "*" .. vowels .. "ː?" .. consonants .. "-)" | ||
term = term:gsub("(" .. consonants .. ")ː", "% | term = term:gsub("(" .. consonants .. ")ː", "%1·%1") | ||
term = term:gsub(syllable, " | term = term:gsub(syllable, "·%1·") | ||
term = term:gsub("^ | term = term:gsub("^·", "") | ||
term = term:gsub(" | term = term:gsub("·$", "") | ||
term = term:gsub(" | term = term:gsub("·+", "·") | ||
term = term:gsub(" | term = term:gsub("·([nlɾs])([pβmtʧkxʷʞƕː])", "%1·%2") | ||
term = term:gsub(" | term = term:gsub("·([tmnlɾs])$", "%1") | ||
term = term:gsub(" | term = term:gsub("·(" .. consonants .. ")·", "%1·") | ||
local syllables = split(term, " | local syllables = split(term, "·") | ||
syllables[#syllables - 1] = "ˈ" .. syllables[#syllables - 1] -- penultimate stress | |||
return | return table.concat(syllables, ".") | ||
end | end | ||