Module:category tree/poscatboiler/data/lang-specific/vep

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

This module handles generating the descriptions and categorization for Veps category pages of the format "Veps LABEL" where LABEL can be any text. Examples are Category:Bulgarian conjugation 2.1 verbs and Category:Russian velar-stem neuter-form nouns. This module is part of the poscatboiler system, which is a general framework for generating the descriptions and categorization of category pages.

For more information, see Module:category tree/poscatboiler/data/lang-specific/documentation.

NOTE: If you add a new language-specific module, you must add the language code to the list at the top of Module:category tree/poscatboiler/data/lang-specific in order for the module to be recognized.


local labels = {}
local handlers = {}

------- Nominal categories -------

labels["nominals by declension"] = {
	description = "{{{langname}}} nouns and adjectives categorized by their declension type.",
	breadcrumb = "by declension",
	-- doesn't exist yet
	-- preceding = "{{mainapp|Veps declension}}",
	parents = {
		{name = "nouns", sort = "declension"},
		{name = "adjectives", sort = "declension"},
	},
}

table.insert(handlers, function(data)
	local nomtype = data.label:match("^(.*)%-type nominals$")
	if nomtype then
		return {
			description = ("{{{langname}}} ''%s''-type nominals."):format(nomtype),
			-- doesn't exist yet
			-- preceding = ("{{mainapp|Veps declension/%s}}"):format(nomtype),
			additional = ("Terms are added to this category using {{tl|vep-decl-%s}}."):format(nomtype),
			breadcrumb = {name = ("''%s''-type"):format(nomtype), nocap = true},
			parents = {"nominals by declension"},
		}
	end
end)

------- Verbal categories -------

labels["verbs by conjugation"] = {
	description = "{{{langname}}} verbs categorized by their conjugation type.",
	breadcrumb = "by conjugation",
	-- doesn't exist yet
	-- preceding = "{{mainapp|Veps conjugation}}",
	parents = {
		{name = "verbs", sort = "conjugation"},
	},
}

local defective_types = {
	["kaikaa"] = true,
}

table.insert(handlers, function(data)
	local verbtype = data.label:match("^(.*)%-type verbs$")
	if verbtype then
		local parents = {"verbs by conjugation"}
		return {
			description = ("{{{langname}}} ''%s''-type verbs."):format(verbtype),
			-- doesn't exist yet
			-- preceding = ("{{mainapp|Veps conjugation/%s}}"):format(verbtype),
			additional = ("Terms are added to this category using {{tl|vep-conj-%s}}."):format(verbtype),
			breadcrumb = {name = ("''%s''-type"):format(verbtype), nocap = true},
			parents = parents,
		}
	end
end)

local stem_vowels = {
	"-ä-",
	"-a-, past in -i-",
	"-a-, past in -oi-",
	"-e-",
	"-i-",
	"-o-",
	"-u-",
	"-ü-",
}

for _, stem_vowel in ipairs(stem_vowels) do
	local label_pref = "verbs with stem in "
	local linked_stem_vowel = stem_vowel:gsub("(%-.-%-)", "{{m|vep|%1}}")
	local italicized_stem_vowel = stem_vowel:gsub("(%-.-%-)", "{{m|vep||%1}}") 
	labels[label_pref .. stem_vowel] = {
		description = "{{{langname}}} " .. label_pref .. linked_stem_vowel .. ".",
		displaytitle = "{{{langname}}} " .. label_pref .. italicized_stem_vowel,
		breadcrumb = "stem in " .. italicized_stem_vowel,
		parents = {{name = "verbs by inflection type", sort = stem_vowel:gsub("^%-", "")}},
	}
end

labels["monosyllabic verbs"] = {
	description = "{{{langname}}} monosyllabic verbs.",
	breadcrumb = "monosyllabic",
	parents = {{name = "verbs by inflection type", sort = "1"}},
}


return {LABELS = labels, HANDLERS = handlers}