Module:mg-noun/data: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 3: Line 3:
local match = mw.ustring.match
local match = mw.ustring.match
local PAGENAME = mw.title.getCurrentTitle().text
local PAGENAME = mw.title.getCurrentTitle().text
local deacuter = {["á"] = "a", ["é"] = "e", ["í"] = "i", ["ó"] = "o", ["ú"] = "u"}


local data = {}
local data = {}
Line 119: Line 121:
}
}
setmetatable(data["nt"], {__call = function(self, args, data)
setmetatable(data["nt"], {__call = function(self, args, data)
local stem = data.head; data.decl_type = "nt"; local s1 = sub(stem, 1, -2)
local stem = data.head; data.decl_type = "nt"; local s1 = sub(stem, 1, -3) .. deacuter[sub(stem, -2, -2)]
table.insert(data.categories, "Modern Gallaecian nt-declension " .. (data.proper and "proper" or "") .. " nouns")
table.insert(data.categories, "Modern Gallaecian nt-declension " .. (data.proper and "proper" or "") .. " nouns")
data.forms["di_s"] = {s1 .. "n"}
data.forms["di_s"] = {stem}
data.forms["da_s"] = {s1 .. "nze"}
data.forms["da_s"] = {s1 .. "nze"}
data.forms["lo_s"] = {s1 .. "nze"}
data.forms["lo_s"] = {s1 .. "nze"}