45,344
edits
No edit summary |
No edit summary |
||
(12 intermediate revisions by the same user not shown) | |||
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 cs = "bcdhjlmnñpqrstxzvgzʧʎ" | |||
local data = {} | local data = {} | ||
Line 12: | 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 | local pat = { | ||
{"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") | ||
Line 119: | Line 130: | ||
} | } | ||
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)] or 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"] = { | 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"} | ||
Line 153: | Line 164: | ||
}) | }) | ||
data[" | data["cons"] = { | ||
params = { | params = { | ||
[1] = {}, | [1] = {}, | ||
}, | }, | ||
} | } | ||
setmetatable(data[" | setmetatable(data["cons"], {__call = function(self, args, data) | ||
local stem = data.head; data.decl_type = "consonant" | local stem = data.head; data.decl_type = "consonant" | ||
local qstem = sub(stem, -1) == "c" and gsub(stem, "c$", "qu") or stem | |||
table.insert(data.categories, "Modern Gallaecian consonant-declension " .. (data.proper and "proper" or "") .. " nouns") | table.insert(data.categories, "Modern Gallaecian consonant-declension " .. (data.proper and "proper" or "") .. " nouns") | ||
data.forms["di_s"] = {stem} | data.forms["di_s"] = {stem} | ||
data.forms["da_s"] = { | data.forms["da_s"] = {qstem .. "e"} | ||
data.forms["lo_s"] = { | data.forms["lo_s"] = {qstem .. "e"} | ||
data.forms["di_p"] = { | data.forms["di_p"] = {qstem .. "es"} | ||
data.forms["da_p"] = {stem .. "ú"} | data.forms["da_p"] = {stem .. "ú"} | ||
data.forms["lo_p"] = {stem .. "ui"} | data.forms["lo_p"] = {stem .. "ui"} |