Pumunta sa nilalaman

Module:category tree/fam/sem-ara

Mula Wiksiyonaryo

This data submodule defines part of Wiktionary's category structure.

For an introduction to the category tree system and a description of how to add or modify categories, see Module:category tree/documentation.


local labels = {}

--[=[
This module handles language-specific categories for all Aramaic varieties.
]=]

-----------------------------------------------------------------------------
--                                                                         --
--                          		NOUNS			                       --
--                                                                         --
-----------------------------------------------------------------------------


---------------------------------- Noun labels ---------------------------------

local function add_noun_labels(labels)
	-- Currently there is no [[Appendix:Aramaic nominals]]. Formerly the code conditionalized on the language
	-- but only referenced [[Appendix:Assyrian Neo-Aramaic nominals]] (which also doesn't exist) for lang code 'aii',
	-- and was broken for all other languages. If we want to conditionalize on the language now, we have to make the
	-- description a function (in which case it will be passed an object whose `.lang` field is the language), or use
	-- a handler.
	local nominal_appendix = "Appendix:Aramaic nominals"
	local appendix_exists = mw.title.new(nominal_appendix).exists

	local function make_appendix_link(text, anchor)
		if appendix_exists then
			anchor = anchor or mw.getContentLanguage():ucfirst(text)
			return ("[[%s#%s|%s]]"):format(nominal_appendix, anchor, text)
		else
			return text
		end
	end

	labels["nouns by derivation type"] = {
		description = "{{{langname}}} nouns categorized by type of derivation.",
		breadcrumb = "by derivation type",
		parents = {{name = "nouns", sort = "derivation type"}},
	}

	labels["active nouns"] = {
		description = "{{{langname}}} " .. make_appendix_link("active nouns") .. ", i.e. nouns having the meaning \"one who does X\" for some verb.",
		breadcrumb_and_first_sort_base = "active nouns",
		parents = {"nouns by derivation type"},
	}
	
	labels["instance nouns"] = {
		description = "{{{langname}}} " .. make_appendix_link("instance nouns") .. ", i.e. nouns having the meaning \"an instance of doing X\" for some verb.",
		breadcrumb_and_first_sort_base = "instance nouns",
		parents = {"nouns by derivation type"},
	}

	labels["nouns of place"] = {
		description = "{{{langname}}} " .. make_appendix_link("nouns of place") .. ", i.e. nouns having the approximate meaning \"the place for doing X\" for some verb.",
		breadcrumb_and_first_sort_base = "nouns of place",
		parents = {"nouns by derivation type"},
	}

	labels["occupational nouns"] = {
		description = "{{{langname}}} " .. make_appendix_link("occupational nouns") .. ", i.e. nouns referring to people employed in doing something.",
		breadcrumb_and_first_sort_base = "occupational nouns",
		parents = {"nouns by derivation type"},
	}

	labels["tool nouns"] = {
		description = "{{{langname}}} " .. make_appendix_link("tool nouns") .. ", i.e. nouns having the approximate meaning \"tool for doing X\" for some verb.",
		breadcrumb_and_first_sort_base = "tool nouns",
		parents = {"nouns by derivation type"},
	}

	-- Add 'umbrella_parents' key if not already present.
	for key, data in pairs(labels) do
		if not data.umbrella_parents then
			data.umbrella_parents = "Lemmas subcategories by language"
		end
	end
end

-----------------------------------------------------------------------------
--                                                                         --
--                                 WRAPPERS                                --
--                                                                         --
-----------------------------------------------------------------------------

add_noun_labels(labels)

return {LABELS = labels}