Module:Category tree/poscatboiler/data/lang-specific/zle-ono


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 = {}


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

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


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

--[=[
Noun declension specifications. The top-level key is the stem class, and the value is an object containing properties of
the stem class. If the stem class contains the word 'GENDER' in it, it expands into labels both for a parent category
that subsumes several genders (obtained by removing the word 'GENDER' and following whitespace) as well as
gender-specific children categories (obtained by replacing the word 'GENDER' with the genders specified in the
`possible_genders` field). The fields of the property object for a given stem class are as follows:
* `gender`: The description of the gender(s) of the stem class. If preceded by ~, the description is preceded by
  "most commonly". This appears in the `additional` field of the label properties. It is not used in gender-specific
  children categories; instead the gender of that category is used.
* `possible_genders`: The possible genders this class occurs in. If this is specified, the word 'GENDER' must occur in
  the stem class, and gender-specific variants of the stem class (with GENDER replaced by the possible genders) are
  handled along with a parent category subsuming all genders. 
* `singular`: The nominative singular ending. Use <...> to enclose Old Church Slavonic text; it will be given the
  appropriate language tag and italicized.
* `GENDER_singular`: The nominative singular ending for the GENDER variant of this stem class. If not specified, the
  value of `singular` is used.
* `plural`: The nominative plural ending.
* `GENDER_singular`: The nominative plural ending for the GENDER variant of this stem class. If not specified, the
  value of `plural` is used.
* `breadcrumb`: The breadcrumb for the category, appearing in the trail of breadcrumbs at the top of the page. If this
  stem has gender-specific variants, the breadcrumb specified here is used only for the parent category, while the
  gender-specific child categories use the gender as the breadcrumb. If not specified, it defaults to `sortkey`. If that
  is also not specified, or if the breadcrumb has the value "+", the stem class (without the word 'GENDER') is used.
  (Use "+" when a sortkey is specified but the stem class should be used as the breadcrumb.)
* `parent`: The parent category. If specified, the actual category label is formed by appending the part of speech (e.g.
  "nouns"). Defaults to "POS by inflection type" where POS is the part of speech. Note that gender-specific child
  categories do not use this, but always have the gender-subsuming parent stem class category as their parent.
* `sortkey`: The sort key used for sorting this category among its parent's children. Defaults to the stem class
  (without the word 'GENDER'). Note that gender-specific child categories do nto use this, but always use the gender
  as the sort key.
]=]
local noun_decls = {
	["硬音GENDERa-詞幹"] = {
		gender = "~feminine",
		possible_genders = {"陽性", "陰性"},
		singular = "<-а>",
		plural = "<-ꙑ>",
		breadcrumb = "+",
		sortkey = "a-stem",
	},
	["軟音GENDERa-詞幹"] = {
		gender = "~feminine",
		possible_genders = {"陽性", "陰性"},
		singular = "<-ꙗ> (or <-а> after an unpaired palatal consonant), or <-ꙑни>, or sometimes <-ии>/<-ьи>",
		masculine_singular = "<-ꙗ> (or <-а> after an unpaired palatal consonant), or <-ии>/<-ьи>",
		plural = "<-ѩ> (or <-ѧ> after an unpaired palatal consonant)",
		breadcrumb = "+",
		sortkey = "a-stem",
	},
	["GENDERi-詞幹"] = {
		gender = "~feminine (sometimes masculine)",
		possible_genders = {"陽性", "陰性"},
		singular = "<-ь>",
		plural = "<-и> (usually <-ьѥ> or <-иѥ> when masculine)",
		masculine_plural = "<-ьѥ> or <-иѥ>",
		feminine_plural = "<-и>",
	},
	["GENDERī-詞幹"] = {
		gender = "~feminine (masculine when referring to a person)",
		possible_genders = {"陽性", "陰性"},
		singular = "<-ии> or <-ьи>",
		plural = "<-иѭ> or <-ьѩ>",
		parent = "軟音a-詞幹",
	},
	["硬音GENDERo-詞幹"] = {
		gender = "masculine or neuter",
		possible_genders = {"陽性", "中性"},
		singular = "<-е> when masculine, <-о> when neuter",
		masculine_singular = "<-ъ>",
		neuter_singular = "<-о>",
		plural = "<-и> when masculine, <-а> when neuter",
		masculine_plural = "<-и>",
		neuter_plural = "<-а>",
		breadcrumb = "+",
		sortkey = "o-stem",
	},
	["軟音GENDERo-詞幹"] = {
		gender = "masculine or neuter",
		possible_genders = {"陽性", "中性"},
		singular = "<-ь> when masculine, <-ѥ> (or <-е> after an unpaired palatal consonant) when neuter",
		masculine_singular = "<-ь>",
		neuter_singular = "<-ѥ> (or <-е> after an unpaired palatal consonant)",
		plural = "<-и> when masculine, <-ꙗ> (or <-а> after an unpaired palatal consonant) when neuter",
		masculine_plural = "<-и>",
		neuter_plural = "<-ꙗ> (or <-а> after an unpaired palatal consonant)",
		breadcrumb = "+",
		sortkey = "o-stem",
	},
	["u-詞幹"] = {
		gender = "~masculine",
		singular = "<-ъ>",
		plural = "<-ове>",
	},
	["GENDERn-詞幹"] = {
		gender = "~masculine (nouns in <-мѧ> are neuter)",
		possible_genders = {"陽性", "中性"},
		singular = "<-ꙑ>, <-нь>, or <-мѧ>",
		masculine_singular = "<-ꙑ> or <-нь>",
		neuter_singular = "<-мѧ>",
		plural = "<-не> (or <-мена> if ending in <-мѧ)>",
		masculine_plural = "<-не>",
		neuter_plural = "<-мена>",
		parent = "輔音詞幹",
	},
	["nt-詞幹"] = {
		gender = "~neuter",
		singular = "<-ѧ>",
		plural = "<-ѧта>",
		parent = "輔音詞幹",
	},
	["r-詞幹"] = {
		gender = "~feminine",
		singular = "<-и>",
		plural = "<-ери>",
		parent = "輔音詞幹",
	},
	["s-詞幹"] = {
		gender = "~neuter",
		singular = "<-о> (<-е> after a palatal consonant)",
		plural = "<-еса>",
		parent = "輔音詞幹",
	},
	["v-詞幹"] = {
		gender = "~feminine",
		singular = "<-ꙑ>",
		plural = "<-ъви>",
		parent = "輔音詞幹",
	},
}

