A modult a Modul:yej-headword/doc lapon tudod dokumentálni
local export = {}
local lang = require("Module:languages").getByCode("yej")
local function get_params_list(args, argprefix)
local export = {}
i = 1
term = argprefix
while args ~= nil and args ~= "" do
table.insert(export, term)
i = i + 1
term = argprefix .. i
end
return export
end
local function get_params_list(args, argprefix)
local export = {}
i = 1
term = argprefix
while args ~= nil and args ~= "" do
table.insert(export, term)
i = i + 1
term = argprefix .. i
end
return export
end
local function otherscript(inflections, args)
local sc = require("Module:scripts").findBestScript(mw.title.getCurrentTitle().subpageText, lang)
local other_sc
if sc:getCode() == "Grek" then
other_sc = "Hebr"
elseif sc:getCode() == "Hebr" then
other_sc = "Grek"
end
other_sc = require("Module:scripts").getByCode(other_sc)
local inflection = {label = other_sc:getCanonicalName() .. " spelling"}
for i, head in ipairs(args) do
if head == "" then
head = mw.title.getCurrentTitle().subpageText
end
table.insert(inflection, {term = tr, sc = other_sc})
end
table.insert(inflections, inflection)
end
function export.basic(frame)
local params = {
= {list = true, default = ""},
= {list = true, allow_holes = true},
}
local args = require("Module:parameters").process(frame:getParent().args, params)
local data = {lang = lang, pos_category = frame.args, categories = {}, heads = args, genders = {}, inflections = {}}
otherscript(data.inflections, args)
return require("Module:headword").full_headword(data)
end
function export.adjective(frame)
local params = {
= {},
= {},
= {list = true, default = ""},
= {list = true, allow_holes = true},
}
local args = require("Module:parameters").process(frame:getParent().args, params)
local data = {lang = lang, pos_category = "adjectives", categories = {}, heads = args, genders = {}, inflections = {}}
if args then
table.insert(data.inflections, {label = "definite", args})
end
if args then
table.insert(data.inflections, {label = "comparative", args})
end
otherscript(data.inflections, args)
return require("Module:headword").full_headword(data)
end
local gender_cats = {
= "masculine",
= "feminine",
= "neuter",
= "masculine",
= "feminine",
= "neuter",
}
function export.noun(frame)
local params = {
= {list = true, default = "?"},
= {list = true, default = ""},
= {list = true, allow_holes = true},
}
local args = require("Module:parameters").process(frame:getParent().args, params)
local data = {lang = lang, pos_category = "nouns", categories = {}, heads = args, genders = args, inflections = {}}
for i, gender in ipairs(data.genders) do
if gender_cats then
table.insert(data.categories, lang:getCanonicalName() .. " " .. gender_cats .. " nouns")
else
data.genders = "?"
end
end
otherscript(data.inflections, args)
return require("Module:headword").full_headword(data)
end
--[[
local data = {lang = lang, pos_category = poscat, categories = {}, heads = make_params_array(args, get_params_list(args, "head")), translits = make_params_array(args, get_params_list(args, "tr")), genders = {}, inflections = {}}
local head = args; if head == "" then head = nil end; data.heads = head
--]]
function export.propernoun(frame)
local params = {
= {list = true, default = "?"},
= {list = true, default = ""},
= {list = true, allow_holes = true},
}
local args = require("Module:parameters").process(frame:getParent().args, params)
local data = {lang = lang, pos_category = "proper nouns", categories = {}, heads = args, genders = args, inflections = {}}
for i, gender in ipairs(data.genders) do
if gender_cats then
table.insert(data.categories, lang:getCanonicalName() .. " " .. gender_cats .. " nouns")
else
data.genders = "?"
end
end
otherscript(data.inflections, args)
return require("Module:headword").full_headword(data)
end
function export.verb(frame)
local params = {
= {},
= {list = true, default = ""},
= {list = true, allow_holes = true},
}
local args = require("Module:parameters").process(frame:getParent().args, params)
local data = {lang = lang, pos_category = "verbs", categories = {}, heads = args, genders = {}, inflections = {}}
if args == "impf" or args == "pf" then
table.insert(data.genders, args)
elseif args == "impf-pf" or args == "pf-impf" or args == "dual" or args == "ip" then
table.insert(data.genders, "impf")
table.insert(data.genders, "pf")
else
table.insert(data.genders, "?")
end
otherscript(data.inflections, args)
return require("Module:headword").full_headword(data)
end
return export