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

Hello, you have come here looking for the meaning of the word Module:category tree/poscatboiler/data/lang-specific/ru. In DICTIOUS you will not only get to know all the dictionary meanings for the word Module:category tree/poscatboiler/data/lang-specific/ru, but we will also tell you about its etymology, its characteristics and you will know how to say Module:category tree/poscatboiler/data/lang-specific/ru in singular and plural. Everything you need to know about the word Module:category tree/poscatboiler/data/lang-specific/ru you have here. The definition of the word Module:category tree/poscatboiler/data/lang-specific/ru will help you to be more precise and correct when speaking or writing your texts. Knowing the definition ofModule:category tree/poscatboiler/data/lang-specific/ru, as well as those of other words, enriches your vocabulary and provides you with more and better linguistic resources.

This module handles generating the descriptions and categorization for Russian category pages of the format "Russian 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 = {}

local lang = require("Module:languages").getByCode("ru")
local rfind = mw.ustring.find
local rmatch = mw.ustring.match
local rsubn = mw.ustring.gsub

-- version of rsubn() that discards all but the first return value
local function rsub(term, foo, bar)
	local retval = rsubn(term, foo, bar)
	return retval
end


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

labels = {
	description = "Russian verbs categorized by class.",
	parents = {{name = "verbs by inflection type", sort = "class"}},
}

labels = {
	description = "Russian verbs categorized by class and accent pattern.",
	parents = {{name = "verbs by inflection type", sort = "class and accent pattern"}},
}

table.insert(handlers, function(data)
	local cls, variant, pattern = rmatch(data.label, "^class (*)(°?)(?) verbs$")
	if cls then
		if pattern == "" then
			return {
				description = "Russian class " .. cls .. " verbs.",
				breadcrumb = cls,
				parents = {{name = "verbs by class", sort = cls .. variant}},
			}
		else
			return {
				description = "Russian class " .. cls .. " verbs of " ..
					"accent pattern " .. pattern .. (
					variant == "" and "" or " and variant " .. variant) .. ". " .. (
					pattern == "a" and "With this pattern, all forms are stem-stressed."
					or pattern == "b" and "With this pattern, all forms are ending-stressed."
					or "With this pattern, the first singular present indicative and all forms " ..
					"outside of the present indicative are ending-stressed, while the remaining " ..
					"forms of the present indicative are stem-stressed.") .. (
					variant == "" and "" or
					cls == "3" and " The variant code indicates that the -н of the stem " ..
					"is missing in most non-present-tense forms." or
					" The variant code indicates that the present tense is not " ..
					"]. (In most verbs of this class, " ..
					"the present tense is iotated, e.g. иска́ть with present tense " ..
					"ищу́, и́щешь, и́щет, etc.)"),
				breadcrumb = cls .. variant .. pattern,
				parents = {
					{name = "class " .. cls .. " verbs", sort = pattern},
					{name = "verbs by class and accent pattern", sort = cls .. pattern},
				},
			}
		end
	end
end)


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

for _, plpos in ipairs { "adjectives", "surnames" } do
	labels = {
		description = "Russian " .. plpos .. " categorized by stem type and stress. " ..
			"Unlike for nouns, " .. plpos .. " are consistently either stem-stressed or ending-stressed.",
		breadcrumb = "by stem type and stress",
		parents = {{name = plpos .. " by inflection type", sort = "stem type and stress"}},
	}

	labels = {
		description = "Russian " .. plpos .. " where the ending is stressed. They end in " ..
			"{{lang|ru|-о́й}}, or in some cases {{lang|ru|-и́н}}, {{lang|ru|-о́в}}, or " ..
			"{{lang|ru|-ёв}}.",
		breadcrumb = "ending-stressed",
		parents = {{name = plpos .. " by inflection type", sort = "ending-stressed"}},
	}

	labels = {
		description = "Russian " .. plpos .. " categorized according to their irregularities.",
		breadcrumb = "by irregularity",
		parents = {{name = "irregular " .. plpos, sort = "irregularity"}},
	}
end

