A modult a Modul:wa-headword/doc lapon tudod dokumentálni
local export = {}
function export.adjectives(frame)
local title = mw.title.getCurrentTitle()
local masculine_singular, feminine_singular, masculine_plural, feminine_plural
= 'm2', 'f', 'mp', 'pf' -- inconsistent!
local params = {
head = { default = title.text },
= {}, -- gender
= {}, -- masculine singular before vowel
= { list = true }, -- feminine singular
feminine = { alias_of = feminine_singular },
sf = { alias_of = feminine_singular },
= {},
mplural = { alias_of = masculine_plural },
= { list = true },
fplural = { alias_of = feminine_plural },
current = {}, -- current pagename?
sort = {},
cat = { alias_of = 'sort' },
}
local args = require "Module:parameters".process(frame:getParents().args, params)
local headword = {
lang = require "Module:languages".getByCode "wa",
}
local stem = args.current or title.text
if not args then
args = stem .. 'e'
end
args = args or stem .. 's'
for i, f_form in ipairs(args) do
if not args then
args = f_form .. 's'
end
end
local info = {
=
{ accel = {form = "m"}, label = 'masculine before vowel' },
=
{ accel = {form = "f|s"}, label = 'feminine singular' },
=
{ accel = {form = "m|p"}, label = 'masculine plural' },
=
{ accel = {form = "f|p"}, label = 'feminine plural' },
}
headword.heads = { args.head }
headword.inflections = {}
for _, form in ipairs { masculine_singular, masculine_plural,
feminine_singular, feminine_plural } do
local data = info
local inflection
if type(args) == 'table' then
inflection = { unpack(args) }
else
inflection = { args }
end
inflection.label = data.label
inflection.accel = data.accel
table.insert(inflections, inflection)
end
return require 'Module:headword'.full_headword(headword)
end
return export