for _, pos in ipairs({"名詞"}) do
	local sgpos = pos:gsub("s$", "")
	labels["輔音詞幹" .. pos] = {
		description = "{{{langname}}} 輔音詞幹 " .. 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,
	}
	local function mark_ending(ending)
		return (ending:gsub("<(.-)>", "{{m|zle-ono||%1|tr=-}}"))
	end
	for full_decl, spec in pairs(noun_decls) do
		local most_commonly, gender = spec.gender:match("^(~)(.*)$")
		gender = gender or spec.gender
		local subgenders = spec.possible_genders
		local decl
		if subgenders then
			if not full_decl:find("GENDER") then
				error(("Internal error: Declension spec '%s' needs to have the word 'GENDER' in it, in all caps"):format(full_decl))
			end
			decl = full_decl:gsub("GENDER", "")
		else
			decl = full_decl
		end
		local breadcrumb = spec.breadcrumb or spec.sortkey or "+"
		if breadcrumb == "+" then
			breadcrumb = decl
		end
		labels[decl .. pos] = {
			description = "{{{langname}}} " .. decl .. pos .. "。",
			additional = ("These %s normally end in the singular in %s; in the plural in %s; and are %s%s."):format(
				pos, mark_ending(spec.singular), mark_ending(spec.plural), most_commonly and "most commonly " or "",
				mark_ending(gender)),
			breadcrumb = breadcrumb,
			parents = {{
				name = spec.parent and spec.parent .. pos or "依屈折分類的" .. pos,
				sort = spec.sortkey or decl,
			}},
		}
		if subgenders then
			for _, subgender in ipairs(subgenders) do
				local gender_decl = full_decl:gsub("GENDER", subgender)
				labels[gender_decl .. pos] = {
					description = "{{{langname}}} " .. gender_decl .. pos .. "。",
					additional = ("These %s normally end in the singular in %s; in the plural in %s; and are %s."):format(
						pos, mark_ending(spec[subgender .. "_singular"] or spec.singular),
						mark_ending(spec[subgender .. "_plural"] or spec.plural), subgender),
					breadcrumb = subgender,
					parents = {{
						name = decl .. pos,
						sort = subgender,
					}},
				}
			end
		end
	end
end


return {LABELS = labels, HANDLERS = handlers}
Category:Category tree資料模塊/poscatboiler Category:古諾夫哥羅德語模塊 Category:古諾夫哥羅德語資料模塊