-- Should be no surnames like any of the following.
labels = {
	description = "Russian " .. "adjectives that have short forms. Short forms are used " ..
		"] and generally only for adjectives " ..
		"that are qualitative, i.e. can be modified with adverbs such as ], ], " ..
		"], ], etc.",
	parents = {{name = "adjectives", sort = "short forms"}},
}

labels = {
	description = "Russian adjectives that have short forms but where some of the short forms " ..
		"are missing. Short forms are used predicatively and generally only for adjectives that " ..
		"are qualitative, i.e. can be modified with adverbs such as ], ], " ..
		"], ], etc.",
	parents = {{name = "adjectives", sort = "missing short forms"}},
}

labels = {
	description = "Russian adjectives where the stem of the short forms is irregular compared " ..
		"with the stem of the remaining forms. Examples are {{m|ru|солёный||]}}" ..
		" (short forms {{lang|ru|со́лон, солона́, со́лоно, солоны́/со́лоны}}); " ..
		"{{m|ru|ма́ленький||]}} (short forms {{lang|ru|мал, мала́, мало́, малы́}}" ..
		"); and {{m|ru|большо́й||]}} (short forms " ..
		"{{lang|ru|вели́к, велика́, велико́, велики́}}. (In the latter two cases, the short forms " ..
		"come from the synonymous adjectives {{m|ru|ма́лый}} and {{m|ru|вели́кий}}" ..
		", respectively.)",
	parents = {{name = "irregular adjectives", sort = "short stem"}},
}

labels = {
	description = "Russian adjectives where the stem of the short forms is ]; " ..
		"specifically, the short masculine singular has an extra vowel inserted before the final " ..
		"consonant, compared with all other forms. Examples are most adjectives in {{m|ru|-кий}}" ..
		" and {{m|ru|-ный}}, e.g. {{m|ru|лёгкий||], ]}}" ..
		" with short masculine singular {{m|ru|лёгок}} and " ..
		"{{m|ru|де́льный||], ]}} with short masculine singular " ..
		"{{m|ru|де́лен}}.",
	parents = {{name = "adjectives", sort = "reducible short stem"}},
}

labels = {
	description = "Russian adjectives categorized according to their short accent pattern.",
	parents = {{name = "adjectives by inflection type", sort = "short accent pattern"}},
}

labels = {
	description = "Russian adjectives where the lemma form ends in {{lang|ru|-нный}} or " ..
		"{{lang|ru|-нний}} (with two {{lang|ru|н}}'s) but the short masculine singular ends " ..
		"in simply {{lang|ru|-н}} (i.e. with only one {{lang|ru|н}}). Examples are " ..
		"{{m|ru|самоуве́ренный||]}}, with short masculine singular " ..
		"{{m|ru|самоуве́рен}} (short feminine singular {{m|ru|самоуве́ренна}}, etc.); and " ..
		"{{m|ru|вы́спренний||]}}, with short masculine singular " ..
		"{{m|ru|вы́спрен}} (short feminine singular {{m|ru|вы́спрення}}, etc.). Contrast " ..
		"], where " ..
		"only one {{lang|ru|-н}} is present in '''all''' short forms.",
	parents = {{name = "adjectives", sort = "Zaliznyak short form special case 1"}},
}

