45,345
edits
No edit summary |
No edit summary |
||
Line 18: | Line 18: | ||
local function plural(word, n) | local function plural(word, n) | ||
local w = split(word, " | local w = split(word, " ") | ||
if tonumber(n) > #w then error("Word index outside bounds.") end | if tonumber(n) > #w then error("Word index outside bounds.") end | ||
if w[n]:match("[kh]wa$") or w[n]:match("a$") then | |||
w[n] = sub(w[n], 1, -1) .. "úr" | w[n] = sub(w[n], 1, -1) .. "úr" | ||
elseif w[n]:match("ës$") or w[n]:match("uin$") or w[n]:match("[str]$") then | elseif w[n]:match("ës$") or w[n]:match("uin$") or w[n]:match("[str]$") then | ||
Line 27: | Line 27: | ||
elseif w[n]:match("[nml]$") then | elseif w[n]:match("[nml]$") then | ||
w[n] = w[n] .. "ur" | w[n] = w[n] .. "ur" | ||
end | end | ||
return {label = "plural", table.concat(w[n], " ")} | return {label = "plural", table.concat(w[n], " ")} |