模組:Category tree/poscatboiler/data/lang-specific/zlw-ocs

維基詞典,自由的多語言詞典

This module handles generating the descriptions and categorization for 古捷克語 category pages of the format "古捷克語 LABEL" where LABEL can be any text. Examples are Category:Bulgarian conjugation 2.1 verbs and Category:Russian velar-stem neuter-form nouns. 該模块是 poscatboiler 系統的一部分,該系統是用於生成分類頁面的描述和分類的通用框架。

有關更多資訊,請參閱Module:category tree/poscatboiler/data/lang-specific/doc

注意:如果您新增了特定語言的模块,請將語言代碼新增至 Module:category tree/poscatboiler/data/lang-specific 頂部的清單中,使程式碼能識別該模块。


local labels = {}
local handlers = {}

local rfind = mw.ustring.find


--------------------------------- Nouns/Pronouns/Numerals --------------------------------

local noun_decls = {
	["硬音陽性a-詞幹"] = {
		singular = "-а",
		plural = "-y",
		gender = "陽性",
		sortkey = "a-詞幹",
	},
	["硬音陰性a-詞幹"] = {
		singular = "-а",
		plural = "-y",
		gender = "陰性",
		sortkey = "a-詞幹",
	},
	["軟音陽性a-詞幹"] = {
		singular = "-ě",
		plural = "-ě",
		gender = "陽性",
		sortkey = "a-詞幹",
	},
	["軟音陰性a-詞幹"] = {
		singular = "-ě",
		plural = "-ě",
		gender = "陰性",
		sortkey = "a-詞幹",
	},
	["陽性i-詞幹"] = {
		singular = "-",
		plural = "-i",
		gender = "陽性",
	},
	["陰性i-詞幹"] = {
		singular = "-",
		plural = "-i",
		gender = "陰性",
	},
	["ī-詞幹"] = {
		singular = "-ии or -ьи",
		plural = "-иѭ or -ьѩ",
		gender = "陰性(陽性when referring to a person)",
		parent = "soft a-詞幹",
	},
	["hard 陽性o-詞幹"] = {
		singular = "-",
		plural = "-i",
		gender = "陽性",
		sortkey = "o-詞幹",
	},
	["soft 陽性o-詞幹"] = {
		singular = "-",
		plural = "-i",
		gender = "陽性",
		sortkey = "o-詞幹",
	},
	["hard 中性o-詞幹"] = {
		singular = "-o",
		plural = "-а",
		gender = "中性",
		sortkey = "o-詞幹",
	},
	["soft 中性o-詞幹"] = {
		singular = "-e",
		plural = "-ě",
		gender = "中性",
		sortkey = "o-詞幹",
	},
	["u-詞幹"] = {
		singular = "-",
		plural = "-оvé",
		gender = "陽性",
	},
	["陽性n-詞幹"] = {
		singular = "-n",
		plural = "-ni",
		gender = "陽性",
		parent = "輔音詞幹",
	},
	["中性n-詞幹"] = {
		singular = "-ě",
		plural = "-ena",
		gender = "中性",
		parent = "輔音詞幹",
	},
	["陽性t-詞幹"] = {
		singular = "et",
		plural = "-ty",
		gender = "陽性",
		parent = "輔音詞幹",
	},
	["中性t-詞幹"] = {
		singular = "-ě",
		plural = "-ata",
		gender = "中性",
		parent = "輔音詞幹",
	},
	["r-詞幹"] = {
		singular = "-i",
		plural = "-ery",
		gender = "陰性",
		parent = "輔音詞幹",
	},
	["v-詞幹"] = {
		singular = "-ev",
		plural = "-ve",
		gender = "陰性",
		parent = "輔音詞幹",
	}
}

