Module:Category tree/poscatboiler/data/words by number of syllables: Difference between revisions

From The Languages of David J. Peterson
Jump to navigation Jump to search
(Created page with "local labels = {} local handlers = {} labels["words by number of syllables"] = { description = "{{{langname}}} words categorized by number of syllables.", fundamental = "Te...")
 
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.",
fundamental = "Terms by lexical property subcategories by language",
umbrella_parents = "Terms by lexical property subcategories by language",
parents = {"terms by phonemic property"},
parents = {"terms by phonemic property"},
}
}


table.insert(handlers, function(label)
 
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.",
fundamental = "Words by number of syllables subcategories by language",
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

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}