Module:mg-noun: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 19: Line 19:


local function detect_decl(word)
local function detect_decl(word)
local last = sub(word, -1, -1)
if word:match("[aeor]$") then
if word:match("[aeor]$") then
return mw.ustring.upper(last)
return sub(word, -1, -1) -- last letter
elseif word:match("n$") then
elseif word:match("n$") then
return "participle"
return "nt"
end
end
end
end