Module:siwa-noun/data: Difference between revisions
Jump to navigation
Jump to search
(Created page with "local data = {} return data") |
No edit summary |
||
Line 1: | Line 1: | ||
local data = {} | local data = {} | ||
local sub = mw.ustring.sub | |||
decl_data["i-a-s"] = { | |||
params = { | |||
[1] = {}, | |||
}, | |||
} | |||
setmetatable(decl_data["i-a-s"], {__call = function(self, args, data) | |||
local stem = args[1] | |||
table.insert(data.categories, "Siwa a-declension nouns") | |||
data.forms["nom"] = {stem} | |||
data.forms["gen"] = { | |||
(sub(stem, -3, -2) == "mm" and sub(stem, 1, -4) .. "mġa") or | |||
(sub(stem, -2, -2) == "m" and sub(stem, 1, -3) .. "mġa") or | |||
(sub(stem, -2, -2) == "n" and sub(stem, 1, -3) .. "nka") or | |||
(sub(stem, -2, -2) == "p" and sub(stem, 1, -3) .. "pra") or | |||
(sub(stem, -2, -2) == "t" and sub(stem, 1, -3) .. "tra") or | |||
(sub(stem, -3, -2) == "vv" and sub(stem, 1, -4) .. "gga") or | |||
(sub(stem, -3, -2) == "lk" and sub(stem, 1, -4) .. "lkka") or | |||
(sub(stem, -3, -2) == "rk" and sub(stem, 1, -4) .. "rkka") or | |||
(sub(stem, -3, -2) == "sk" and sub(stem, 1, -4) .. "skka") or | |||
(stem .. "ka") | |||
} | |||
data.forms["ine"] = {stem .. "ą"} | |||
data.forms["ill"] = {stem .. "as", stem_i .. (stem_i == stem and "is" or "s")} | |||
data.forms["ela"] = {stem .. "ai"} | |||
data.forms["ade"] = {stem .. "ō"} | |||
data.forms["all"] = {stem .. "ō"} | |||
data.forms["abl"] = {stem .. "ō"} | |||
end | |||
}) | |||
Revision as of 19:53, 5 February 2021
- The following documentation is located at Module:siwa-noun/data/doc.[edit]
- Useful links: root page • root page's subpages • links • transclusions • testcases • sandbox
local data = {}
local sub = mw.ustring.sub
decl_data["i-a-s"] = {
params = {
[1] = {},
},
}
setmetatable(decl_data["i-a-s"], {__call = function(self, args, data)
local stem = args[1]
table.insert(data.categories, "Siwa a-declension nouns")
data.forms["nom"] = {stem}
data.forms["gen"] = {
(sub(stem, -3, -2) == "mm" and sub(stem, 1, -4) .. "mġa") or
(sub(stem, -2, -2) == "m" and sub(stem, 1, -3) .. "mġa") or
(sub(stem, -2, -2) == "n" and sub(stem, 1, -3) .. "nka") or
(sub(stem, -2, -2) == "p" and sub(stem, 1, -3) .. "pra") or
(sub(stem, -2, -2) == "t" and sub(stem, 1, -3) .. "tra") or
(sub(stem, -3, -2) == "vv" and sub(stem, 1, -4) .. "gga") or
(sub(stem, -3, -2) == "lk" and sub(stem, 1, -4) .. "lkka") or
(sub(stem, -3, -2) == "rk" and sub(stem, 1, -4) .. "rkka") or
(sub(stem, -3, -2) == "sk" and sub(stem, 1, -4) .. "skka") or
(stem .. "ka")
}
data.forms["ine"] = {stem .. "ą"}
data.forms["ill"] = {stem .. "as", stem_i .. (stem_i == stem and "is" or "s")}
data.forms["ela"] = {stem .. "ai"}
data.forms["ade"] = {stem .. "ō"}
data.forms["all"] = {stem .. "ō"}
data.forms["abl"] = {stem .. "ō"}
end
})
return data