Module:category tree/topic cat/data

विक्षनरी से

This is the main data module for Module:category tree/topic cat. It does not contain data itself, but rather imports the data from its submodules, and applies some post-processing.

To add a new data submodule, add its name to the subpages list at the top of the module.


local labels = {}
local handlers = {}

local subpages = {
	"Body",
	"Buildings and structures",
	"Communication",
	"Culture",
	"Earth",
	--"Food and drink",
	"खान-पान की चीज़ें",
	"History",
	"Human",
	"Lifeforms",
		"Animals",
		"Plants",
	"Mathematics",
	"Miscellaneous",
	"Names",
	"Nature",
	"Numbers",
	"People",
	"Philosophy",
	"Places",
	"Sciences",
	"Sex",
	"Social acts",
	"Society",
	"Sports",
	"Technology",
	"Time",
	"Transport",
	"Physical actions",
}

labels["सभी विषय"] = {
	description = "{{{langname}}} के शब्द विषय अनुसार व्यवस्थित करके, जैसे कि \"परिवार\" अथवा \"रसायनशास्त्र\"।",
	parents = {{module = "poscatboiler", args = {label = "{{{langcat}}}", raw = true, called_from_inside = true}}},
}

labels["विषयों की सूची"] = {
	description = "सभी विषय जो वर्तमान में {{{langname}}} में उपलब्ध हैं।",
	parents = {{name = "सभी विषय", sort = " *"}},
}

labels["सभी समुच्चय"] = {
	description = "{{{langname}}} के शब्द जो किसी चीज के विशिष्ट समुच्चय से संबंधित हैं , जैसे कि \"ग्रह\" अथवा \" मांसभक्षी\"।",
	parents = {{module = "poscatboiler", args = {label = "{{{langcat}}}", raw = true, called_from_inside = true}}},
}

labels["समुच्चयों की सूची"] = {
	description = "सभी समुच्चय जो वर्तमान में {{{langname}}} में उपलब्ध हैं।",
	parents = {{name = "सभी समुच्चय", 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 .. " दोनों जगहों [["
				.. datamodule .. "]] और [[" .. 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}