Module:siwa-noun: Difference between revisions
No edit summary |
No edit summary |
||
| Line 16: | Line 16: | ||
local vowels = "[iɪyeøɛœæauɔ̃ɑʊ]" | local vowels = "[iɪyeøɛœæauɔ̃ɑʊ]" | ||
local pagename = mw.title.getCurrentTitle().text | local pagename = mw.title.getCurrentTitle().text | ||
local xc = "[mnɲŋpbtdcɟkɡvðsɕzʑxɣhrlɬjw⁽ʰ⁾ʔː̥͡"..UNRELEASED.."]" | |||
local stressedvowels = { | local stressedvowels = { | ||
| Line 31: | Line 33: | ||
} | } | ||
function syll_count( | function syll_count(word) | ||
word = m_pron.crux(word, true, false, false) | |||
word = gsub(word, "[ˌˈ]", "") | |||
local pattern = "(" .. xc .. "?" .. vowels .. "+ː?" .. xc .. "*)" | local pattern = "(" .. xc .. "?" .. vowels .. "+ː?" .. xc .. "*)" | ||
syllable, n = gsub(word, pattern, "%1") | |||
syllable = match(syllable, pattern) | |||
return | return syllable, n | ||
end | end | ||
local function stressed_components(word) | |||
local pattern = xc .. "?(" .. vowels .. "+ː?)(" .. xc .. "*)" | |||
return match(word, pattern) | |||
end | |||
local function detect_quality(word) | local function detect_quality(word) | ||
| Line 77: | Line 83: | ||
local x, y = gsub(syll_count(word), pattern, "%1", 1) | local x, y = gsub(syll_count(word), pattern, "%1", 1) | ||
return | return stressed_components(word) | ||
end | end | ||
return export | return export | ||