Module:parameters/data

From Wiktionary, the free dictionary
Jump to navigation Jump to search


local list_to_set = require("Module:table").listToSet

local function process_set_param(param)
	param.set = list_to_set(param.set)
	param.converted_set = true
	return param
end

local boolean = {type = "boolean"}
local empty_list = {}
local list = {list = true}
local list_allow_holes_separate_no_index = {list = true, allow_holes = true, separate_no_index = true}
local required = {required = true}
local required_default_ = {required = true, default = ""}
local required_lang_default_und = {required = true, type = "language", default = "und"}

local m = {}

-- [[Module:anchors]]

m["anchor"] = {
	[1] = {required = true, list = true, disallow_holes = true},
}
	
m["senseid"] = {
	[1] = required_lang_default_und,
	[2] = required_default_,
	tag = process_set_param{set = {"li", "p"}, default = "li"},
}
	
m["etymid"] = {
	[1] = required_lang_default_und,
	[2] = required_default_
}

-- [[Module:etymon]]
	
m["etymon"] = {
	[1] = required_lang_default_und,
	[2] = {list = true, disallow_holes = true},
	["id"] = required,
	["title"] = true,
	["tree"] = boolean,
	["text"] = true,
    ["exnihilo"] = boolean,
    ["pos"] = true
}

-- [[Module:translations]]

m["translation"] = {
	[1] = required_lang_default_und,
	[2] = true,
	[3] = list,
	["alt"] = true,
	["id"] = true,
	["sc"] = {type = "script"},
	["tr"] = true,
	["ts"] = true,
	["lit"] = true,
}

m["t-needed"] = {
	[1] = required_lang_default_und,
	[2] = process_set_param{set = {"usex", "quote"}},
	["nocat"] = boolean,
	["sort"] = true,
}

m["trans-top"] = {
	[1] = true,
	["id"] = true,
	["column-width"] = true,
}

m["trans-top-also"] = {
	[1] = required,
	[2] = list,
	["id"] = list_allow_holes_separate_no_index,
	["column-width"] = true,
}

m["checktrans-top"] = {
	[1] = true,
	["column-width"] = true,
}

m["trans-bottom"] = empty_list

m["trans-see"] = {
	[1] = required,
	[2] = list,
	["id"] = list_allow_holes_separate_no_index,
}

m["translation subpage"] = empty_list

m["no equivalent translation"] = {
	[1] = required_lang_default_und,
	["noend"] = boolean,
}

m["no attested translation"] = {
	[1] = required_lang_default_und,
	["noend"] = boolean,
	["sort"] = true,
}

m["not used"] = {
	[1] = required_lang_default_und,
	[2] = true,
}

return m