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


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 u = mw.ustring.char

for _, pos in ipairs({"nouns", "verbs", "adjectives"}) do
	labels[pos .. " with phonetic respelling"] = {
		description = "{{{langname}}} " .. pos .. " using phonetic respelling in their " ..
			(pos == "verbs" and "conjugation" or "declension") ..
			" tables due to irregular or unpredictable pronunciations.",
		additional = [=[
===See also===
* [[Wiktionary:Marathi transliteration]]
* [[Module:mr-translit]]]=],
		parents = {
			"terms by orthographic property", 
			"terms by phonemic property", 
			{name = pos, sort = "phonetic respelling"},
		},
	}
end
	
labels["nouns by gender and stem type"] = {
	description = "{{{langname}}} nouns categorized by gender and stem type.",
	parents = {{name = "nouns", sort = "gender and stem type"}},
	breadcrumb = "by gender and stem type",
}

table.insert(handlers, function(data)
	local gender, stem, pos
	gender, stem, pos = data.label:match("^([a-z]+ine) (independent unmarked [^ %-]*%-stem) (.*)s$")
	if not gender then
		gender, stem, pos = data.label:match("^([a-z]+) (independent [^ %-]*%-stem) (.*)s$")
	end
	if not gender then
		gender, stem, pos = data.label:match("^([a-z]+) (unmarked [^ %-]*%-stem) (.*)s$")
	end
	if not gender then
		gender, stem, pos = data.label:match("^([a-z]+) ([^ %-]*%-stem) (.*)s$")
	end
	if gender and pos == "noun" then
		local desc = "{{{langname}}} " .. gender .. " " .. stem .. " " .. pos .. "s."
		local additional
		if stem:find("independent") then
			additional = "* Here, 'independent' means that the stem ending directly " ..
			"follows a vowel and so uses the independent Devanagari form of the vowel that begins the ending."
		end
		if stem:find("unmarked") then
			additional = additional and additional .. "\n" or ""
			additional = additional .. "* Here, 'unmarked' means that the endings are added onto the full direct singular form " ..
			"without removing the stem ending."
		end
		return {
			description = desc,
			additional = additional,
			parents = {
				{name = pos .. "s by gender and stem type", sort = stem:gsub("independent ", ""):gsub("unmarked ", "")}
			},
			breadcrumb = gender .. " " .. stem,
		}
	end
end)

return {LABELS = labels, HANDLERS = handlers}