45,647
edits
No edit summary |
No edit summary |
||
Line 17: | Line 17: | ||
end | end | ||
local function plural(word) | local function plural(word, n) | ||
local | local w = split(word, "%s") | ||
if | if w[n]:match("[kh]wa$") or w[n]:match("a$") then | ||
w[n] = sub(word, 1, -1) .. "úr" | |||
elseif | elseif w[n]:match("ës$") or w[n]:match("uin$") or w[n]:match("[str]$") then | ||
w[n] = word .. "á" | |||
elseif word:match("[nml]$") then | elseif word:match("[nml]$") then | ||
w[n] = word .. "ur" | |||
end | end | ||
return {label = "plural", table.concat(w)} | |||
end | end | ||
Line 45: | Line 44: | ||
local pos = args[1]; local pl = args.pl | local pos = args[1]; local pl = args.pl | ||
local data = {lang = lang, pos_category = deabb[pos], heads = {word}, categories = {}, inflections = {},} | local data = {lang = lang, pos_category = deabb[pos], heads = {word}, categories = {}, inflections = {},} | ||
if pl[1] == '-' then | if pl[1] == '-' then | ||
Line 61: | Line 59: | ||
table.insert(data.inflections, pl) | table.insert(data.inflections, pl) | ||
else | else | ||
table.insert(data.inflections, plural( | table.insert(data.inflections, plural(word, args.n)) | ||
end | end | ||
end | end |