-- Should be no surnames like the following.
labels = {
	description = "Russian adjectives where the lemma form ends in {{lang|ru|-нный}} (with two " ..
		"{{lang|ru|н}}'s) but all short forms end in only one {{lang|ru|-н}}. An example is " ..
		"{{m|ru|подве́рженный||] to, ] to, ] to}}, with short forms " ..
		"{{lang|ru|подве́ржен, подве́ржена, подве́ржено, подве́ржены}}. All past passive participles in " ..
		"{{lang|ru|-нный}} decline this way in their short forms, and most or all adjectives that " ..
		"decline this way are past passive participles in origin. Contrast " ..
		"], where " ..
		"only the short masculine singular is irregular in having only a single {{lang|ru|-н}}. " ..
		"Note that many terms decline both ways, declining as special case 2 as a participle and as " ..
		"special case 1 as an adjective. An example is {{m|ru|отвлечённый}}, with short forms " ..
		"{{lang|ru|отвлечён, отвлечена́, отвлечено́, отвлечены́}} when functioning as the past passive " ..
		"participle of {{m|ru|отвле́чь||to ], to ]}} but with short forms " ..
		"{{lang|ru|отвлечён, отвлечённа, отвлечённо, отвлечённы}} when functioning as an adjective meaning " ..
		'"abstract". For yet other terms, there are three possibilities: special case 2 as a participle, and ' ..
		"either special case 1 or 2 as an adjective, depending on meaning. Often the meaning difference is " ..
		"between experiencing a given feeling and expressing that feeling; for example, " ..
		"{{m|ru|влюблённый}} has short forms {{lang|ru|влюблён, влюблена́, влюблено́, влюблены́}}" ..
		" when functioning as the past passive participle of {{m|ru|влюби́ть||to ] to ]}}" ..
		' and also when functioning as an adjective meaning "amorous (i.e. experiencing feelings of love, of a person)"' ..
		", but has short forms {{lang|ru|влюблён, влюблённа, влюблённо, влюблённы}} when functioning as " ..
		'an adjective meaning "amorous (i.e. expressing feelings of love, of a look, tone, etc.)".',
	parents = {{name = "adjectives", sort = "Zaliznyak short form special case 2"}},
}

-- Should be no surnames like the following.
labels = {
	description = "Russian adjectives that exist '''only''' as short forms. This means they function " ..
		"only as ] adjectives. Examples are " ..
		"{{m|ru|рад||]}}, {{m|ru|до́лжен||], ], ], ]}}" ..
		", and {{m|ru|гора́зд||], ]}}.",
	parents = {{name = "adjectives", sort = "short-form-only"}},
}

-- Surnames and adjectives handled differently.
labels = {
	description = "Russian proper names (normally, surnames) that decline as adjectives. These are similar " ..
		"to possessive adjectives and have the same endings, i.e. {{m|ru|-ин}}/{{m|ru|-ын}} or " ..
		"{{m|ru|-ов}}/{{m|ru|-ев}}/{{m|ru|-ёв}}, but lack the neuter gender and " ..
		"decline slightly differently from possessive adjectives. For example, the surname {{m|ru|По́пов}}" ..
		" has prepositional singular {{m|ru|По́пове}}, while the possessive adjective " ..
		"{{m|ru|сы́нов||]'s}} has prepositional singular {{m|ru|сы́новом}}.",
	parents = {{name = "adjectives", sort = "proper-name"}},
}

labels = {
	description = "Russian surnames with a declension similar to possessive adjectives. These have the same endings " ..
		"as possessive adjectives, i.e. {{m|ru|-ин}}/{{m|ru|-ын}} or {{m|ru|-ов}}/{{m|ru|-ев}}/{{m|ru|-ёв}}, but lack " ..
		"the neuter gender and decline slightly differently. For example, the surname {{m|ru|По́пов}}" ..
		" has prepositional singular {{m|ru|По́пове}}, while the possessive adjective " ..
		"{{m|ru|сы́нов||]'s}} has prepositional singular {{m|ru|сы́новом}}.",
	parents = {{name = "surnames", sort = "possessive"}},
}

labels = {
	description = "Russian surnames organized by the type of inflection they follow.",
	breadcrumb = "by inflection type",
	parents = {{name = "surnames", sort = "inflection type"}},
}

labels = {
	description = "Russian surnames that follow non-standard patterns of inflection.",
	breadcrumb = "irregular",
	parents = {{name = "surnames by inflection type", sort = "irregular"}},
}

local stem_expl = {
	 = "a velar (-к, -г or –x)",
	 = "a sibilant (-ш, -ж, -ч or -щ)",
	 = "-ц",
	 = "-и (old-style -і)",
	 = "a vowel other than -и or -і, or -й or -ь",
	 = "a soft consonant",
	 = "a hard consonant",
}

local zaliznyak_stem_type = {
	 = "3",
	 = "4",
	 = "5",
	 = "7",
	 = "6",
	 = "2",
	 = "1",
	 = "8",
}