for _, pos in ipairs({"名詞"}) do
	local sgpos = pos:gsub("s$", "")
	labels["輔音詞幹 " .. pos] = {
		description = "古捷克語輔音詞幹 " .. pos .. ".",
		additional = "This is not a single declension class, but a set of related declension classes, with endings that are"
			.. " largely identical outside of the nominative, accusative and vocative.",
		breadcrumb = "輔音詞幹",
		parents = pos .. " by stem type and gender",
	}
	for decl, spec in pairs(noun_decls) do
		labels[decl .. pos] = {
			description = "古捷克語" .. decl .. " " .. pos .. ".",
			additional = "These " .. pos .. " normally end in " .. spec.singular .. " in the singular and " .. spec.plural .. " in the"
				.. " plural, and are most commonly " .. spec.gender .. ".",
			breadcrumb = decl,
			parents = {{
				name = spec.parent and spec.parent .. " " .. pos or pos .. " by stem type and gender",
				sort = spec.sortkey or decl,
			}},
		}
	end
end


--------------------------------- Verbs --------------------------------

local verb_classes = {
	["1"] = "whose infinitive ends in <<-ti>> directly following the root (or <<-ci>> for roots ending in a velar) and ending in <<-e>>, <<-é>> or <<-ie>> in the third singular present",
	["2"] = "ending in <<-núti>> in the infinitive and <<-ne>> in the third singular present",
	["3"] = "ending in <<-ěti>>, <<-éti>>, <<-ieti>> or <<-áti>> in the infinitive and <<-í>> or <<-ie>> in the third singular present",
	["4"] = "ending in <<-iti>> in the infinitive and <<-í>> in the third singular present",
	["5"] = "ending in Proto-Slavic {{m|sla-pro||*-ati}} or {{m|sla-pro||*-ěti}} in the infinitive (古捷克語<<-ati>>, <<-áti>>, <<-ěti>> or <<-ieti>>) and 古捷克語<<-e>> or <<-á>> in the third singular present",
	["6"] = "ending in <<-ovati>> in the infinitive and <<-uje>> in the third singular present",
}

for class, desc in pairs(verb_classes) do
	desc = desc:gsub("<<(.-)>>", "{{m|zlw-ocs||%1}}")
	labels["class " .. class .. " verbs"] = {
		description = ("古捷克語%s類動詞,%s。"):format(class, desc),
		breadcrumb = class .. "類",
		parents = {{name = "verbs by inflection type", sort = class}},
	}
end


--------------------------------- Adjectives --------------------------------

local adj_like_poses = {"形容詞", "代詞", "限定詞", "數詞", "後綴"}
for _, pos in ipairs(adj_like_poses) do
	local plpos = pos
	labels["硬音" .. plpos] = {
		description = "古捷克語hard " .. plpos .. ".",
		parents = {{name = "依屈折分類的" .. plpos, sort = "hard-詞幹"}},
	}
	labels["軟音" .. plpos] = {
		description = "古捷克語soft " .. plpos .. ".",
		parents = {{name = "依屈折分類的" .. plpos, sort = "soft-詞幹"}},
	}
	labels["有短形式的" .. plpos] = {
		description = "古捷克語" .. plpos .. " with short-form inflections.",
		parents = {{name = plpos .. " by inflection type", sort = "short forms"}},
	}
end


--------------------------------- Nouns/Pronouns/Numerals --------------------------------

local possible_genders = {"陽性個人", "陽性動物", "陽性inanimate", "陰性", "neuter"}

