Module:siwa-noun/data: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 10: | Line 10: | ||
} | } | ||
setmetatable(data["a"], {__call = function(self, args, data) | setmetatable(data["a"], {__call = function(self, args, data) | ||
local stem = | local stem = data.head | ||
local s2, s3 = sub(stem, 1, -2), sub(stem, 1, -3) | |||
table.insert(data.categories, "Siwa inanimate nouns") | table.insert(data.categories, "Siwa inanimate nouns") | ||
table.insert(data.categories, "Siwa a-declension nouns") | table.insert(data.categories, "Siwa a-declension nouns") | ||
data.forms["u"] = {" | data.forms["u"] = {stem} | ||
data.forms["m"] = {" | if stem:match("mm.$") then | ||
data.forms["m"] = {s3 .. (data.q == "s" and "mġa" or data.q == "l" and "mka" or "kka")} | |||
data.forms["m"] = {""} | elseif stem:match("nn.$") then | ||
end | data.forms["m"] = {s3 .. (data.q == "s" and "nka" or "kka")} | ||
elseif stem:match("vv.$") then | |||
data.forms["m"] = {s3 .. "gga"} | |||
elseif stem:match("[lrs]k.$") then | |||
data.forms["m"] = {s2 .. "kka"} | |||
end | |||
end | end | ||
}) | }) |
Revision as of 17:01, 24 July 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
local match = mw.ustring.match
data["a"] = {
params = {
[1] = {},
},
}
setmetatable(data["a"], {__call = function(self, args, data)
local stem = data.head
local s2, s3 = sub(stem, 1, -2), sub(stem, 1, -3)
table.insert(data.categories, "Siwa inanimate nouns")
table.insert(data.categories, "Siwa a-declension nouns")
data.forms["u"] = {stem}
if stem:match("mm.$") then
data.forms["m"] = {s3 .. (data.q == "s" and "mġa" or data.q == "l" and "mka" or "kka")}
elseif stem:match("nn.$") then
data.forms["m"] = {s3 .. (data.q == "s" and "nka" or "kka")}
elseif stem:match("vv.$") then
data.forms["m"] = {s3 .. "gga"}
elseif stem:match("[lrs]k.$") then
data.forms["m"] = {s2 .. "kka"}
end
end
})
return data