มอดูล:category tree/topic cat/data

จาก วิกิพจนานุกรม พจนานุกรมเสรี

รายชื่อมอดูลย่อยทั้งหมด เทียบกับวิกิพจนานุกรมภาษาอังกฤษ ซึ่งสัมพันธ์กันแบบโครงสร้างต้นไม้ มีดังนี้

  • อนุญาตให้มี alias ภาษาอังกฤษ ที่เป็นชื่อเดิมของมันเท่านั้น เพื่อไม่ให้ความสัมพันธ์ขาดตอน หากมีจุดที่ไม่ได้แปล; ไม่ให้มี alias ภาษาไทย เพื่อไม่ให้หมวดหมู่ถูกสร้างขึ้นซ้ำซ้อน
  • ใส่ “(หัวข้อ)” ต่อท้าย เมื่อชื่อหัวข้อซ้ำกับวจีวิภาค (POS)

local labels = {}
local handlers = {}

local top_level_data_module = "มอดูล:category tree/topic cat/data"
local data_module_prefix = top_level_data_module .. "/"

local subpages = {
	"ร่างกาย",
	"อาคารและโครงสร้าง",
	"การสื่อสาร",
	"วัฒนธรรม",
		"ศาสนา",
	"โลก",
	"อาหารและเครื่องดื่ม",
	"เกม",
	"ประวัติศาสตร์",
	"มนุษย์",
		"บุคคล",
	"สิ่งมีชีวิต",
		"สัตว์",
		"พืช",
	"เบ็ดเตล็ด",
	"ชื่อ (หัวข้อ)",
		"สถานที่",
	"ธรรมชาติ",
	"จำนวน (หัวข้อ)",
	"ปรัชญา",
	"วิทยาศาสตร์",
		"คณิตศาสตร์",
	"เพศ",
	"การกระทำทางสังคม",
	"สังคม",
	"กีฬา",
	"เทคโนโลยี",
	--"Thesaurus", ไม่ได้ใช้เพราะไม่ได้มีรายการมาก
	"เวลา",
	"การคมนาคม",
	--"Physical actions",
}

labels["หัวข้อทั้งหมด"] = {
	type = "toplevel",
	description = "{{{langname}}} terms organized by topic, such as \"Family\", \"Chemistry\", \"Planets\", \"Canids\" or \"Cities in France\".",
	parents = {{module = "poscatboiler", args = {label = "{{{langcat}}}", raw = true, called_from_inside = true}}},
}
labels["all topics"] = labels["หัวข้อทั้งหมด"]

for _, typ in ipairs { "เกี่ยวข้อง", "ชุด", "ชนิด", "ชื่อ", "กลุ่ม" } do
	labels["รายชื่อหมวดหมู่" .. typ] = {
		type = "toplevel",
		description = "All " .. typ .. " categories currently available in {{{langname}}}.",
		parents = {{name = "หัวข้อทั้งหมด", sort = " *"}},
	}
end

labels["รายชื่อหมวดหมู่ผสม"] = {
	type = "toplevel",
	description = "All categories currently available in {{{langname}}} that belong to more than one type.",
	parents = {{name = "หัวข้อทั้งหมด", sort = " *"}},
}
labels["list of mixed categories"] = labels["รายชื่อหมวดหมู่ผสม"]

for label, data in pairs(labels) do
	data.module = top_level_data_module
end

-- Import subpages
for _, subpage in ipairs(subpages) do
	local datamodule = data_module_prefix .. 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}