for _, pos in ipairs({"名詞", "代詞", "數詞"}) do
	local sgpos = pos:gsub("s$", "")
	
	local function make_label(label, description, props)
		local full_label
		if rfind(label, "POS") then
			full_label = label:gsub("POS", pos)
		else
			full_label = pos .. " " .. label
		end
		local full_description
		if rfind(description, "POS") then
			full_description = description:gsub("POS", pos)
		else
			full_description = pos .. " " .. description
		end
		full_description = "古捷克語" .. full_description
		props.description = full_description
		if not props.breadcrumb then
			props.breadcrumb = label:gsub(" *POS *", " ")
			props.breadcrumb = mw.text.trim(props.breadcrumb)
		end
		labels[full_label] = props
	end

	make_label("adjectival POS",
		"with adjectival endings.",
		{parents = {pos}}
	)

	make_label("by stem type and gender",
		"categorized by stem type and gender.",
		{parents = {name = pos .. " by inflection type", sort = "stem type and gender"}}
	)

	make_label("adjectival POS by stem type and gender",
		"adjectival POS categorized by stem type and gender.",
		{
			parents = {
				{name = pos .. " by inflection type", sort = "stem type and gender"},
				{name = "adjectival " .. pos, sort = "stem type and gender"},
			}
		}
	)

	for _, gender in ipairs(possible_genders) do
		make_label(gender .. " POS by stem type",
			("%s POS categorized by stem type."):format(gender),
			{
				breadcrumb = gender,
				parents = {pos .. " by stem type and gender"},
			}
		)
		make_label(gender .. " adjectival POS by stem type",
			("%s adjectival POS categorized by stem type."):format(gender),
			{
				breadcrumb = gender,
				parents = {"adjectival " .. pos .. " by stem type and gender"},
			}
		)
	end

	make_label("with quantitative vowel alternation",
		"with stem alternation between a long vowel (''á'', ''é'', ''í'', ''ó'' or ''ú'') and the corresponding " ..
		"short vowel (''a'', ''e'', ''i'', ''o'' or ''u''), depending on the form.",
		{
			additional = ("See also [[:Category:古捷克語%s with í-ě alternation]]."):format(pos),
			parents = {name = pos, sort = "quantitative vowel alternation"},
		}
	)

	make_label("with í-ě alternation",
		"with stem alternation between ''í'' and ''ě'', depending on the form.",
		{
			additional = ("See also [[:Category:古捷克語%s with quantitative vowel alternation]]."):format(pos),
			parents = {name = pos, sort = "í-ě alternation"},
		}
	)

	make_label("with actual gender different from declined gender",
		"declined with the endings of a particular gender but actually with a different gender, as shown by "
			.. "agreement patterns.",
		{
			additional = ("See also [[:Category:古捷克語%s with í-ě alternation]]."):format(pos),
			parents = {name = "irregular " .. pos, sort = "change gender"}
		}
	)

	make_label("that change gender in the plural",
		"with a different gender in the plural as compared with the singular, as shown by agreement patterns.",
		{
			additional = ("See also [[:Category:古捷克語%s with í-ě alternation]]."):format(pos),
			parents = {name = "irregular " .. pos, sort = "change gender"}
		}
	)

	make_label("with reducible stem",
		"with a reducible stem, where an extra vowel is inserted " ..
			"before the last stem consonant in the nominative singular and/or genitive plural.",
		{parents = {name = pos .. " by inflection type", sort = "reducible stem"}}
	)

	make_label("with multiple stems",
		"with multiple stems.",
		{parents = {name = pos .. " by inflection type", sort = "multiple stems"}}
	)

	make_label("陽性個人POS",
		"陽性個人POS, i.e. POS referring (mostly) to male human beings.",
		{
			breadcrumb = "個人",
			parents = {{name = "陽性" .. pos, sort = "個人"}},
		}
	)

	make_label("陽性動物POS",
		"陽性動物POS, i.e. POS referring (mostly) to male 動物s.",
		{
			breadcrumb = "動物",
			parents = {{name = "陽性" .. pos, sort = "動物"}},
		}
	)

	make_label("陽性無生POS",
		"陽性無生POS, i.e. POS referring to 無生objects that have 陽性agreement patterns.",
		{
			breadcrumb = "inanimate",
			parents = {{name = "陽性" .. pos, sort = "inanimate"}},
		}
	)

	make_label("with regular foreign declension",
		"with a foreign ending such as ''-us'', ''-os'', ''-es'', ''-um'', ''-on'' or silent ''-e'', which is dropped in " ..
		"all cases except the nominative singular and maybe the accusative singular and vocative singular.",
		{parents = {name = pos .. " by inflection type", sort = "regular foreign declension"}}
	)

	make_label("with irregular stem",
		"with an irregular stem, which occurs in all cases except the nominative singular and maybe the accusative "
		.. "singular and vocative singular.",
		{parents = {name = "irregular " .. pos, sort = "stem"}}
	)
end

return {LABELS = labels, HANDLERS = handlers}