local adjective_stem_gender_endings = {
    masculine = {
		         = {"-ый", "-о́й"},
		            = {"-ый", "-о́й"},
		        = {"-ий", "-о́й"},
		     = {"-ий", "-о́й"},
		   = {"-ий", "-и́й"},
		  = {"a consonant (-ъ old-style)", "a consonant (-ъ old-style)"},
		  = {"a consonant (-ъ old-style)", "a consonant (-ъ old-style)"},
		 = {"a consonant (-ъ old-style)", "a consonant (-ъ old-style)"},
		 = "-ий",
		 = "-ий",
	},
    feminine = {
		         = {"-ая", "-а́я"},
		            = {"-ая", "-а́я"},
		        = {"-ая", "-а́я"},
		     = {"-ая", "-а́я"},
		   = {"-ья", "-ья́"},
		  = {"-а", "-а́"},
		  = {"-а", "-а́"},
		 = {"-а", "-а́"},
		 = "-яя",
		 = "-яя",
	},
    neuter = {
		         = {"-ое", "-о́е"},
		            = {"-ее", "-о́е"},
		        = {"-ое", "-о́е"},
		     = {"-ее", "-о́е"},
		   = {"-ье", "-ье́"},
		  = {"-о", "-о́"},
		  = {"-о", "-о́"},
		 = {"-о", "-о́"},
		 = "-ее",
		 = "-ее",
	},
	plural = {
		         = {"-ые", "-ы́е"},
		            = {"-ые", "-ы́е"},
		        = {"-ие", "-и́е"},
		     = {"-ие", "-и́е"},
		   = {"-ьи", "-ьи́"},
		  = {"-ы", "-ы́"},
		  = {"-ы", "-ы́"},
		 = {"-ы", "-ы́"},
		 = "-ие",
		 = "-ие",
	},
}

local adjective_numeral_stem_gender_endings = {
	plural = {
		         = {nil, "-еро"},
	}
}

local short_adjective_desc = {
	 = "stem stress on all short forms",
	 = "stem or ending stress on the feminine singular, stem stress on the other forms",
	 = "ending stress on all short forms (except the masculine singular)",
	 = "stem or ending stress on the plural, ending stress on the other forms (except the masculine singular)",
	 = "ending stress on the feminine singular, stem stress on the other forms",
	 = "stem or ending stress on the plural, ending stress on the feminine singular and stem stress on the neuter singular",
	 = "stem or ending stress on the neuter singular and plural, ending stress on the feminine singular",
}

