モジュール:category tree/topic cat/data

出典: フリー多機能辞典『ウィクショナリー日本語版(Wiktionary)』
ナビゲーションに移動 検索に移動

このモジュールについての説明文ページを モジュール:category tree/topic cat/data/doc に作成できます

local labels = {}
local handlers = {}

local subpages = {
	"Body",
	"建築物",
	"コミュニケーション",
	"文化",
	"地球",
	"食品",
	"歴史",
	"人間",
	"生物",
		"動物",
		"植物",
	"数学",
	"Miscellaneous",
	"名前",
	"自然",
	"数",
	"人物",
	"哲学",
	"地名",
	"科学",
	"性行為",
	"Social acts",
	"社会",
	"スポーツ",
	"技術",
	"時間",
	"交通",
}

labels["all topics"] = {
	description = "{{{langname}}} terms organized by topic, such as \"Family\" or \"Chemistry\".",
	parents = {{module = "poscatboiler", args = {label = "{{{langcat}}}", raw = true, called_from_inside = true}}},
}

labels["list of topics"] = {
	description = "All topics currently available in {{{langname}}}.",
	parents = {{name = "all topics", sort = " *"}},
}

labels["all sets"] = {
	description = "{{{langname}}} terms that belong to a particular set of things, such as \"Planets\" or \"Canids\".",
	parents = {{module = "poscatboiler", args = {label = "{{{langcat}}}", raw = true, called_from_inside = true}}},
}

labels["list of sets"] = {
	description = "All sets currently available in {{{langname}}}.",
	parents = {{name = "all sets", sort = " *"}},
}

for label, data in pairs(labels) do
	data.module = "Module:category tree/topic cat/data"
end

-- Import subpages
for _, subpage in ipairs(subpages) do
	local datamodule = "Module:category tree/topic cat/data/" .. subpage
	local retval = require(datamodule)
	if not retval["LABELS"] then
		retval = {LABELS = retval}
	end
	for label, data in pairs(retval["LABELS"]) do
		if labels[label] and not retval["IGNOREDUP"] then
			error("Label " .. label .. " defined in both [["
				.. datamodule .. "]] and [[" .. labels[label].module .. "]].")
		end
		data.module = datamodule
		labels[label] = data
	end
	if retval["HANDLERS"] then
		for _, handler in ipairs(retval["HANDLERS"]) do
			table.insert(handlers, { module = datamodule, handler = handler })
		end
	end
end

return {LABELS = labels, HANDLERS = handlers}