Module:kilta-headword: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 16: Line 16:
end
end


local function plural(word, escape)
local function plural(word)
local pl = {}
local pl = {}
if escape then
pl = escape
if word:match("[kh]wa$") or word:match("a$") then
elseif word:match("[kh]wa$") or word:match("a$") then
pl = {sub(word, 1, -1) .. "úr"}
pl = {sub(word, 1, -1) .. "úr"}
elseif word:match("ës$") or word:match("uin$") or word:match("[str]$") then
elseif word:match("ës$") or word:match("uin$") or word:match("[str]$") then
Line 54: Line 53:
if pos == "adv" then table.insert(data.categories, lang:getCanonicalName() .. " comparative " .. deabb[pos]) end ]=]
if pos == "adv" then table.insert(data.categories, lang:getCanonicalName() .. " comparative " .. deabb[pos]) end ]=]
else
else
table.insert(data.inflections, plural(word, pl[1] and pl or nil))
table.insert(data.inflections, pl or plural(word))
end
end