跳转到内容

模組:Egl-adj

維基詞典,自由的多語言詞典


local m_utilities = require("Module:utilities")
local m_links = require("Module:links")
local m_hw = require("Module:headword")
local lang = require("Module:languages").getByCode("egl")
local infl = require("Module:egl-adj/data")
local export = {}

function export.show(frame)
	local pos = frame.args[1]
	local parargs = frame:getParent().args
	local params = {
		["head"] = {list = true},
		[1] = {required = true},
		[2] = {required = true},
	}
	local args = require("Module:parameters").process(parargs, params)
	local stem = args[1] or "" -- might be left blank
	local suffix = args[2]

	local data = {lang = lang, pos_category = pos, categories = {}, heads = args["head"], inflections = {}}
	
	table.insert(data.inflections, {label = "陽性複數", request = true, infl[suffix] and stem .. infl[suffix].mp or nil})
	table.insert(data.inflections, {label = "陰性", request = true, infl[suffix] and stem .. infl[suffix].f or nil})
	table.insert(data.inflections, {label = "陰性複數", request = true, infl[suffix] and stem .. infl[suffix].fp or nil})
	
	return m_hw.full_headword(data)
end

return export