This module handles generating the descriptions and categorization for Greek category pages of the format "Greek 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 lang = require("Module:languages").getByCode("el")
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 = "Greek 1st conjugation verbs, categorized by inflection type. See also ].",
breadcrumb = "1st conjugation",
parents = {"verbs by inflection type"},
}
labels = { -- this is]
description = "Greek 1st conjugation verb groups, listed alphabetically (Greek) by the characteristic '''ending of their ]'''.",
additional = "See ], ] stems at the ].",
breadcrumb = "groups",
parents = {"1st conjugation verbs by inflection type"}, -- ]
}
labels = {
description = "Greek verb categories of the 1st conjugation with stems ending in a vowel. See ].",
breadcrumb = "vowel-stems",
parents = {"1st conjugation groups"},
}
local cons_stems = {
{"v(1)", "v<sup>1</sup>", "v1"},
{"v(2)", "v<sup>2</sup>", "v2"},
{"γ", "γ", "g"},
{"δ", "δ", "d"},
{"z", "z", "z"},
{"k", "k", "k"},
{"l", "l", "l"},
{"n", "n", "n"},
{"pt", "pt", "pt"},
{"p", "p", "p"},
{"r", "r", "r"},
{"s", "s", "s"},
{"ft", "ft", "ft"},
{"f", "f", "f"},
}
for _, cons_stem_data in ipairs(cons_stems) do
local cat_marker, display_form, appendix_anchor = unpack(cons_stem_data)
labels = {
description = "Greek verb categories of the 1st conjugation with stems ending in -" .. display_form .. "-. See ].",
breadcrumb = {name = display_form .. "-stem", nocap = true},
parents = {"1st conjugation groups"},
}
end
--------------------------------- Verb group data --------------------------------
groups = {}
like_verbs = {}
--[=[
The format of a group category ] is as follows:
groups = {CONJ, SORT_KEY, PARENT_CATEGORY, DESCRIPTION}
where
-- CONJ is the conjugation class (1st, 2nd);
-- SORT_KEY is the sort key used in the conjugation-group parent category
(e.g. ]);
-- PARENT_CATEGORY is the parent category used in the breadcrumbs at the top (minus the
word "Greek " at the beginning);
-- DESCRIPTION is the description text. COMPULSORY
In the description text, you can use templates, and you can also use the following:
-- "like<<VERB>>" expands to "] <<VERB>>",
where LINK is the same as VERB minus any boldface in it, and <<VERB>> is expanded as below;
-- <<VERB>> expands to "]", where LINK is the same as VERB minus any
boldface in it;
-- "like(VERB)" expands to "]"",
where LINK is the same as VERB minus any boldface in it.
The format of a "like-verb" category ] is as follows:
like_verbs = {CONJ, GROUP (or consonant category), BREADCRUMB_TEXT, DESCRIPTION} -- sort needed here, manual
where
-- CONJ is the conjugation class (1st, 2nd);
-- GROUP is the conjugation group (e.g. "κλείω", "κόβω");
-- or, links directly to cat-marker e.g. Category:Greek consonant-stem verbs in -X-
-- BREADCRUMB_TEXT is text that will appear in the breadcrumb at the top (e.g. the text
"active only verbs" in the like-verb "ισχύω" will produce the breadcrumb text
"active only verbs, like ισχύω", while the value 'nil' (without quotes around it)
in the like-verb "ισχύω" will result in just the breadcrumb text "ισχύω);
-- nil, = erases the comma
-- DESCRIPTION is not compulsory.
With like-verbs, you can leave out the BREADCRUMB_TEXT and/or DESCRIPTION. but an automatic text will be added.
]=]
-- 1st vowels ] -- ]
groups = {"1st", "vowel", "vowel-stem verbs", "" }
like_verbs = {"1st", "κλείω", nil, "" } -- breadcrumv adds an unwanted comma
groups = {"1st", "vowel", "vowel-stem verbs", "" }
like_verbs = {"1st", "λύω", "", ""}
like_verbs = {"1st", "λύω", "active only verbs", "" }
like_verbs = {"1st", "λύω", "passive only verbs", "" }
like_verbs = {"1st", "λύω", "passive only verbs imperfective", "" }
groups = {"1st", "vowel", "vowel-stem verbs", ""}
like_verbs = {"1st", "πνέω", nil, ""}
like_verbs = {"1st", "πνέω", "active only verbs", ""}
-- CONSONANT STEM ENDINGS as in international phonetic alphabet
-- v(1) with beta Category:Greek consonant-stem verbs in -v(1)-
groups = {"1st", "βω", "consonant-stem verbs in -v(1)-", "" }
like_verbs = {"1st", "κόβω", nil, ""}
groups = {"1st", "βω", "consonant-stem verbs in -v(1)-", ""}
like_verbs = {"1st", "σκάβω", nil, ""}
groups = {"1st", "βω", "consonant-stem verbs in -v(1)-", "" }
-- v(2) with upsilon Category:Greek consonant-stem verbs in -v(2)-
groups = {"1st", "βω2", "consonant-stem verbs in -v(2)-", ""}
like_verbs = {"1st", "-εύω combinations", "verbs"}
groups = {"1st", "βω2", "consonant-stem verbs in -v(2)-", ""}
like_verbs = {"1st", "δημοσιεύω", "active only verbs"}
like_verbs = {"1st", "δημοσιεύω", nil, ""}
like_verbs = {"1st", "δημοσιεύω", "passive only verbs"}
groups = {"1st", "βω2", "consonant-stem verbs in -v(2)-", "" }
like_verbs = {"1st", "μαζεύω"}
like_verbs = {"1st", "μαζεύω", "passive only verbs"}
like_verbs = {"1st", "μαζεύω", "active only verbs"}
-- γ greek Category:Greek consonant-stem verbs in -γ-
groups = {"1st", "γω", "consonant-stem verbs in -γ-", "" }
like_verbs = {"1st", "τυλίγω", "only active forms"}
like_verbs = {"1st", "τυλίγω", "active & passive forms"}
groups = {"1st", "γω", "consonant-stem verbs in -γ-", "" } -- + Category:Greek irregular verbs
like_verbs = {"1st", "εκλέγω", "active & passive forms"}
-- δ greek Category:Greek consonant-stem verbs in -δ-
groups = {"1st", "δω", "consonant-stem verbs in -δ-", "" }
-- z for greek zeta Category:Greek consonant-stem verbs in -z-
groups = {"1st", "ζω", "consonant-stem verbs in -z-", "" }
like_verbs = {"1st", "-άζω, -ίζω", nil, "" }
like_verbs = {"1st", "-άζω, -ίζω", "passive only verbs without passive perfect participle", "" }
like_verbs = {"1st", "-άζω, -ίζω", "with active forms only", "" }
like_verbs = {"1st", "-άζω, -ίζω", "with passive forms only, plus passive perfect participle", "" }
like_verbs = {"1st", "-άζω, -ίζω", nil, "" }
groups = {"1st", "ζω", "consonant-stem verbs in -z-", "" }
like_verbs = {"1st", "αγγίζω"}
like_verbs = {"1st", "αγγίζω", "active only verbs"}
groups = {"1st", "ζω", "consonant-stem verbs in -z-", "" }
like_verbs = {"1st", "αλλάζω"}
like_verbs = {"1st", "αλλάζω", "active only verbs"}
groups = {"1st", "ζω", "consonant-stem verbs in -z-", "" }
-- Category:Greek consonant-stem verbs in -k-
groups = {"1st", "κω", "consonant-stem verbs in -k-", "" }
groups = {"1st", "κω", "consonant-stem verbs in -k-", ""}
like_verbs = {"1st", "πλέκω"}
groups = {"1st", "κω2", "consonant-stem verbs in -k-", "" }
-- Category:Greek consonant-stem verbs in -l-
groups = {"1st", "λω", "consonant-stem verbs in -l-", "" }
like_verbs = {"1st", "αγγέλλω", "active & passive forms"}
-- Category:Greek consonant-stem verbs in -n-
-- groups = {"1st", "νω", "consonant-stem verbs in -n-", "" } -- this is identical to ]
-- directly to "consonant-stem verbs in -n-" TEST ]
-- sort parameter is needed for all like_verbs. manual (could be auto if there were tables of converting characters)
like_verbs = {"1st", "-", "with passive forms only"}
like_verbs = {"1st", "-"}
like_verbs = {"1st", "-", "with active forms only"}
like_verbs = {"1st", "-"}
groups = {"1st", "νω", "consonant-stem verbs in -n-", ""}
like_verbs = {"1st", "κλείνω"}
-- Category:Greek consonant-stem verbs in -p-
groups = {"1st", "πτω", "consonant-stem verbs in -pt-", "" }
groups = {"1st", "πτω", "consonant-stem verbs in -pt-", "" }
groups = {"1st", "πτω", "consonant-stem verbs in -pt-", ""}
like_verbs = {"1st", "καλύπτω"}
groups = {"1st", "πτω", "consonant-stem verbs in -pt-", ""}
groups = {"1st", "πτω", "consonant-stem verbs in -pt-", "" }
groups = {"1st", "πω", "consonant-stem verbs in -p-", "" }
like_verbs = {"1st", "λείπω", "active only verbs"}
like_verbs = {"1st", "λείπω"}
groups = {"1st", "πω", "consonant-stem verbs in -p-", "" }
like_verbs = {"1st", "τρέπω"}
-- Category:Greek consonant-stem verbs in -r-
groups = {"1st", "ρω", "consonant-stem verbs in -r-", "" }
like_verbs = {"1st", "μαρκάρω", nil, "" }
like_verbs = {"1st", "μαρκάρω"}
groups = {"1st", "ρω", "consonant-stem verbs in -r-", "" }
like_verbs = {"1st", "πακετάρω", "active only verbs"}
like_verbs = {"1st", "πακετάρω"}
-- Category:Greek consonant-stem verbs in -f-
groups = {"1st", "φτω", "consonant-stem verbs in -ft-", "" }
groups = {"1st", "φω", "consonant-stem verbs in -f-", "" }
like_verbs = {"1st", "αλείφω"}
groups = {"1st", "φω", "consonant-stem verbs in -f-", "" }
like_verbs = {"1st", "γράφω"}
groups = {"1st", "φω", "consonant-stem verbs in -f-", "" }
like_verbs = {"1st", "στρέφω"}
--------------------------------- Process verb group data --------------------------------
local function link_el(link, display)
-- For some reason, boldfaced characters don't display properly when done this way.
--return require("Module:links").full_link { lang = lang, term = link, alt = display, tr = "-" }
return "]"
end
local function expand_desc(desc)
desc = rsub(desc, "like<<(.-)>>", function(like)
return "like(" .. like:gsub("'", "") .. ") <<" .. like .. ">>"
end)
desc = rsub(desc, "like%((.-)%)", function(like)
return "]"
end)
desc = rsub(desc, "<<(-)|(-)>>", function(link, display)
return link_el(link, display)
end)
desc = rsub(desc, "<<(-)>>", function(link)
return link_el(link:gsub("'", ""), link)
end)
return mw.getCurrentFrame():preprocess(desc)
end
for group, groupdata in pairs(groups) do
local conj, conj_sort, breadcrumb_parent, desc = unpack(groupdata)
labels = {
description = "Greek verb categories in conjugation group '" .. group .. "', in the " .. conj .. " conjugation.",
additional = expand_desc(desc),
breadcrumb = { name = group, nocap = true},
-- if group == '-' then parents = {
-- { name = "consonant-stem verbs in -" .. cat_marker .. "-", sort = sort },
-- }, else
parents = {
{ name = breadcrumb_parent, sort = group },
-- { name = conj .. " conjugation groups", sort = conj_sort },
},
}
end
for likeverb, likedata in pairs(like_verbs) do
-- Don't use unpack because it can't handle nil in the middle (e.g. in breadcrumb_desc).
local conj = likedata
local group = likedata -- needed: option group = '-', only parent = 'Category:Greek consonant-stem verbs in -' .. cat_marker .. '-''
local breadcrumb_desc = likedata
local like_desc = likedata
local additional
local desc = "Greek verbs conjugating like " .. link_el(likeverb) .. ", in the '" .. group .. "' group, " ..
conj .. " conjugation."
if like_desc then
additional = expand_desc(like_desc)
end
local breadcrumb
if breadcrumb_desc then
breadcrumb = breadcrumb_desc .. ", like " .. likeverb -- need free text too without 'like blah blah'
else
breadcrumb = {name = likeverb, nocap = true}
end
labels = {
description = desc,
additional = additional,
breadcrumb = breadcrumb,
-- if group == '-' then parents = {
-- { name = "consonant-stem verbs in -" .. cat_marker .. "-", sort = sort },
-- }, else
parents = {
{ name = "verb conjugation group '" .. group .. "'", sort = likeverb },
-- { name = conj .. " conjugation verbs by inflection type", sort = likeverb }, -- no repetition
},
}
end
return {LABELS = labels}