Module:mg-noun/data: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 5: Line 5:


local deacuter = {["á"] = "a", ["é"] = "e", ["í"] = "i", ["ó"] = "o", ["ú"] = "u"}
local deacuter = {["á"] = "a", ["é"] = "e", ["í"] = "i", ["ó"] = "o", ["ú"] = "u"}
local cs = "bkdhjlmnñpqrstxzvɡzʧʎ"


local data = {}
local data = {}
Line 14: Line 15:
}
}
setmetatable(data["o"], {__call = function(self, args, data)
setmetatable(data["o"], {__call = function(self, args, data)
local stem = data.head; data.decl_type = "o"; local s1 = sub(stem, 1, -2)
local stem = data.head; data.decl_type = "o"; local s1 = sub(stem, 1, -2); local inserted = s1
local inserted = gsub(gsub(stem, "ch", "ʧ"), "([^i])o$", "i%1"); inserted = gsub(inserted, "(.)io$", "i%1i")
local pat = {
  inserted = gsub(inserted, "ii", "i"); inserted = gsub(inserted, "c$", "qu"); inserted = gsub(inserted, "ʧ", "ch")
{"ch", "ʧ"}, {"il", "ʎ"}, {"([^" .. cs .. "])([" .. cs .. "]*)(i?)$", "%1i%2%3"}, {"ii", "i"}, {"c$", "qu"}, {"ʎ", "il"}, {"ʧ", "ch"}
}
for _, repl in ipairs(pat) do
inserted = gsub(inserted, repl[1], repl[2])
end
 
table.insert(data.categories, "Modern Gallaecian o-declension " .. (data.proper and "proper" or "") .. " nouns")
table.insert(data.categories, "Modern Gallaecian o-declension " .. (data.proper and "proper" or "") .. " nouns")