Module:qhv-noun/data: Difference between revisions

Jump to navigation Jump to search
no edit summary
No edit summary
No edit summary
Line 1: Line 1:
local sub = mw.ustring.sub
local sub = mw.ustring.sub


local function l(v)
local function lengthen(v)
local switch = {["a"] = "ā", ["e"] = "ē", ["i"] = "ī", ["o"] = "ō", ["u"] = "ū", ["y"] = "ȳ"}
local switch = {["a"] = "ā", ["e"] = "ē", ["i"] = "ī", ["o"] = "ō", ["u"] = "ū", ["y"] = "ȳ"}
return switch[v] or v
return switch[v] or v
Line 70: Line 70:
local stem = args[1]
local stem = args[1]
local v = sub(stem, -2, -1)
local v = sub(stem, -2, -1)
local stemr = sub(stem, -1) == "m" and sub(stem, 1, -3) .. l(v) .. "b" or sub(stem, -1) == "n" and sub(stem, 1, -3) .. l(v) .. "d" or stem
local stemr = (sub(stem, -1) == "m" and sub(stem, 1, -3) .. lengthen(v) .. "b"
or sub(stem, -1) == "n" and sub(stem, 1, -3) .. lengthen(v) .. "d"
or stem)
data.decl_type = "aquatic first-declension"
data.decl_type = "aquatic first-declension"
table.insert(data.categories, "High Valyrian first-declension " .. (data.proper and "proper " or "") .. "nouns")
table.insert(data.categories, "High Valyrian first-declension " .. (data.proper and "proper " or "") .. "nouns")
Line 537: Line 539:
setmetatable(alldata["3-a"], {__call = function(self, args, data)
setmetatable(alldata["3-a"], {__call = function(self, args, data)
local stem = args[1]
local stem = args[1]
local stemr = sub(stem, -1) == "m" and sub(stem, 1, -2) .. "b" or sub(stem, -1) == "n" and sub(stem, 1, -2) .. "d" or stem
local stemr = (sub(stem, -1) == "m" and sub(stem, 1, -3) .. lengthen(v) .. "b"
or sub(stem, -1) == "n" and sub(stem, 1, -3) .. lengthen(v) .. "d"
or stem)
data.decl_type = "aquatic third-declension"
data.decl_type = "aquatic third-declension"
table.insert(data.categories, "High Valyrian third-declension " .. (data.proper and "proper " or "") .. "nouns")
table.insert(data.categories, "High Valyrian third-declension " .. (data.proper and "proper " or "") .. "nouns")
Line 844: Line 848:
setmetatable(alldata["5-a"], {__call = function(self, args, data)
setmetatable(alldata["5-a"], {__call = function(self, args, data)
local stem = args[1]
local stem = args[1]
local stemr = sub(stem, -1) == "m" and sub(stem, 1, -2) .. "b" or sub(stem, -1) == "n" and sub(stem, 1, -2) .. "d" or stem
local stemr = (sub(stem, -1) == "m" and sub(stem, 1, -3) .. lengthen(v) .. "b"
or sub(stem, -1) == "n" and sub(stem, 1, -3) .. lengthen(v) .. "d"
or stem)
local z = sub(stem, -2) == "rz"
local z = sub(stem, -2) == "rz"
local stemz = sub(stem, 1, -3)
local stemz = sub(stem, 1, -3)

Navigation menu