Module:Category tree/poscatboiler/data/words by number of syllables: Difference between revisions
(Created page with "local labels = {} local handlers = {} labels["words by number of syllables"] = { description = "{{{langname}}} words categorized by number of syllables.", fundamental = "Te...") |
Djpwikiadmin (talk | contribs) No edit summary |
||
(One intermediate revision by one other user not shown) | |||
Line 1: | Line 1: | ||
local labels = {} | local labels = {} | ||
local raw_categories = {} | |||
local handlers = {} | local handlers = {} | ||
----------------------------------------------------------------------------- | |||
-- -- | |||
-- LABELS -- | |||
-- -- | |||
----------------------------------------------------------------------------- | |||
labels["words by number of syllables"] = { | labels["words by number of syllables"] = { | ||
description = "{{{langname}}} words categorized by number of syllables.", | description = "{{{langname}}} words categorized by number of syllables.", | ||
umbrella_parents = "Terms by lexical property subcategories by language", | |||
parents = {"terms by phonemic property"}, | parents = {"terms by phonemic property"}, | ||
} | } | ||
table.insert(handlers, function( | |||
local number = label:match("^([1-9][0-9]*)%-syllable words$") | |||
----------------------------------------------------------------------------- | |||
-- -- | |||
-- RAW CATEGORIES -- | |||
-- -- | |||
----------------------------------------------------------------------------- | |||
raw_categories["Words by number of syllables subcategories by language"] = { | |||
description = "Umbrella categories covering topics related to words categorized by their number of syllables.", | |||
additional = "{{{umbrella_meta_msg}}}", | |||
parents = { | |||
"Umbrella metacategories", | |||
{name = "words by number of syllables", is_label = true, sort = " "}, | |||
}, | |||
} | |||
----------------------------------------------------------------------------- | |||
-- -- | |||
-- HANDLERS -- | |||
-- -- | |||
----------------------------------------------------------------------------- | |||
table.insert(handlers, function(data) | |||
local number = data.label:match("^([1-9][0-9]*)%-syllable words$") | |||
if number then | if number then | ||
return { | return { | ||
Line 15: | Line 52: | ||
number == "1" and "{{{langname}}} words that are pronounced in " .. number .. " syllable." or | number == "1" and "{{{langname}}} words that are pronounced in " .. number .. " syllable." or | ||
"{{{langname}}} words that are pronounced in " .. number .. " syllables.", | "{{{langname}}} words that are pronounced in " .. number .. " syllables.", | ||
breadcrumb = number, | |||
umbrella_parents = "Words by number of syllables subcategories by language", | |||
parents = {{ | parents = {{ | ||
name = "words by number of syllables", | name = "words by number of syllables", | ||
Line 24: | Line 62: | ||
end) | end) | ||
return {LABELS = labels, HANDLERS = handlers} | return {LABELS = labels, RAW_CATEGORIES = raw_categories, HANDLERS = handlers} |
Latest revision as of 13:08, 3 September 2023
Documentation for this module may be created at Module:Category tree/poscatboiler/data/words by number of syllables/documentation
local labels = {}
local raw_categories = {}
local handlers = {}
-----------------------------------------------------------------------------
-- --
-- LABELS --
-- --
-----------------------------------------------------------------------------
labels["words by number of syllables"] = {
description = "{{{langname}}} words categorized by number of syllables.",
umbrella_parents = "Terms by lexical property subcategories by language",
parents = {"terms by phonemic property"},
}
-----------------------------------------------------------------------------
-- --
-- RAW CATEGORIES --
-- --
-----------------------------------------------------------------------------
raw_categories["Words by number of syllables subcategories by language"] = {
description = "Umbrella categories covering topics related to words categorized by their number of syllables.",
additional = "{{{umbrella_meta_msg}}}",
parents = {
"Umbrella metacategories",
{name = "words by number of syllables", is_label = true, sort = " "},
},
}
-----------------------------------------------------------------------------
-- --
-- HANDLERS --
-- --
-----------------------------------------------------------------------------
table.insert(handlers, function(data)
local number = data.label:match("^([1-9][0-9]*)%-syllable words$")
if number then
return {
description =
number == "1" and "{{{langname}}} words that are pronounced in " .. number .. " syllable." or
"{{{langname}}} words that are pronounced in " .. number .. " syllables.",
breadcrumb = number,
umbrella_parents = "Words by number of syllables subcategories by language",
parents = {{
name = "words by number of syllables",
sort = ("#%02d"):format(number),
}},
}
end
end)
return {LABELS = labels, RAW_CATEGORIES = raw_categories, HANDLERS = handlers}