45,647
edits
No edit summary |
No edit summary |
||
Line 34: | Line 34: | ||
local pattern = "(" .. consonants .. "*".. vowels .. "*" .. consonants .. "-)" | local pattern = "(" .. consonants .. "*".. vowels .. "*" .. consonants .. "-)" | ||
local weight = {} | local weight = {} | ||
term = gsub( | term = term | ||
:gsub(pattern, "·%1") | |||
:gsub("^·", "") | |||
:gsub("·(" .. consonants .. ")·", "·%1") | |||
:gsub("·(" .. consonants .. ")$", "%1") | |||
:gsub("·(" .. consonants .. ")(" .. consonants .. ")", "%1·%2") | |||
:gsub("([ptkbdɡ])·([rlṛsz])", "·%1%2") | |||
:gsub("·(" .. consonants .. "?" .. consonants .. ")$", "%1") | |||
:gsub("·$", "") | |||
local syllables = split(term, "·") | local syllables = split(term, "·") |