Module:siwa-noun: Difference between revisions
No edit summary |
No edit summary |
||
| Line 34: | Line 34: | ||
term = m_pron.crux(term, true, false, false) | term = m_pron.crux(term, true, false, false) | ||
local xc = "[mnɲŋpbtdcɟkɡvðsɕzʑxɣhrlɬjw⁽ʰ⁾ʔː̥͡"..UNRELEASED.."]" | local xc = "[mnɲŋpbtdcɟkɡvðsɕzʑxɣhrlɬjw⁽ʰ⁾ʔː̥͡"..UNRELEASED.."]" | ||
local pattern = | local pattern = xc .. "?(" .. vowels .. "+ː?)" .. xc .. "*" | ||
return gsub(term, pattern, "%1") | return gsub(term, pattern, "%1") | ||
| Line 41: | Line 41: | ||
local function detect_quality(word) | local function detect_quality(word) | ||
local stressed, n = syll_count(word) | local stressed, n = syll_count(word) | ||
if find(stressed, vowels .. vowels .. vowels .. "?") or find(stressed, | if find(stressed, vowels .. vowels .. vowels .. "?") or find(stressed, "ː") or n>=3 then | ||
return "w" -- weak nouns | return "w" -- weak nouns | ||
else return "s" -- strong nouns | else return "s" -- strong nouns | ||
| Line 47: | Line 47: | ||
end | end | ||
local function detect_decl(word, | local function detect_decl(word, gender, quality) | ||
if | local stressed = syll_count(word) | ||
local decl = | if gender and quality then | ||
local decl = gender .. "-" .. quality | |||
end | end | ||
end | end | ||
| Line 59: | Line 60: | ||
[1] = { required = true }, | [1] = { required = true }, | ||
[2] = { default = pagename }, | [2] = { default = pagename }, | ||
[3] = { default = detect_quality(word) }, | |||
} | } | ||
| Line 64: | Line 66: | ||
local sv = nil | local sv = nil | ||
local decl_type = {} | local decl_type = {} | ||
local word = args[2] | local gender, word, quality = args[1], args[2], args[3] | ||
local prefix = sub(pagename, 1, -(#word+1)) | local prefix = sub(pagename, 1, -(#word+1)) | ||
return | return gender .. " " .. word .. " " .. quality | ||
end | end | ||
return export | return export | ||