Module:Category tree/poscatboiler/data/lang-specific/hsb
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 rfind = mw.ustring.find
local rmatch = mw.ustring.match
local unpack = unpack or table.unpack -- Lua 5.2 compatibility
local en_utilities_module = "Module:en-utilities"
--------------------------------- Adjectives --------------------------------
local adj_like_poses = {"形容詞", "代詞", "限定詞", "數詞", "後綴"}
for _, pos in ipairs(adj_like_poses) do
local plpos = pos
labels["硬音" .. plpos] = {
description = "{{{langname}}} hard-stem " .. plpos .. ".",
breadcrumb = "硬音",
parents = {{name = "依屈折分類的" .. plpos, sort = "hard-stem"}},
}
labels["軟音" .. plpos] = {
description = "{{{langname}}} soft-stem " .. plpos .. ".",
breadcrumb = "軟音",
parents = {{name = "依屈折分類的" .. plpos, sort = "soft-stem"}},
}
labels["有短形式的" .. plpos] = {
description = "{{{langname}}} " .. plpos .. " with short-form inflections.",
breadcrumb = "有短形式",
parents = {{name = "依屈折分類的" .. plpos, sort = "short forms"}},
}
end
--------------------------------- Nouns/Pronouns/Numerals --------------------------------
local possible_animacies = {"個人", "動物", "無生"}
local possible_genders = {"陽性", "陰性", "中性"}
for _, pos in ipairs({"名詞", "代詞", "數詞"}) do
local sgpos = pos:gsub("s$", "")
local function make_label(label, description, props)
local full_label
if rfind(label, "POS") then
full_label = label:gsub("POS", pos)
else
if label:find("的") then -- L10N
full_label = label .. pos
else
full_label = pos .. label
end
end
local full_description
if rfind(description, "POS") then
full_description = description:gsub("POS", pos)
else
full_description = pos .. " " .. description
end
full_description = "{{{langname}}} " .. full_description
props.description = full_description
if not props.breadcrumb then
props.breadcrumb = label:gsub("*POS*", "")
props.breadcrumb = mw.text.trim(props.breadcrumb)
end
labels[full_label] = props
end
make_label("形容詞性POS",
"with adjectival endings.",
{parents = {pos}}
)
make_label("依詞幹類型和性別分類的",
"categorized by stem type and gender.",
{parents = {name = "依屈折分類的" .. pos, sort = "stem type and gender"}}
)
make_label("that change gender in the plural",
"with a different gender in the singular vs. the plural, as determined by adjective concord.",
{
breadcrumb = "changing gender in the plural",
parents = {
{name = "依詞幹類型和性別分類的" .. pos, sort = "changing gender in the plural"},
{name = "不規則" .. pos, sort = "changing gender in the plural"},
},
}
)
for _, gender in ipairs(possible_genders) do
make_label("依詞幹類型分類的" .. gender .. "POS",
("%s POS categorized by stem type."):format(gender),
{
breadcrumb = gender,
parents = {"依詞幹類型和性別分類的" .. pos},
}
)
make_label(gender .. "形容詞性POS",
("%s adjectival POS."):format(gender),
{
breadcrumb = gender,
parents = {"形容詞性" .. pos},
}
)
make_label("無屈折" .. gender .. "POS",
("indeclinable %s POS. Currently only POS with multiple declensions including at least one that is "
.. "declinable are included."):format(gender),
{
breadcrumb = gender,
parents = {"無屈折" .. pos},
}
)
make_label("mostly indeclinable " .. gender .. " POS",
("mostly indeclinable %s POS, i.e. indeclinable in all but a few case/number combinations."
):format(gender),
{
breadcrumb = "mostly indeclinable",
parents = {"無屈折" .. gender .. pos},
}
)
end
make_label("with quantitative vowel alternation",
"with stem alternation between a long vowel (''á'', ''é'', ''í'', ''ou'' or ''ů'') and the corresponding " ..
"short vowel (''a'', ''e'', ''i'', ''o'' or ''u''), depending on the form.",
{
additional = ("See also [[:Category:{{{langname}}} %s with í-ě alternation]]."):format(pos),
parents = {name = pos, sort = "quantitative vowel alternation"},
}
)
make_label("有可簡化詞幹的",
"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, sort = "reducible stem"}}
)
make_label("有多種詞幹的",
"with multiple stems.",
{parents = {name = "依屈折分類的" .. pos, sort = "multiple stems"}}
)
make_label("陽性個人POS",
"masculine personal POS, i.e. POS referring (mostly) to male beings.",
{
breadcrumb = "個人",
parents = {{name = "陽性" .. pos, sort = "personal"}},
}
)
make_label("陽性動物POS",
"masculine animal POS, i.e. POS referring (mostly) to animals.",
{
breadcrumb = "動物",
parents = {{name = "陽性" .. pos, sort = "animal"}},
}
)
make_label("陽性無生POS",
"masculine inanimate POS, i.e. POS referring to inanimate objects that have masculine agreement patterns.",
{
breadcrumb = "無生",
parents = {{name = "陽性" .. pos, sort = "inanimate"}},
}
)
make_label("有規則外語變格的",
"with a foreign ending such as ''-us'', ''-os'', ''-es'', ''-um'', ''-on'' or silent ''-e'', which is dropped in " ..
"all cases except the nominative singular and maybe the accusative singular and vocative singular.",
{parents = {name = "依屈折分類的" .. pos, sort = "regular foreign declension"}}
)
make_label("有不規則詞幹的",
"with an irregular stem, which occurs in all cases except the nominative singular and maybe the accusative "
.. "singular and vocative singular.",
{parents = {name = "不規則" .. pos, sort = "stem"}}
)
end
local noun_stem_gender_endings = {
["陽性"] = {
["硬音詞幹"] = {"a paired hard or unpaired consonant", "''-a'' or ''-u'' if inanimate, ''-a'' otherwise", "''-ojo'' if personal, ''-y'' otherwise"},
["軟音詞幹"] = {"a paired soft or unpaired consonant", "''-a'' or ''-u'' if inanimate, ''-a'' otherwise", "''-ojo'' if personal, ''-e'' otherwise"},
["軟腭音詞幹"] = {"a velar", "''-a'' or ''-u'' if inanimate, ''-a'' otherwise", "''-ojo'' if personal, ''-i'' otherwise"},
},
["陰性"] = {
["硬音詞幹"] = {"a hard consonant + ''-a''", "''-y''", "''-y''"},
["軟音詞幹"] = {"a soft consonant optionally + ''-a''", "''-e''", "''-e''"},
["軟腭音詞幹"] = {"a velar + ''-a''", "''-i''", "''-i''"},
["v-詞幹"] = {"''-ej''", "''-wje''", "''-wje''"},
},
["中性"] = {
["硬音詞幹"] = {"a hard consonant + ''-o''", "''-a''", "''-a''"},
["軟音詞幹"] = {"a soft consonant + ''-e'' or sometimes ''-o''", "''-a''", "''-a''"},
["軟腭音詞幹"] = {"a velar + ''-o''", "''-a''", "''-a''"},
["n-詞幹"] = {"''-o''", "''-enja''", "''-enja''"},
["t-詞幹"] = {"''-o''", "''-eća''", "''-ata''"},
},
}
table.insert(handlers, function(data)
for _, gender in ipairs(possible_genders) do
-- check for e.g. '{{{langname}}} masculine hard-stem nouns' or '{{{langname}}} neuter n-stem nouns'
local stemtype, pos = rmatch(data.label, "^" .. gender .. "(.+詞幹)(.+)$")
local breadcrumb = stemtype
if stemtype then
if noun_stem_gender_endings[gender] then
local endings = noun_stem_gender_endings[gender][stemtype]
if endings then
local nom_s, gen_s, nom_p = unpack(endings)
local additional =
("This type normally ends in %s in the nominative singular; %s in the genitive singular; and %s in the nominative plural."):
format(nom_s, gen_s, nom_p)
return {
description = "{{{langname}}} " .. data.label .. ".",
additional = additional,
breadcrumb = breadcrumb,
parents = {
{name = "依詞幹類型分類的" .. gender .. pos, sort = stemtype:gsub("%-", "")}
},
}
end
end
end
end
end)
return {LABELS = labels, HANDLERS = handlers}