模組:Category tree/poscatboiler/data/lang-specific/nn

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

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


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

local gender_decls = {
	{"m", "consonant"},
	{"m", "a"},
	{"m", "an"},
	{"m", "i"},
	{"f", "consonant"},
	{"f", "ō"},
	{"f", "ōn"},
	{"f", "ijō"},
	{"n", "a"},
	{"n", "an"},
}

local gender_code_to_gender = {
	m = "masculine",
	f = "feminine",
	n = "neuter",
}

local seen_decls = {}

for _, pos in ipairs({"nouns"}) do
	for _, gender_decl in ipairs(gender_decls) do
		local gender, decl = unpack(gender_decl)
		if not seen_decls[decl] then
			labels[decl .. "-stem " .. pos] = {
				description = "Norwegian Nynorsk ''" .. decl .. "''-stem " .. pos .. ".",
				additional = "Note that the stem class is named from the perspective of Proto-Germanic, and the stem suffix may no longer be visible synchronically.",
				breadcrumb = {name = decl .. "-stem", nocap = decl ~= "consonant"},
				parents = {{
					name = pos .. " by inflection type",
					sort = decl,
				}},
			}
			seen_decls[decl] = true
		end
		gender = gender_code_to_gender[gender]
		labels[gender .. " " .. decl .. "-stem " .. pos] = {
			description = "Norwegian Nynorsk " .. gender .. " ''" .. decl .. "''-stem " .. pos .. ".",
			additional = "Note that the stem class is named from the perspective of Proto-Germanic, and the stem suffix may no longer be visible synchronically.",
			breadcrumb = gender .. " " .. decl .. "-stem",
			parents = {{
				name = pos .. " by inflection type",
				sort = decl,
			}, {
				name = decl .. "-stem " .. pos,
				sort = gender,
			}},
		}
	end
end


--------------------------------- Miscellaneous --------------------------------

local known_reform_years = require("Module:table/listToSet") {
	"1901", "1917", "1938", "1959", "2012"
}

table.insert(handlers, function(data)
	local year = data.label:match("^pre%-([0-9]+) forms$")
	if year then
		return {
			description = "{{{langname}}} forms that become nonstandard after " .. (
				known_reform_years[year] and (
					"the [[Wiktionary:Norwegian Nynorsk spelling reforms#%s|spelling reform of %s]]."
				):format(year, year) or (
					"[[Wiktionary:Norwegian Nynorsk spelling reforms|spelling decisions]] made in %s."
				):format(year)
			),
			breadcrumb = year,
			parents = {{name = "superseded forms", sort = year}},
		}
	end
end)

return {LABELS = labels, HANDLERS = handlers}