table.insert(handlers, function(data)
	local function pos_is_adjectival(pos)
		return pos == "adjective" or pos == "surname"
	end
	
	local function fetch_endings(gender, stem, stress)
		if not adjective_stem_gender_endings then
			return nil
		end
		if stress == "possessive" then
			stem = stem .. " possessive"
			stress = "stem"
		end
		local endings = adjective_stem_gender_endings
		if endings then
			if type(endings) == "string" then
				return endings
			elseif stress == "stem" then
				return endings
			elseif stress == "ending" then
				return endings
			end
		end
		return nil
	end

	local breadcrumb, stem, stress, pos = rmatch(data.label, "^((*) (*)-stressed) (.*)s")
	if not stem then
		breadcrumb, stem, stress, pos = rmatch(data.label, "^((*) (possessive)) (.*)s")
	end
	if not stem then
		breadcrumb, stem, pos = rmatch(data.label, "^((*)) (*)s")
		stress = ""
	end
	if stem and (stress == "possessive" or stem_expl) and pos_is_adjectival(pos) then
		local stresstext = stress == "stem" and
			"This " .. pos .. " has stress on the stem, corresponding to Zaliznyak's type a." or
			stress == "ending" and
			"This " .. pos .. " has stress on the endings, corresponding to Zaliznyak's type b." or
			"All " .. pos .. "s of this type have stress on the stem."
		local m = fetch_endings("masculine", stem, stress)
		local f = fetch_endings("feminine", stem, stress)
		local n = fetch_endings("neuter", stem, stress)
		local p = fetch_endings("plural", stem, stress)
		if not m or not f or not n or not p then
			return nil
		end
		local endingtext = "ending in the nominative in masculine singular " .. m ..
			", feminine singular " .. f .. ", neuter singular " .. n .. " and plural " .. p .. "."
		local stemtext, posstext
		if stress == "possessive" then
			posstext = " possessive"
			if stem == "long" then
				stemtext = " The stem ends in a yod, which disappears in the nominative singular but appears in all other forms as a soft sign ь followed by a vowel."
			else
				stemtext = ""
			end
		else
			posstext = ""
			stemtext = " The stem ends in " .. stem_expl .. " and is Zaliznyak's type " .. zaliznyak_stem_type .. "."
		end
		return {
			description = "Russian " .. stem .. posstext .. " " .. pos .. "s, " .. endingtext .. stemtext .. " " .. stresstext,
			breadcrumb = breadcrumb,
			parents = {pos .. "s by stem type and stress"},
		}
	end
	
	local pos, shortaccent = rmatch(data.label, "^(*)s with short accent pattern (*)$")
	if shortaccent and short_adjective_desc and pos_is_adjectival(pos) then
		local escaped_accent = rsub(shortaccent, "'", "'")
		return {
			description = "Russian " .. pos .. "s with short accent pattern " .. escaped_accent .. ", with " ..
				short_adjective_desc .. ".",
			breadcrumb = { name = escaped_accent, nocap = true },
			parents = {{ name = pos .. "s by short accent pattern", sort = shortaccent }},
		}
	end

	local pos, irregularity = rmatch(data.label, "^(*)s with irregular (.*)$")
	if irregularity and pos_is_adjectival(pos) then
		return {
			description = "Russian " .. pos .. "s with irregular " .. irregularity .. " (possibly along with other cases).",
			breadcrumb = irregularity,
			parents = {{ name = pos .. "s by irregularity", sort = irregularity }},
		}
	end
end)


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

for _, pos in ipairs({"nouns", "pronouns", "numerals"}) do
	local sgpos = pos:gsub("s$", "")
	labels = {
		description = "Russian " .. pos .. " categorized by stem type and typical gender. " ..
			"Note that \"typical gender\" means the gender that is typical for the " .. sgpos .. "'s ending (e.g. most " .. pos .. " in ''-а'' are " ..
			"feminine, and hence all such " .. pos .. " are considered to be \"typically feminine\"; but some are in fact masculine).",
		parents = {{name = pos .. " by inflection type", sort = "stem type and gender"}},
	}

	labels = {
		description = "Russian " .. pos .. " categorized by stem type, typical gender and " ..
			"accent pattern. Note that \"typical gender\" means the gender that is typical for the " .. sgpos .. "'s ending (e.g. most " ..
			pos .. " in ''-а'' are feminine, and hence all such " .. pos .. " are considered to be \"typically feminine\"; but some are in " ..
			"fact masculine). See ] for further information on accent patterns.",
		parents = {{name = pos .. " by inflection type", sort = "stem type, gender and accent pattern"}},
	}

	labels = {
		description = "Russian " .. pos .. " categorized according to the presence of " ..
			"an irregular case or an unusual case (locative, partitive or vocative).",
		parents = {{name = pos, sort = "case form"}},
	}

	labels = {
		description = "Russian " .. pos .. " categorized according to their accent pattern (see ]).",
		parents = {{name = pos .. " by inflection type", sort = "accent pattern"}},
	}

	labels = {
		description = "Russian " .. pos .. " categorized by the ending in the nominative " ..
			"singular. This is currently used only for certain exceptional types of endings.",
		parents = {{name = pos, sort = "singular ending"}},
	}

	labels = {
		description = "Russian " .. pos .. " categorized by nominative singular and " ..
			"plural ending. This is used only for " .. pos .. " where one one of the endings is either irregular or a declensional " ..
			"suffix such as ''-ёнок'' or ''-ин''.",
		parents = {{name = pos, sort = "singular and plural ending"}},
	}

	labels = {
		description = "Russian " .. pos .. " categorized by the ending in the nominative " ..
			"plural. This is currently used only for certain exceptional types of endings.",
		parents = {{name = pos, sort = "plural ending"}},
	}

	labels = {
		description = "Russian " .. pos .. " 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"}},
	}
	
	labels = {
		description = "Russian " .. pos .. " in which the final {{lang|ru|н}} in the stem becomes {{lang|ru|нь}} when the stem is reduced.",
		breadcrumb = "soft final н in reduced stem",
		parents = {{name = pos .. " with reducible stem", sort = "soft final н in reduced stem"}},
	}

	labels = {
		description = "Russian " .. pos .. " with multiple argument sets (i.e. which can be declined according to multiple " ..
			"declensions that differ more than just in accent pattern).",
		parents = {{name = pos .. " by inflection type", sort = "multiple argument sets"}},
	}

	labels = {
		description = "Russian " .. pos .. " with multiple accent patterns. See ].",
		parents = {{name = pos .. " by inflection type", sort = "multiple accent patterns"}},
	}

	labels = {
		description = "Russian " .. pos .. " with adjectival endings.",
		parents = {pos},
	}

	labels = {
		description = "Russian " .. pos .. " with an irregular plural stem, which occurs in all cases.",
		parents = {{name = "irregular " .. pos, sort = "plural stem"}},
	}

	labels = {
		description = "Russian " .. pos .. " with mixed declension (i.e. with a different declension in the plural as compared " ..
			"with the singular).",
		parents = {{name = "irregular " .. pos, sort = "mixed declension"}},
	}

	labels = {
		description = "Russian " .. pos .. " using a specific alternative ending in the genitive plural: for masculine " ..
			pos .. ", no ending; for feminine " .. pos .. ", ''-ей'' (when this ending isn't otherwise expected); for neuter " ..
			pos .. ", ''-ев''. These " .. pos .. " are indicated by a ② in Zaliznyak's dictionary.",
		parents = {{name = "irregular " .. pos, sort = "alternative genitive plural"}},
	}
