Module:mg-noun: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 12: Line 12:


local export = {}
local export = {}
local endings = {["a"] = "A", ["e"] = "E", ["o"] = "O", ["r"] = "R"}


local function detect_decl(word, class)
local function detect_decl(word, class)
Line 21: Line 19:
return class, {last}
return class, {last}
elseif word:match("[aeor]$") then
elseif word:match("[aeor]$") then
return endings[last], {last}
return mw.ustring.upper(last), {last}
elseif word:match("n$") then
elseif word:match("n$") then
return "participle", {last}
return "participle", {last}