Module:siwa-noun: Difference between revisions
No edit summary |
No edit summary |
||
| Line 44: | Line 44: | ||
function syll_count(word) | function syll_count(word) | ||
local pattern = "(" .. consonants .. "?" .. vowels .. "+ː?" .. consonants .. "*)" | local pattern = "(" .. consonants .. "?" .. vowels .. "+ː?" .. consonants .. "*)" | ||
syllable, n = gsub(word, pattern, "%1") | local syllable, n = gsub(word, pattern, "%1") | ||
syllable = match(syllable, pattern) | syllable = match(syllable, pattern) | ||
| Line 70: | Line 70: | ||
local tonic_vowel = stressed_components(word) | local tonic_vowel = stressed_components(word) | ||
if gender and quality then | if gender and quality then | ||
if find(word, vowels .. "$") then | |||
local decl = gender .. "-" .. tonic_vowel .. "-" .. quality | |||
return | return decl | ||
else | |||
return gender .. "-" .. sub(word, -1) .. "-" .. tonic_vowel | |||
end | |||
else | else | ||
return | return | ||