end

local noun_stem_gender_endings = {
    masculine = {
		      = {"a hard consonant (-ъ old-style)", "-ы"},
		         = {"-ц (-цъ old-style)", "-ы"},
		     = {"a velar (plus -ъ old-style)", "-и"},
		  = {"a sibilant (plus -ъ old-style)", "-и"},
		      = {"-ь", "-и"},
		         = {"-й", "-и"},
		     = {"-й", "-и"},
		 = {"-ь", "-и"},
	},
    feminine = {
		      = {"-а", "-ы"},
		         = {"-а", "-ы"},
		     = {"-а", "-и"},
		  = {"-а", "-и"},
		      = {"-я", "-и"},
		         = {"-я", "-и"},
		     = {"-я", "-и"},
		 = {"-ь", "-и"},
	},
    neuter = {
		      = {"-о", "-а"},
		         = {"-е", "-а"},
		     = {"-о", "-а"},
		  = {"-е", "-а"},
		      = {"-е", "-я"},
		         = {"-е", "-я"},
		     = {"-е", "-я"},
		 = {"-мя", "-мена"},
	},
}

table.insert(handlers, function(data)
	local function escape_accent(accent)
		return rsub(accent, "'", "'")
	end

	local function get_stem_gender_text(stem, gender, pos)
		if not noun_stem_gender_endings then
			return nil
		end
		local endings = noun_stem_gender_endings
		if not endings then
			return nil
		end
		local sgending, plending = endings, endings
		local stemtext =
			stem == "3rd-declension" and "" or
			" The stem ends in " .. stem_expl .. " and is Zaliznyak's type " .. zaliznyak_stem_type .. "."
		local decltext =
			stem == "3rd-declension" and "" or
			" This is traditionally considered to belong to the " .. (gender == "feminine" and "1st" or "2nd") .. " declension."
		return stem .. ", usually " .. gender .. " " .. pos .. "s, normally ending in " .. sgending .. " in the nominative singular " ..
			" and " .. plending .. " in the nominative plural." .. stemtext .. decltext
	end

	local stem, gender, accent, pos = rmatch(data.label, "^(.*) (.-) accent%-(.-) adjectival (.*)s$")
	if not stem then
		stem, gender, pos = rmatch(data.label, "^(.*) (.-) adjectival (.*)s$")
	end
	if stem then
		local possessive, stemtext
		local endings, sg, pl

		local function fetch_endings_1(endings_table, gender, stem, accent)
			if not endings_table then
				return nil
			end
			local endings = endings_table
			if endings then
				if type(endings) == "string" then
					return endings
				elseif accent == "a" then
					return endings
				elseif accent == "b" then
					return endings
				end
			end
			return nil
		end

		local function fetch_endings(gender, stem, accent)
			if pos == "numeral" then
				local retval = fetch_endings_1(adjective_numeral_stem_gender_endings, gender, stem, accent)
				if retval then
					return retval
				end
			end
			return fetch_endings_1(adjective_stem_gender_endings, gender, stem, accent)
		end

		sg = fetch_endings(gender, stem, accent)
		pl = fetch_endings("plural", stem, accent)

		if rfind(stem, "possessive") then
			possessive = "possessive "
			stem = rsub(stem, " possessive", "")
			stemtext = ""
		elseif stem_expl then
			possessive = ""
			stemtext = " The stem ends in " .. stem_expl .. " and is Zaliznyak's type " .. zaliznyak_stem_type .. "."
		end

		if (sg or gender == "plural-only") and pl and stemtext then
			local accentdesc = accent == "a" and
				"This " .. pos .. " is stressed according to accent pattern a (stress on the stem)." or
				accent == "b" and
				"This " .. pos .. " is stressed according to accent pattern b (stress on the ending)." or
				"All " .. pos .. "s of this class are stressed according to accent pattern a (stress on the stem)."
			local accenttext = accent and " accent-" .. accent or ""
			return {
				description = "Russian " .. stem .. " " .. gender .. " " .. pos .. "s, with " .. possessive ..
					"adjectival endings, ending in " .. (
						gender == "plural-only" and "" or sg .. " in the nominative singular and ") ..
					pl .. " in the nominative plural." .. stemtext .. " " .. accentdesc,
				breadcrumb = stem .. " " .. gender .. accenttext,
				parents = {
					{name = "adjectival " .. pos .. "s", sort = stem .. " " .. gender .. accenttext},
					pos .. "s by stem type, gender and accent pattern",
				},
			}
		end
	end

	local stem, gender, accent, pos = rmatch(data.label, "^(.-) (.-)%-form accent%-(.-) (.*)s$")
	if stem then
		local stem_gender_text = get_stem_gender_text(stem, gender, pos)
		if stem_gender_text then
			local accent_text = " This " .. pos .. " is stressed according to accent pattern " .. escape_accent(accent) .. "."
			return {
				description = "Russian " .. stem_gender_text .. accent_text,
				breadcrumb = "Accent-" .. escape_accent(accent),
				parents = {
					{name = stem .. " " .. gender .. "-form " .. pos .. "s", sort = accent},
					pos .. "s by stem type, gender and accent pattern",
				}
			}
		end
	end

	local stem, gender, pos = rmatch(data.label, "^(.-) (.-)%-form (.*)s$")
	if stem then
		local stem_gender_text = get_stem_gender_text(stem, gender, pos)
		if stem_gender_text then
			return {
				description = "Russian " .. stem_gender_text,
				breadcrumb = stem .. " " .. gender .. "-form",
				parents = {pos .. "s by stem type and gender"},
			}
		end
	end

	local pos, sg, pl = rmatch(data.label, "^(.*)s ending in (.*) with plural (.*)$")
	if sg then
		return {
			description = "Russian " .. pos .. "s ending in " .. sg .. " in the nominative singular, and " .. pl .. " in the nominative plural.",
			breadcrumb = {name = "singular " .. sg .. ", plural " .. pl, nocap = true},
			parents = {{name = pos .. "s by singular and plural ending", sort = sg .. " " .. pl}},
		}
	end

	local pos, sg = rmatch(data.label, "^(.*)s ending in (.*)$")
	if sg then
		return {
			description = "Russian " .. pos .. "s ending in " .. sg .. " in the nominative singular.",
			breadcrumb = {name = sg, nocap = true},
			parents = {{name = pos .. "s by singular ending", sort = sg}},
		}
	end

	local pos, pl = rmatch(data.label, "^(.*)s with plural (.*)$")
	if pl then
		return {
			description = "Russian " .. pos .. "s ending in " .. pl .. " in the nominative plural.",
			breadcrumb = {name = pl, nocap = true},
			parents = {{name = pos .. "s by plural ending", sort = pl}},
		}
	end

	local pos, accent = rmatch(data.label, "^(.*)s with accent pattern (.*)$")
	if accent then
		return {
			description = "Russian " .. pos .. "s with accent pattern " .. escape_accent(accent) .. ".",
			breadcrumb = {name = escape_accent(accent), nocap = true},
			parents = {{name = pos .. "s by accent pattern", sort = accent}},
		}
	end

	for _, number in ipairs({"singular", "plural"}) do
		local pos, case = rmatch(data.label, "^(.*)s with (+tive " .. number .. ")$")
		if case then
			-- partitive, locative, vocative
			return {
				description = "Russian " .. pos .. "s with a separate " .. case .. " case.",
				breadcrumb = case,
				parents = {{name = pos .. "s by case form", sort = case}},
			}
		end
	end

	for _, form in ipairs({"count form", "paucal form"}) do
		local pos = rmatch(data.label, "^(.*)s with " .. form .. "$")
		if pos then
			return {
				description = "Russian " .. pos .. "s with a separate " .. form .. ".",
				breadcrumb = form,
				parents = {{name = pos .. "s by case form", sort = form}},
			}
		end
	end

	local pos, case = rmatch(data.label, "^(.*)s with irregular (.*)$")
	if case then
		return {
			description = "Russian " .. pos .. "s with an irregular " .. case .. " case.",
			breadcrumb = case,
			parents = {{name = pos .. "s by case form", sort = case}},
		}
	end
end)

