Module:siwa-noun/data: Difference between revisions

Jump to navigation Jump to search
no edit summary
No edit summary
No edit summary
Line 32: Line 32:
}
}
setmetatable(data["a"], {__call = function(self, args, data)
setmetatable(data["a"], {__call = function(self, args, data)
local stem = data.head; local lenited = lenition(stem)
local stem = data.head  
local s2, s3 = sub(lenited, 1, -3), sub(lenited, 1, -4)
local s2, s3 = sub(lenition(stem), 1, -3), sub(lenition(stem), 1, -4)
table.insert(data.categories, "Siwa inanimate nouns")
table.insert(data.categories, "Siwa a-declension nouns")
table.insert(data.categories, "Siwa a-declension nouns")
Line 41: Line 40:
if stem:match(v.."mm.$") then
if stem:match(v.."mm.$") then
data.forms["m"] = {s3 .. (data.q == "s" and "mġa" or data.q == "l" and "mka" or "kka")}
data.forms["m"] = {s3 .. (data.q == "s" and "mġa" or data.q == "l" and "mka" or "kka")}
loc = s3 .. (data.q == "s" and "mṡi" or data.q == "l" and "mki" or "kki")
elseif stem:match(v.."nn.$") then
elseif stem:match(v.."nn.$") then
data.forms["m"] = {s3 .. (data.q == "s" and "nka" or "kka")}
data.forms["m"] = {s3 .. (data.q == "s" and "nka" or "kka")}
loc = s3 .. (data.q == "s" and "nki" or "kki")
elseif stem:match(v.."vv.$") then
elseif stem:match(v.."vv.$") then
data.forms["m"] = {s3 .. "gga"}
data.forms["m"] = {s3 .. "gga"}
loc = s3 .. "ggi"
elseif stem:match(v.."[lrs]k.$") then
elseif stem:match(v.."[lrs]k.$") then
data.forms["m"] = {s2 .. "kka"}
data.forms["m"] = {s2 .. "kka"}
loc = s2 .. "kki"
elseif stem:match(v.."m.$") then
elseif stem:match(v.."m.$") then
data.forms["m"] = {s2 .. (data.q == "s" and "mġa" or data.q == "l" and "mka" or "kka")}
data.forms["m"] = {s2 .. (data.q == "s" and "mġa" or data.q == "l" and "mka" or "kka")}
loc = s2 .. (data.q == "s" and "mṡi" or data.q == "l" and "mki" or "kki")
elseif stem:match(v.."n.$") then
elseif stem:match(v.."n.$") then
data.forms["m"] = {s2 .. (data.q == "s" and "nka" or "kka")}
data.forms["m"] = {s2 .. (data.q == "s" and "nka" or "kka")}
loc = s2 .. (data.q == "s" and "nki" or "kki")
elseif stem:match(v.."[pb].$") then
elseif stem:match(v.."[pb].$") then
data.forms["m"] = {s2 .. (data.q == "s" and "pra" or "ḍga")}
data.forms["m"] = {s2 .. (data.q == "s" and "pra" or "ḍga")}
loc = s2 .. (data.q == "s" and "pri" or "ḍgi")
elseif stem:match(v.."[td].$") then
elseif stem:match(v.."[td].$") then
data.forms["m"] = {s2 .. (data.q == "s" and "tra" or "rka")}
data.forms["m"] = {s2 .. (data.q == "s" and "tra" or "rka")}
loc = s2 .. (data.q == "s" and "tri" or "tṡi")
elseif stem:match(v.."r.$") then
elseif stem:match(v.."r.$") then
data.forms["m"] = {s2 .. "hka"}
data.forms["m"] = {s2 .. "hka"}
loc = s2 .. "hki"
elseif stem:match(v.."ṡṡ.$") then
elseif stem:match(v.."ṡṡ.$") then
data.forms["m"] = {s2 .. "ka"}
data.forms["m"] = {s2 .. "ka"}
loc = s2 .. "ki"
else
else
data.forms["m"] = {stem .. "ka"}
data.forms["m"] = {stem .. "ka"}
end
if stem:match(v.."mm.$") then
loc = s3 .. (data.q == "s" and "mṡi" or data.q == "l" and "mki" or "kki")
elseif stem:match(v.."nn.$") then
loc = s3 .. (data.q == "s" and "nki" or "kki")
elseif stem:match(v.."ṡṡ.$") then
loc = s2 .. "ki"
elseif stem:match(v.."vv.$") then
loc = s3 .. "ggi"
elseif stem:match(v.."[lrs]k.$") then
loc = s2 .. "kki"
elseif stem:match(v.."m.$") then
loc = s2 .. (data.q == "s" and "mṡi" or data.q == "l" and "mki" or "kki")
elseif stem:match(v.."n.$") then
loc = s2 .. (data.q == "s" and "nki" or "kki")
elseif stem:match(v.."[pb].$") then
loc = s2 .. (data.q == "s" and "pri" or "ḍgi")
elseif stem:match(v.."[td].$") then
loc = s2 .. (data.q == "s" and "tri" or "tṡi")
elseif stem:match(v.."r.$") then
loc = s2 .. "hki"
else
loc = stem .. "ki"
loc = stem .. "ki"
end
end
Line 105: Line 91:
})
})


 
data["e"] = {
params = {
[1] = {},
},
}
setmetatable(data["e"], {__call = function(self, args, data)
local stem = data.head
local s2, s3 = sub(lenition(stem), 1, -3), sub(lenition(stem), 1, -4)
table.insert(data.categories, "Siwa e-declension nouns")
data.forms["u"] = {stem}
if stem:match("[ae]$") then
if stem:match(v.."ts.$") then
data.forms["m"] = {s3 .. "tsġi"}
loc = s3 .. "tsġi"
elseif stem:match(v.."n.$") then
data.forms["m"] = {s2 .. "di"}
ill, ela, abe = s2 .. "h", s2 .. "h", s2 .. "h"
all, abl = s2 .. "i", s2 .. "i"
ine = s2 .. "di"
elseif stem:match(v.."b.$") then
data.forms["m"] = {s2 .. "pri", s2 .. "bġi"}
loc = s3 .. "pṡi"
elseif stem:match(v.."k.$") then
data.forms["m"] = {s2 .. "ġi"}
loc = s2 .. "ṡi"
elseif stem:match(v.."m.$") then
data.forms["m"] = {s2 .. "mmi"}
loc = s2 .. "mmi"
elseif stem:match(v.."v.$") then
data.forms["m"] = {s2 .. "rri"}
loc = s2 .. "rri"
elseif stem:match(v.."t.$") then
data.forms["m"] = {s2 .. "tri"}
loc = s2 .. "tri"
elseif stem:match(v.."s.$") then
data.forms["m"] = {s2 .. "sġi"}
loc = s2 .. "sġi"
elseif stem:match(v.."l.$") then
data.forms["m"] = {s2 .. "lli"}
loc = s2 .. "lli"
elseif stem:match(v.."[hġ].$") then
data.forms["m"] = {s2 .. "ġgi"}
loc = s2 .. "ġġi"
else
data.forms["m"] = {stem .. "ri"}
loc = stem .. "ri"
end
end
data.forms["ine"] = {(ine or loc) .. ce[1]}
data.forms["ill"] = {(ill or loc) .. ce[2]}
data.forms["ela"] = {(ela or loc) .. ce[3]}
data.forms["ade"] = {(ade or loc) .. ce[4]}
data.forms["all"] = {(all or loc) .. ce[5]}
data.forms["abl"] = {(abl or loc) .. ce[6]}
-- TODO: add alternative forms with table.insert
for n, case in pairs(cases) do
if stem:match(v.."[^t][^nbkmvslhġ][ae]$") then
table.insert(data.forms[case], s2 .. "h" .. ce[n])
end
end
end
})






return data
return data

Navigation menu