Module:User:Benwing2/category tree/poscatboiler/data/lang-specific/uk

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


local labels = {}
local handlers = {}

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 = "Ukrainian verbs categorized by class.",
	parents = {{name = "verbs by inflection type", sort = "class"}},
}

labels = {
	description = "Ukrainian 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 = "Ukrainian class " .. cls .. " verbs.",
				breadcrumb = cls,
				parents = {{name = "verbs by class", sort = cls .. variant}},
			}
		else
			return {
				description = "Ukrainian 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 variant == "°" and " The variant code indicates that the -н of the stem " ..
					"is missing in most non-present-tense forms." or
					cls == "3" and (variant == "(°)" or variant == "") and
					" The variant code indicates that the -н of the stem " ..
					"is optionally missing in most non-present-tense forms." or
					cls == "6" and variant == "°" and
					" 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 --------------------------------

labels = {
	description = "Ukrainian adjectives categorized by stem type and stress. " ..
		"Unlike for nouns, adjectives are consistently either stem-stressed or ending-stressed.",
	parents = {{name = "adjectives by inflection type", sort = "stem type and stress"}},
}


local adj_stem_expl = {
	 = "-ц",
	 = "a vowel, or -й or -ь",
	 = "a soft consonant",
	 = "a hard consonant",
	 = "-ов, -єв, -ин or -їн",
}

local adj_decl_endings = {
	 = {"-ий", "-а", "-е", "-і"},
	 = {"-и́й", "-а́", "-е́", "-і́"},
	 = {"-ій", "-я", "-є", "-і"},
	 = {"-ий", "-я", "-е", "-і"},
	 = {"-їй", "-я", "-є", "-ї"},
	 = {"-", "-а", "-е", "-і"},
	 = {"-", "-а", "(nil)", "-и"},
}

table.insert(handlers, function(data)
	-- FIXME! Harmonize stem types here with stem types in 'adj_decl_endings' (used
	-- directly in adjectival nouns).
	local function stem_to_ending_type(stem, stress)
		if stem == "hard-stem" and stress == "stem" then
			return "hard stem-stressed"
		elseif stem == "hard-stem" and stress == "ending" then
			return "hard ending-stressed"
		elseif stress == "" then
			if stem == "soft-stem" then
				return "soft"
			elseif stem == "ц-stem" then
				return "c-stem"
			elseif stem == "vowel-stem" then
				return "j-stem"
			elseif stem == "possessive" then
				return "possessive"
			end
		end
		return nil
	end

	local breadcrumb, stem, stress = rmatch(data.label, "^((*) (*)-stressed) adjectives")
	if not breadcrumb then
		breadcrumb, stem = rmatch(data.label, "^((*)) adjectives")
		stress = ""
	end
	if breadcrumb then
		local ending_type = stem_to_ending_type(stem, stress)
		if ending_type and adj_stem_expl then
			local m, f, n, p = unpack(adj_decl_endings)
			local stresstext = stress == "stem" and
				"The adjectives in this category have stress on the stem." or
				stress == "ending" and
				"The adjectives in this category have stress on the endings." or
				"All adjectives of this type have stress on the stem."
			local endingtext = "ending in the nominative in masculine singular " .. m ..
				", feminine singular " .. f .. ", neuter singular " .. p .. " and plural " ..
				p .. "."
			local stemtext = " The stem ends in " .. adj_stem_expl .. "."
			return {
				description = "Ukrainian " .. stem .. " adjectives, " .. endingtext .. stemtext .. " " .. stresstext,
				breadcrumb = breadcrumb,
				parents = {"adjectives by stem type and stress"},
			}
		end
	end
end)


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

for _, pos in ipairs({"nouns", "pronouns", "numerals"}) do
	local sgpos = pos:gsub("s$", "")
	labels = {
		description = "Ukrainian " .. 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 = "Ukrainian " .. 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 = "Ukrainian " .. pos .. " categorized according to their vowel alternation pattern (e.g. ''і'' vs. ''о'').",
		parents = {{name = pos, sort = "vowel alternation"}},
	}

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

	labels = {
		description = "Ukrainian " .. 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 = "Ukrainian " .. pos .. " with multiple stems.",
		parents = {{name = pos .. " by inflection type", sort = "multiple stems"}},
	}

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

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

	labels = {
		description = "Ukrainian " .. pos .. " with an irregular stem, which occurs in all cases except the nominative singular and maybe the accusative singular.",
		parents = {{name = "irregular " .. pos, sort = "stem"}},
	}

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

local noun_stem_expl = {
	 = "a hard consonant",
	 = "a velar (-к, -г or –x)",
	 = "a hushing consonant (-ш, -ж, -ч or -щ)",
	 = "a soft consonant",
	 = "-ц",
	 = "conceptual -й",
	 = "-м' (with -ен- in some forms)",
	 = "-я or -а (with -т- in most forms)",
	 = "-ов, -єв, -ин or -їн",
	 = "-ов, -ів, -їв, -єв, -ин, -ін or -їн",
}

local noun_stem_to_declension = {
	 = "third",
	 = "fourth",
	 = "fourth",
	 = "fourth",
}

local noun_stem_gender_endings = {
    masculine = {
		              = {"a hard consonant", "-и"},
		        = {"a velar", "-и"},
		          = {"a hushing consonant or -р", "-і"},
		              = {"-ь or -р", "-і"},
		            = {"-й", "-ї"},
	},
    feminine = {
		              = {"-а", "-и"},
		          = {"-а", "-і"},
		              = {"-я", "-і"},
		            = {"-я", "-ї"},
		  = {"-ь, -р, a labial, or a hushing consonant", "-і"},
	},
    neuter = {
		              = {"-о", "-а"},
		        = {"-о", "-а"},
		          = {"-е", "-а"},
		              = {"-е", "-я"},
		            = {"-є", "-я"},
		 = {"-я", "-я"},
		            = {"-я or -а", "-та"},
		            = {"-я", "-я"},
	},
}

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

	local function get_stem_gender_text(stem, genderspec, pos)
		local gender = genderspec
		gender = rsub(gender, " in %-$", "")
		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 = noun_stem_expl and " The stem ends in " .. noun_stem_expl .. "." or ""
		local decltext =
			rfind(stem, "declension") and "" or
			" This is traditionally considered to belong to the " .. (
				noun_stem_to_declension or gender == "feminine" and "first" or "second"
			) .. " declension."
		local genderdesc
		if rfind(genderspec, "in %-$") then
			genderdesc = rsub(genderspec, "in (%-)$", pos .. "s ending in %1")
		else
			genderdesc = "usually " .. gender .. " " .. pos .. "s"
		end
		return stem .. ", " .. genderdesc .. ", 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, "^(.*) (.-) adjectival accent%-(.-) (.*)s$")
	if not stem then
		stem, gender, pos = rmatch(data.label, "^(.*) (.-) adjectival (.*)s$")
	end
	if stem and noun_stem_expl then
		local stemspec
		if stem == "hard" then
			stemspec = accent == "a" and "hard stem-stressed" or "hard ending-stressed"
		else
			stemspec = stem
		end
		local endings = adj_decl_endings
		if endings then
			local stemtext = " The stem ends in " .. noun_stem_expl .. "."
			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 ""
			local m, f, n, pl = unpack(endings)
			local sg =
				gender == "masculine" and m or
				gender == "feminine" and f or
				gender == "neuter" and n or
				nil
			return {
				description = "Ukrainian " .. stem .. " " .. gender .. " " .. pos ..
				"s, with adjectival endings, ending in " .. (sg and sg .. " in the nominative singular and " or "") ..
				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 part1, stem, gender, accent, part2, pos = rmatch(data.label, "^((.-) (.-)%-form) accent%-(.-)( (.*)s)$")
	local ending
	if not stem then
		-- check for e.g. 'Ukrainian hard masculine accent-a nouns in -о'
		part1, stem, gender, accent, part2, pos, ending = rmatch(data.label, "^((.-) (+ine)) accent%-(.-)( (.*)s in %-())$")
		if stem then
			gender = gender .. " in -" .. ending
		end
	end
	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) .. " (see ])."
			return {
				description = "Ukrainian " .. stem_gender_text .. accent_text,
				breadcrumb = "Accent-" .. escape_accent(accent),
				parents = {
					{name = part1 .. part2, sort = accent},
					pos .. "s by stem type, gender and accent pattern",
				}
			}
		end
	end

	local stem, gender, pos = rmatch(data.label, "^(.-) (.-)%-form (.*)s$")
	if not stem then
		-- check for e.g. 'Ukrainian hard masculine nouns in -о'
		stem, gender, pos, ending = rmatch(data.label, "^(.-) (+ine) (.*)s in %-()$")
		if stem then
			gender = gender .. " in -" .. ending
		end
	end
	if stem then
		local stem_gender_text = get_stem_gender_text(stem, gender, pos)
		if stem_gender_text then
			return {
				description = "Ukrainian " .. stem_gender_text,
				breadcrumb = ending and stem .. " " .. gender or stem .. " " .. gender .. "-form",
				parents = {pos .. "s by stem type and gender"},
			}
		end
	end

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

	local pos, fromto, altfrom, altto = rmatch(data.label, "^(.*)s with ((.*)%-(.*)) alternation$")
	if altfrom then
		return {
			description = "Ukrainian " .. pos .. "s with vowel alternation between " .. altfrom ..
				" in the lemma and " .. altto .. " in the last syllable of some or all remaining forms.",
			breadcrumb = {name = fromto, nocap = true},
			parents = {{name = pos .. "s by vowel alternation", sort = fromto}},
		}
	end
end)


return {LABELS = labels, HANDLERS = handlers}