Module:siwa-noun: Difference between revisions

No edit summary
No edit summary
Line 32: Line 32:


function syll_count(term)
function syll_count(term)
local x = {}
term = m_pron.crux(term, true, false, false)
term = m_pron.crux(term, true, false, false)
term = gsub(term, "[ˌˈ]", "")
term = gsub(term, "[ˌˈ]", "")
Line 37: Line 38:
local pattern = xc .. "?(" .. vowels .. "+ː?)" .. xc .. "*"
local pattern = xc .. "?(" .. vowels .. "+ː?)" .. xc .. "*"
term, n = gsub(term, pattern, "%1")
term, n = gsub(term, pattern, "%1")
term = gsub(term, pattern, "%1", 1)
return term, n
for _, v in gmatch(term, pattern) do
table.insert(x, v)
end
return x[1], n
end
end