Module:siwa-pron: Difference between revisions
No edit summary |
No edit summary |
||
| Line 80: | Line 80: | ||
function export.syllables(word) | function export.syllables(word) | ||
local morpheme = {} | local morpheme = {} | ||
local syll = {} | |||
table.insert(morpheme, syll) | |||
if gmatch(word,"·") then | if gmatch(word,"·") then | ||
morpheme = split(word,"·") | morpheme = split(word,"·") | ||
end | end | ||
local pattern = "^(" .. consonant .. "*" .. vowel .. "*" .. consonant .. "*)" | local pattern = "^([ˈˌ]?" .. consonant .. "*" .. vowel .. "*" .. consonant .. "*)" | ||
for i, m in ipairs(morpheme) do | for i, m in ipairs(morpheme) do | ||
| Line 95: | Line 95: | ||
morpheme[i] = "ˈ" .. morpheme[i] | morpheme[i] = "ˈ" .. morpheme[i] | ||
end | end | ||
syll[i] = split(morpheme[i], pattern) | |||
end | end | ||
table.concat(syll,"-") | |||
return table.concat(morpheme,"·") | return table.concat(morpheme,"·") | ||
end | end | ||