--------------------------------- Terms spelled with --------------------------------

labels = {
	description = "Russian terms in which the letter {{lang|ru|Е}} has been substituted for {{lang|ru|Ё}}.",
	additional = "In normal running text (outside of educational or reference material), the letter {{m|ru|ё}} is seldom used by native speakers, and is instead written as {{m|ru|е}}. It is still pronounced as {{lang|ru|ё}}, however. For example, {{m|ru|лёгкий}} is commonly written {{m|ru|легкий|tr=-}}, but still pronounced as the former. Wiktionary follows the dictionary style with {{lang|ru|ё}}, but forms with {{lang|ru|е}} are also allowed as alternative spellings.\n\n" ..
	"Terms written with {{lang|ru|е}} instead of {{lang|ru|ё}} should only be given word stress if it is also required when spelled with {{lang|ru|ё}} (e.g. {{lang|ru|ё}} occurs more than once, or it is a foreign borrowing where the stress falls elsewhere).\n\n" ..
	"Entries for spellings of this sort should use {{temp|ru-noun-alt-ё}}, {{temp|ru-verb-alt-ё}}, {{temp|ru-adj-alt-ё}} or {{temp|ru-pos-alt-ё}} to format an entire entry.\n\n" ..
	"====See also====\n" ..
	"In {{w|Reforms of Russian orthography|pre-1918 orthography}}, two other rare variations also occurred in a similar fashion:\n" ..
	"* ]\n" ..
	"* ]\n\n" ..
	"Following the reform, an apostrophe was sometimes substituted for the hard sign {{lang|ru|ъ}}:\n" ..
	"* ]",
	breadcrumb = "Е instead of Ё",
	catfix = true,
	parents = {
		{name = "terms by their individual characters", sort = "Е instead of Ё"},
		{name = "terms with irregular pronunciations", sort = "Е instead of Ё"},
	},
}

return {LABELS = labels, HANDLERS = handlers}