Module:head/languages/lfv: Difference between revisions

ਕੋਈ ਸੋਧ ਸਾਰ ਨਹੀਂ
m (Maria moved page Module:head/lfv to Module:head/languages/lfv without leaving a redirect)
No edit summary
Line 2: Line 2:


local m_head = require("Module:head")
local m_head = require("Module:head")
local m_head_languages = require("Module:head/languages")
local m_parameters = require("Module:parameters")
local m_parameters = require("Module:parameters")
local lfv = require("Module:languages").get_by_code("lfv")
local lfv = require("Module:languages").get_by_code("lfv")


local function insert_if_any(inflections, arg, label, glossary)
local params = {
if not arg or #arg < 1 then return end
[1] = {list = true},
local inflection = {["label"] = label}
head = {},
if glossary then inflection["glossary"] = glossary end
}
for _, v in ipairs(arg) do table.insert(inflection, v) end
local inflection_params = {
table.insert(inflections, inflection)
adjective = {
pl = {label = "plural", glossary = true},
cmp = {label = "comparative", glossary = true},
rel = {label = "relative superlative", glossary = true},
abs = {label = "absolute superlative", glossary = true},
ela = {label = "elative", glossary = true},
pej = {label = "pejorative", glossary = true},
},
adverb = {
cmp = {label = "comparative", glossary = true},
rel = {label = "relative superlative", glossary = true},
abs = {label = "absolute superlative", glossary = true},
ela = {label = "elative", glossary = true},
},
noun = {
du = {label = "dual", glossary = true},
pl = {label = "plural", glossary = true},
dim = {label = "diminutive", glossary = true},
aug = {label = "augmentative", glossary = true},
pej = {label = "pejorative", glossary = true},
},
verb = {
pfv = {label = "perfective", glossary = true},
impfv = {label = "imperfective", glossary = true},
["pres-3s"] = {label = "3rd person singular present"},
["rem-3s"] = {label = "3rd person singular remote past"},
pass = {label = "passive participle"},
},
}
 
function export.adjective(frame)
local args, inflections = m_head_languages.get_args(frame:getParent().args, params, inflection_params.adjective)
return m_head.full_head{
term = mw.title.getCurrentTitle().text,
head = args["head"],
language = lfv,
pos = "adjective",
genders = args[1],
inflections = inflections,
}
end
end


function export.verb(frame)
function export.adverb(frame)
local args = m_parameters.process(frame:getParent().args, {
local args, inflections = m_head_languages.get_args(frame:getParent().args, params, inflection_params.adverb)
[1] = {list = true},
head = {},
pfv = {list = true},
impfv = {list = true},
pass = {list = true},
["pres-3s"] = {list = true},
["rem-3s"] = {list = true},
})
local inflections = {}
insert_if_any(inflections, args["pfv"], "perfective", true)
insert_if_any(inflections, args["impfv"], "imperfective", true)
insert_if_any(inflections, args["pres-3s"], "3rd person singular present")
insert_if_any(inflections, args["rem-3s"], "3rd person singular remote past")
insert_if_any(inflections, args["pass"], "passive participle")
return m_head.full_head{
return m_head.full_head{
term = mw.title.getCurrentTitle().text,
term = mw.title.getCurrentTitle().text,
head = args["head"],
head = args["head"],
language = lfv,
language = lfv,
pos = "verb",
pos = "adverb",
genders = args[1],
genders = args[1],
inflections = inflections,
inflections = inflections,
}
}  
end
end


function export.noun(frame)
function export.noun(frame)
local args = m_parameters.process(frame:getParent().args, {
local args, inflections = m_head_languages.get_args(frame:getParent().args, params, inflection_params.noun)
[1] = {list = true},
head = {},
du = {list = true},
pl = {list = true},
dim = {list = true},
aug = {list = true},
pej = {list = true},
})
local inflections = {}
insert_if_any(inflections, args["du"], "dual", true)
insert_if_any(inflections, args["pl"], "plural", true)
insert_if_any(inflections, args["dim"], "diminutive", true)
insert_if_any(inflections, args["aug"], "augmentative", true)
insert_if_any(inflections, args["pej"], "pejorative", true)
return m_head.full_head{
return m_head.full_head{
term = mw.title.getCurrentTitle().text,
term = mw.title.getCurrentTitle().text,
Line 60: Line 72:
language = lfv,
language = lfv,
pos = "noun",
pos = "noun",
genders = args[1],
inflections = inflections,
}
end
function export.verb(frame)
local args, inflections = m_head_languages.get_args(frame:getParent().args, params, inflection_params.verb)
return m_head.full_head{
term = m_head_languages.get_term(),
head = args["head"],
language = lfv,
pos = "verb",
genders = args[1],
genders = args[1],
inflections = inflections,
inflections = inflections,