Module:auto cat/data: Difference between revisions

From Laenkea
Jump to navigation Jump to search
No edit summary
No edit summary
 
(137 intermediate revisions by 2 users not shown)
Line 5: Line 5:
-- %u = any language name (different to %l)
-- %u = any language name (different to %l)
-- %c = any language code
-- %c = any language code
-- %p = any part of speech
-- %ps = any part of speech (plural)
-- %s = any string
-- %s = any string
-------------------------
-------------------------
-- Please note that the order of patterns
-- Please note that the order of patterns
-- makes a difference!
-- makes a difference
-- Patterns higher up in the table will be
-- Patterns higher up in the table will be
-- matched against first.
-- matched against first.
-------------------------
-------------------------
return {
local subtopics = {
-- ["this is a subtopic of"] = "just this",
-- ["this is a subtopic of"] = {"this", "this too"},
-- LIFEFORMS
["animals"] = "lifeforms",
["birds"] = "animals",
["insects"] = "animals",
["plants"] = "lifeforms",
-- TECHNOLOGY
["computing"] = "technology",
["electronics"] = "technology",
-- TIME
["months"] = "time",
["seasons"] = "time",
["days"] = "time",
-- SCIENCES
["astronomy"] = "sciences",
["biology"] = "sciences",
["anatomy"] = {"biology", "medicine"},
["organs"] = {"anatomy"},
["botany"] = "biology",
["cytology"] = "biology",
["genetics"] = "biology",
["microbiology"] = "biology",
["molecular biology"] = "biology",
["physiology"] = "biology",
["taxonomy"] = "biology",
["taxonomic names"] = "taxonomy",
["taxonomic names %s"] = "taxonomic names",
["virology"] = "biology",
["zoology"] = "biology",
["chemistry"] = "sciences",
["inorganic chemistry"] = "chemistry",
["organic chemistry"] = "chemistry",
["sugars"] = "chemistry",
["biochemistry"] = {"biology","chemistry"},
["enzymes"] = "biochemistry",
["applied sciences"] = "sciences",
["metrology"] = "applied sciences",
["formal sciences"] = "sciences",
["logic"] = "formal sciences",
["mathematics"] = "formal sciences",
["algebra"] = "mathematics",
["arithmetic"] = "mathematics",
["calculus"] = "mathematics",
["geometry"] = "mathematics",
["statistics"] = "mathematics",
["trigonometry"] = "mathematics",
["trigonometric functions"] = "trigonometry",
["social sciences"] = "sciences",
["linguistics"] = "social sciences",
["phonetics"] = "linguistics",
["phonology"] = "linguistics",
["psychology"] = "social sciences",
["medicine"] = "sciences",
["pharmacology"] = "medicine",
["psychiatry"] = "medicine",
["surgery"] = "medicine",
["physics"] = "sciences",
["nuclear physics"] = "physics",
}
 
local pos = {
    "adjective",
    "adverb",
"article",
    "conjunction",
    "determiner",
    "interjection",
"noun",
    "numeral",
    "particle",
    "participle",
    "phrase",
    "postposition",
    "preposition",
    "pronoun",
    "proper noun",
    "symbol",
    "verb",
}
 
local cats = {
    {"Fundamental", {"Fundamental| "}},
   
    -- General maintenance
    {"Hidden categories", {"Fundamental| "}},
    {"Pages with script errors", {"Fundamental| "}},
    {"Pages marked as works in progress", {"Fundamental| "}},
    {"Obsolete", {"Fundamental| "}},
    {"%l active rhymes", {"Obsolete| "}},
    {"Label templates", {"Obsolete| "}},
    {"%s entries", {"Obsolete| "}},
   
     -- Languages
     -- Languages
     {"All languages", {"Fundamental"}},
     {"All languages", {"Fundamental| "}},
    {"%l language", {"All languages"}},
    {"%l language", {"All languages"}},
     {"%l images", {"%l language"}},
    {"%l images", {"%l language| "}},
    -- Encyclopedia
     {"Encyclopedia articles by language", {"Fundamental"}},
    {"%l encyclopedia articles", {"%l language| ", "Encyclopedia articles by language"}},
    {"Phrasebooks", {"Fundamental"}},
    -- Appendices
    {"Appendices", {"Fundamental| "}},
    {"Appendices by language", {"Appendices| "}},
    {"%l appendices", {"Appendices by language"}},
     -- Lexember
     -- Lexember
     {"Lexember 2023: %l", {"%l language"}},
     {"Lexember", {"Fundamental"}},
    {"Lexember 2023 Day %s: %l", {"Lexember 2023: %l"}},
    {"Lexember 2023", {"Lexember|2023"}},
    {"Lexember 2023 Day %s: %l", {"Lexember 2023: %l| ", "Lexember 2023 Day %s|%l"}},
    {"Lexember 2023 Day %s", {"Lexember 2023| "}},
    {"Lexember 2023: %l", {"%l language|Lexember 2023", "Lexember 2023|%l"}},
     -- Rhymes
     -- Rhymes
    {"Rhymes:%l/%s", {"Rhymes:%l"}},
    {"Rhymes:%l", {"%l language", "Rhymes"}},
     {"Rhymes", {"Fundamental"}},
     {"Rhymes", {"Fundamental"}},
    {"Inactive rhymes by language", {"Rhymes| "}},
    {"Rhymes:%l", {"%l language| ", "Rhymes|%l"}},
    {"Rhymes:%l/%s", {"Rhymes:%l|%s"}},
    {"%l inactive rhymes", {"Rhymes:%l| ", "Inactive rhymes by language"}},
     -- Lemmas by language
     -- Lemmas by language
     {"Lemmas by language", {"Fundamental"}},
     {"Lemmas by language", {"Fundamental| "}},
    {"Lemmas subcategories by language", {"Lemmas by language| "}},
    {"Lemmas subcategories by language", {"Lemmas by language| "}},
    {"%pos by language", {"Lemmas subcategories by language"}},
    {"Multiword terms by language", {"Lemmas subcategories by language"}},
    --[[
    {"%l multiword terms", {"%l language| ", "Multiword terms by language"}},
    {"Nouns by language", {"Lemmas subcategories by language"}},
{"Terms with multiple pronunciations by language", {"Lemmas subcategories by language"}},
    {"Verbs by language", {"Lemmas subcategories by language"}},
    {"%l terms with multiple pronunciations", {"%l language| ", "Terms with multiple pronunciations by language"}},
    {"Adjectives by language", {"Lemmas subcategories by language"}},
{"Terms with dialect pronunciations by language", {"Lemmas subcategories by language"}},
    {"Adverbs by language", {"Lemmas subcategories by language"}},
    {"%l terms with %s dialect pronunciation", {"%l language| ", "Terms with dialect pronunciations by language", "Terms with dialect pronunciations by language"}},
    {"Conjunctions by language", {"Lemmas subcategories by language"}},
    {"%ps by language", {"Lemmas by language| "}},
    {"Pronouns by language", {"Lemmas subcategories by language"}},
    {"%l lemmas", {"%l language| ", "Lemmas by language"}},
    {"Prepositions by language", {"Lemmas subcategories by language"}},
    {"%l %ps", {"%l lemmas|%ps", "%ps by language"}},
    {"Postpositions by language", {"Lemmas subcategories by language"}},
 
    {"Determiners by language", {"Lemmas subcategories by language"}},
    {"Interjections by language", {"Lemmas subcategories by language"}},
    {"Particles by language", {"Lemmas subcategories by language"}},
    {"Numerals by language", {"Lemmas subcategories by language"}},
    {"Phrases by language", {"Lemmas subcategories by language"}},
    {"Symbols by language", {"Lemmas subcategories by language"}},
    ]]--
    {"Multiword terms by language", {"Lemmas subcategories by language"}},
    -- Language lemmas
    {"%l lemmas", {"%l language", "Lemmas by language"}},
    {"%l %pos", {"%l lemmas", "%pos by language"}},
    --[[
    {"%l nouns", {"%l lemmas", "Nouns by language"}},
    {"%l verbs", {"%l lemmas", "Verbs by language"}},
    {"%l adjectives", {"%l lemmas", "Adjectives by language"}},
    {"%l adverbs", {"%l lemmas", "Adverbs by language"}},
    {"%l conjunctions", {"%l lemmas", "Conjunctions by language"}},
    {"%l pronouns", {"%l lemmas", "Pronouns by language"}},
    {"%l prepositions", {"%l lemmas", "Prepositions by language"}},
    {"%l postpositions", {"%l lemmas", "Postpositions by language"}},
    {"%l determiners", {"%l lemmas", "Determiners by language"}},
    {"%l interjections", {"%l lemmas", "Interjections by language"}},
    {"%l particles", {"%l lemmas", "Particles by language"}},
    {"%l numerals", {"%l lemmas", "Numerals by language"}},
    {"%l phrases", {"%l lemmas", "Phrases by language"}},
    {"%l symbols", {"%l lemmas", "Symbols by language"}},
    ]]--
    {"%l multiword terms", {"%l lemmas", "Multiword terms by language"}},
     -- Non-lemmas by language
     -- Non-lemmas by language
     {"Non-lemma forms by language", {"Fundamental"}},
     {"Non-lemma forms by language", {"Fundamental| "}},
    {"Non-lemma forms subcategories by language", {"Non-lemma forms by language| "}},
    {"Non-lemma forms subcategories by language", {"Non-lemma forms by language| "}},
    {"Verb forms by language", {"Non-lemma forms subcategories by language"}},
    {"%p forms by language", {"Non-lemma forms subcategories by language"}},
    {"Noun forms by language", {"Non-lemma forms subcategories by language"}},
    {"Suffix forms by language", {"Non-lemma forms subcategories by language"}},
    {"Adjective forms by language", {"Non-lemma forms subcategories by language"}},
    {"%l non-lemma forms", {"%l language| ", "Non-lemma forms by language"}},
    -- Language non-lemmas
    {"%l %p forms", {"%l non-lemma forms|%p forms", "%l %ps| ", "%p forms by language"}},
    {"%l non-lemma forms", {"%l language", "Non-lemma forms by language"}},
    {"%l %s %p forms", {"%l %p forms|%s"}},
    {"%l verb forms", {"%l verbs", "Verb forms by language"}},
    {"%l suffix forms", {"%l non-lemma forms|suffix forms", "%l suffixes| ", "Suffix forms by language"}},
    {"%l noun forms", {"%l nouns", "Noun forms by language"}},
    {"%l verbal nouns", {"%l non-lemma forms|verbal nouns", "%l nouns| ", "Verbal nouns by language"}},
    {"%l adjective forms", {"%l adjectives", "Adjective forms by language"}},
    {"Verbal nouns by language", {"Non-lemma forms subcategories by language"}},
    {"%l pronoun forms", {"%l pronouns", "Pronoun forms by language"}},
   
   
     -- Morphemes by language
     -- Morphemes by language
     {"Morphemes by language", {"Lemmas subcategories by language"}},
     {"Morphemes by language", {"Lemmas by language"}},
     {"Affixes by language", {"Lemmas subcategories by language"}},
     {"Affixes by language", {"Morphemes by language"}},
     {"Prefixes by language", {"Lemmas subcategories by language"}},
     {"Prefixes by language", {"Affixes by language| "}},
     {"Suffixes by language", {"Lemmas subcategories by language"}},
     {"Suffixes by language", {"Affixes by language| "}},
     {"Infixes by language", {"Lemmas subcategories by language"}},
     {"Infixes by language", {"Affixes by language| "}},
     {"Circumfixes by language", {"Lemmas subcategories by language"}},
     {"Circumfixes by language", {"Affixes by language| "}},
     {"Clitics by language", {"Lemmas subcategories by language"}},
     {"Clitics by language", {"Morphemes by language"}},
     -- Language morphemes
     -- Language morphemes
     {"%l morphemes", {"%l lemmas", "Morphemes by language"}},
     {"%l morphemes", {"%l lemmas", "Morphemes by language"}},
     {"%l affixes", {"%l morphemes", "%l lemmas", "Affixes by language"}},
     {"%l affixes", {"%l morphemes", "%l lemmas", "Affixes by language"}},
     {"%l prefixes", {"%l morphemes", "%l affixes", "Prefixes by language"}},
     {"%l prefixes", {"%l morphemes", "%l affixes", "Prefixes by language"}},
    {"%l %s prefixes", {"%l prefixes"}},
     {"%l suffixes", {"%l morphemes", "%l affixes", "Suffixes by language"}},
     {"%l suffixes", {"%l morphemes", "%l affixes", "Suffixes by language"}},
    {"Nominal suffixes by language", {"Lemmas subcategories by language"}},
    {"Verbal suffixes by language", {"Lemmas subcategories by language"}},
    {"Adjectival suffixes by language", {"Lemmas subcategories by language"}},
    {"%l nominal suffixes", {"%l suffixes", "Nominal suffixes by language"}},
{"%l adjectival suffixes", {"%l suffixes", "Adjectival suffixes by language"}},
    {"%l verbal suffixes", {"%l suffixes", "Verbal suffixes by language"}},
    {"%l %s suffixes", {"%l suffixes"}},
     {"%l infixes", {"%l morphemes", "%l affixes", "Infixes by language"}},
     {"%l infixes", {"%l morphemes", "%l affixes", "Infixes by language"}},
    {"%l %s infixes", {"%l infixes"}},
     {"%l circumfixes", {"%l morphemes", "%l affixes", "Circumfixes by language"}},
     {"%l circumfixes", {"%l morphemes", "%l affixes", "Circumfixes by language"}},
     {"%l clitics", {"%l morphemes", "Clitics by language"}},
     {"%l clitics", {"%l morphemes", "Clitics by language"}},
     -- Types of lemma by language
     -- Types of lemma by language
     {"Comparable adjectives by language", {"Lemmas subcategories by language"}},
     {"%ps with multiple genders by language", {"Lemmas subcategories by language"}},
     {"Uncomparable adjectives by language", {"Lemmas subcategories by language"}},
     {"%ps with multiple animacies by language", {"Lemmas subcategories by language"}},
     {"Possessive pronouns by language", {"Lemmas subcategories by language"}},
   
    {"Imperfective verbs by language", {"Lemmas subcategories by language"}},
    -- Language types of lemma *with cross-linguistic category*
    {"Perfective verbs by language", {"Lemmas subcategories by language"}},
     {"%s %ps by language", {"Lemmas subcategories by language"}},
    {"Biaspectual verbs by language", {"Lemmas subcategories by language"}},
    {"%l comparable %ps", {"%l %ps| ", "Comparable %ps by language"}},
    {"Transitive verbs by language", {"Lemmas subcategories by language"}},
    {"%l uncomparable %ps", {"%l %ps| ", "Uncomparable %ps by language"}},
    {"Intransitive verbs by language", {"Lemmas subcategories by language"}},
{"%l spatial prepositions", {"%l prepositions| ", "Spatial prepositions by language"}},
    {"Auxiliary verbs by language", {"Lemmas subcategories by language"}},
{"%l temporal prepositions", {"%l prepositions| ", "Temporal prepositions by language"}},
    {"Copulative verbs by language", {"Lemmas subcategories by language"}},
    {"%l possessive pronouns", {"%l pronouns| ", "Possessive pronouns by language"}},
    {"Deponent verbs by language", {"Lemmas subcategories by language"}},
    {"%l relative pronouns", {"%l pronouns| ", "Relative pronouns by language"}},
    {"Ditransitive verbs by language", {"Lemmas subcategories by language"}},
    {"%l imperfective verbs", {"%l verbs| ", "Imperfective verbs by language"}},
    {"Impersonal verbs by language", {"Lemmas subcategories by language"}},
    {"%l perfective verbs", {"%l verbs| ", "Perfective verbs by language"}},
    {"Stative verbs by language", {"Lemmas subcategories by language"}},
    {"%l biaspectual verbs", {"%l verbs| ", "Biaspectual verbs by language"}},
    {"Passive verbs by language", {"Lemmas subcategories by language"}},
    {"%l transitive verbs", {"%l verbs| ", "Transitive verbs by language"}},
    {"Reflexive verbs by language", {"Lemmas subcategories by language"}},
    {"%l intransitive verbs", {"%l verbs| ", "Intransitive verbs by language"}},
    {"Mediopassive verbs by language", {"Lemmas subcategories by language"}},
    {"%l auxiliary verbs", {"%l verbs| ", "Auxiliary verbs by language"}},
    {"Neuter nouns by language", {"Lemmas subcategories by language"}},
    {"%l copulative verbs", {"%l verbs| ", "Copulative verbs by language"}},
    {"Feminine nouns by language", {"Lemmas subcategories by language"}},
    {"%l deponent verbs", {"%l verbs| ", "Deponent verbs by language"}},
    {"Masculine nouns by language", {"Lemmas subcategories by language"}},
    {"%l ditransitive verbs", {"%l verbs| ", "Ditransitive verbs by language"}},
    {"Common nouns by language", {"Lemmas subcategories by language"}},
    {"%l impersonal verbs", {"%l verbs| ", "Impersonal verbs by language"}},
    {"Dualia tantum by language", {"Lemmas subcategories by language"}},
    {"%l stative verbs", {"%l verbs| ", "Stative verbs by language"}},
    {"Pluralia tantum by language", {"Lemmas subcategories by language"}},
    {"%l passive verbs", {"%l verbs| ", "Passive verbs by language"}},
    {"Inanimate nouns by language", {"Lemmas subcategories by language"}},
    {"%l reflexive verbs", {"%l verbs| ", "Reflexive verbs by language"}},
    {"Animate nouns by language", {"Lemmas subcategories by language"}},
    {"%l mediopassive verbs", {"%l verbs| ", "Mediopassive verbs by language"}},
    {"Personal nouns by language", {"Lemmas subcategories by language"}},
    {"%l neuter %ps", {"%l %ps| ", "Neuter %ps by language"}},
    {"Nonpersonal nouns by language", {"Lemmas subcategories by language"}},
    {"%l feminine %ps", {"%l %ps| ", "Feminine %ps by language"}},
    {"Animal nouns by language", {"Lemmas subcategories by language"}},
    {"%l masculine %ps", {"%l %ps| ", "Masculine %ps by language"}},
    {"Nonvirile nouns by language", {"Lemmas subcategories by language"}},
    {"%l common %ps", {"%l %ps| ", "Common %ps by language"}},
    {"Virile nouns by language", {"Lemmas subcategories by language"}},
    {"%l inanimate %ps", {"%l %ps| ", "Inanimate %ps by language"}},
    {"Nouns with multiple genders by language", {"Lemmas subcategories by language"}},
    {"%l animate %ps", {"%l %ps| ", "Animate %ps by language"}},
    {"Nouns with multiple animacies by language", {"Lemmas subcategories by language"}},
    {"%l personal %ps", {"%l %ps| ", "Personal %ps by language"}},
    -- Language types of lemma
    {"%l nonpersonal %ps", {"%l %ps| ", "Nonpersonal %ps by language"}},
    {"%l comparable adjectives", {"%l adjectives", "Comparable adjectives by language"}},
    {"%l animal %ps", {"%l %ps| ", "Animal %ps by language"}},
    {"%l uncomparable adjectives", {"%l adjectives", "Uncomparable adjectives by language"}},
    {"%l nonvirile %ps", {"%l %ps| ", "Nonvirile %ps by language"}},
    {"%l possessive pronouns", {"%l pronouns", "Possessive pronouns by language"}},
    {"%l virile %ps", {"%l %ps| ", "Virile %ps by language"}},
    {"%l imperfective verbs", {"%l verbs", "Imperfective verbs by language"}},
 
    {"%l perfective verbs", {"%l verbs", "Perfective verbs by language"}},
{"Singularia tantum by language", {"Lemmas subcategories by language"}},
    {"%l biaspectual verbs", {"%l verbs", "Biaspectual verbs by language"}},
    {"%l singularia tantum", {"%l nouns| ", "Singularia tantum by language"}},
    {"%l transitive verbs", {"%l verbs", "Transitive verbs by language"}},
{"Dualia tantum by language", {"Lemmas subcategories by language"}},
    {"%l intransitive verbs", {"%l verbs", "Intransitive verbs by language"}},
    {"%l dualia tantum", {"%l nouns| ", "Dualia tantum by language"}},
     {"%l auxiliary verbs", {"%l verbs", "Auxiliary verbs by language"}},
{"Pluralia tantum by language", {"Lemmas subcategories by language"}},
    {"%l copulative verbs", {"%l verbs", "Copulative verbs by language"}},
    {"%l pluralia tantum", {"%l nouns| ", "Pluralia tantum by language"}},
     {"%l deponent verbs", {"%l verbs", "Deponent verbs by language"}},
     {"%ps with multiple genders by language", {"Lemmas subcategories by language"}},
    {"%l ditransitive verbs", {"%l verbs", "Ditransitive verbs by language"}},
    {"%l %ps with multiple genders", {"%l %ps| ", "%ps with multiple genders by language"}},
    {"%l impersonal verbs", {"%l verbs", "Impersonal verbs by language"}},
     {"%ps with multiple animacies by language", {"Lemmas subcategories by language"}},
    {"%l stative verbs", {"%l verbs", "Stative verbs by language"}},
    {"%l %ps with multiple animacies", {"%l %ps| ", "%ps with multiple animacies by language"}},
    {"%l passive verbs", {"%l verbs", "Passive verbs by language"}},
    {"%l reflexive verbs", {"%l verbs", "Reflexive verbs by language"}},
{"Diminutive %ps by language", {"Lemmas subcategories by language"}},
    {"%l mediopassive verbs", {"%l verbs", "Mediopassive verbs by language"}},
{"%l diminutive %ps", {"%l %ps| ", "Diminutive %ps by language"}},
    {"%l neuter nouns", {"%l nouns", "Neuter nouns by language"}},
{"%l %s diminutive %ps", {"%l diminutive %ps| "}},
    {"%l feminine nouns", {"%l nouns", "Feminine nouns by language"}},
{"Augmentative %ps by language", {"Lemmas subcategories by language"}},
     {"%l masculine nouns", {"%l nouns", "Masculine nouns by language"}},
{"%l augmentative %ps", {"%l %ps| ", "Augmentative %ps by language"}},
     {"%l common nouns", {"%l nouns", "Common nouns by language"}},
{"%l %s augmentative %ps", {"%l augmentative %ps| "}},
    {"%l dualia tantum", {"%l nouns", "Dualia tantum by language"}},
     {"%l pluralia tantum", {"%l nouns", "Pluralia tantum by language"}},
    -- Radestrian-specific non-automatic PoS subcategories
    {"%l inanimate nouns", {"%l nouns", "Inanimate nouns by language"}},
    {"Radestrian pluralia binaria", {"Radestrian nouns| "}},
    {"%l animate nouns", {"%l nouns", "Animate nouns by language"}},
    {"Radestrian pluralia binaria tantum", {"Radestrian nouns| ", "Radestrian pluralia binaria| "}},
    {"%l personal nouns", {"%l nouns", "Personal nouns by language"}},
   
    {"%l nonpersonal nouns", {"%l nouns", "Nonpersonal nouns by language"}},
     {"%l %s %ps", {"%l %ps| "}}, -- sorts all other PoS descriptors under the PoS but not under a cross-linguistic category (e.g. Virile nouns by language). More for language-specific PoS subcategories.
     {"%l animal nouns", {"%l nouns", "Animal nouns by language"}},
   
    {"%l nonvirile nouns", {"%l nouns", "Nonvirile nouns by language"}},
     -- Stems
    {"%l virile nouns", {"%l nouns", "Virile nouns by language"}},
    {"%l terms by stem type", {"%l language| "}},
    {"%l nouns with multiple genders", {"%l nouns", "Nouns with multiple genders by language"}},
    {"%l %s stems", {"%l terms by stem type"}},
    {"%l nouns with multiple animacies", {"%l nouns", "Nouns with multiple animacies by language"}},
   
    -- Government
     {"Lemmas government by language", {"Lemmas subcategories by language| "}},
    {"%ps governing the %s by language", {"Lemmas government by language| "}},
    {"%l lemmas government", {"%l lemmas| ", "Lemmas government by language"}},
    {"%l %ps governing the %s", {"%l %ps| ", "%l lemmas government| ", "%ps governing the %s by language"}},
      
     -- Roots by language
     -- Roots by language
     {"Root-derived terms by language", {"Fundamental"}},
     {"Root-derived terms by language", {"Fundamental| "}},
    {"Terms derived from %l roots", {"%l roots", "Terms derived from %l| ", "Root-derived terms by language"}},
    {"Terms derived from %l roots", {"%l roots", "Terms derived from %l| ", "Root-derived terms by language"}},
    {"Terms derived from the %l root %s", {"Terms derived from %l roots"}},
    {"Terms derived from the %l root %s", {"Terms derived from %l roots"}},
     {"Terms by root by language", {"Terms by etymology subcategories by language"}},
     {"Terms by root by language", {"Terms by etymology subcategories by language"}},
     {"Roots by language", {"Terms by etymology subcategories by language"}},
     {"Roots by language", {"Terms by etymology subcategories by language"}},
    {"Nominal roots by language", {"Roots by language| "}},
    {"Nominal roots by language", {"Roots by language| "}},
    {"Verbal roots by language", {"Roots by language| "}},
    {"Numeral roots by language", {"Roots by language| "}},
    {"Verbal roots by language", {"Roots by language| "}},
    {"Adjectival roots by language", {"Roots by language| "}},
    {"Grammatical roots by language", {"Roots by language| "}},
     {"Terms by %l root by language", {"Terms by etymology subcategories by language|%l"}},
     {"Terms by %l root by language", {"Terms by etymology subcategories by language|%l"}},
     -- Language roots
     -- Language roots
     {"%l roots", {"%l language", "%l morphemes", "Roots by language"}},
     {"%l roots", {"%l language| ", "%l morphemes", "Roots by language"}},
    {"%l nominal roots", {"%l roots", "Nominal roots by language"}},
{"%l nominal roots", {"%l roots", "Nominal roots by language"}},
    {"%l verbal roots", {"%l roots", "Verbal roots by language"}},
{"%l numeral roots", {"%l roots", "Numeral roots by language"}},
    {"%l terms by root", {"%l terms by etymology", "%l roots", "Terms by root by language"}},
{"%l verbal roots", {"%l roots", "Verbal roots by language"}},
    {"%l terms belonging to the root %s", {"%l terms by root"}},
{"%l adjectival roots", {"%l roots", "Adjectival roots by language"}},
    {"%l terms by %u root", {"%l terms by etymology", "%l terms derived from %u", "Terms by %u root by language"}},
{"%l grammatical roots", {"%l roots", "Grammatical roots by language"}},
{"%l terms by root", {"%l terms by etymology", "%l roots", "Terms by root by language"}},
    {"%l terms belonging to the root %s", {"%l terms by root|%s"}},
    {"%l terms by %u root", {"%l terms by etymology", "%l terms derived from %u", "Terms by %u root by language"}},
     {"%l terms derived from the %u root %s", {"%l terms by %u root", "Terms derived from the %u root %s"}},
     {"%l terms derived from the %u root %s", {"%l terms by %u root", "Terms derived from the %u root %s"}},
     -- Etymology by language
     -- Etymology by language
     {"Terms by etymology by language", {"Fundamental"}},
     {"Terms by etymology by language", {"Fundamental| "}},
    {"Terms by etymology subcategories by language", {"Terms by etymology by language| "}},
    {"Terms by etymology subcategories by language", {"Terms by etymology by language| "}},
    {"Abbreviations by language", {"Terms by etymology subcategories by language"}},
    -- Language etymology (no source)
    {"Acronyms by language", {"Terms by etymology subcategories by language"}},
    {"Abbreviations by language", {"Terms by etymology subcategories by language"}},
    {"Adjectivisations by language", {"Terms by etymology subcategories by language"}},
    {"%l abbreviations", {"%l terms by etymology", "Abbreviations by language"}},
    {"Back-formations by language", {"Terms by etymology subcategories by language"}},
    {"Acronyms by language", {"Terms by etymology subcategories by language"}},
    {"Clippings by language", {"Terms by etymology subcategories by language"}},
    {"%l acronyms", {"%l terms by etymology", "Acronyms by language"}},
    {"Contractions by language", {"Terms by etymology subcategories by language"}},
    {"Adjectivisations by language", {"Terms by etymology subcategories by language"}},
    {"Deadjectivals by language", {"Terms by etymology subcategories by language"}},
    {"%l adjectivisations", {"%l terms by etymology", "Adjectivisations by language"}},
    {"Denominals by language", {"Terms by etymology subcategories by language"}},
    {"Back-formations by language", {"Terms by etymology subcategories by language"}},
    {"Deverbals by language", {"Terms by etymology subcategories by language"}},
    {"%l back-formations", {"%l terms by etymology", "Back-formations by language"}},
    {"Doublets by language", {"Terms by etymology subcategories by language"}},
    {"Blends by language", {"Terms by etymology subcategories by language"}},
    {"Ellipses by language", {"Terms by etymology subcategories by language"}},
    {"%l blends", {"%l terms by etymology", "Blends by language"}},
    {"Initialisms by language", {"Terms by etymology subcategories by language"}},
    {"Clippings by language", {"Terms by etymology subcategories by language"}},
    {"Nominalisations by language", {"Terms by etymology subcategories by language"}},
    {"%l clippings", {"%l terms by etymology", "Clippings by language"}},
    {"Onomatopoeias by language", {"Terms by etymology subcategories by language"}},
    {"Contractions by language", {"Terms by etymology subcategories by language"}},
    {"Rebracketings by language", {"Terms by etymology subcategories by language"}},
    {"%l contractions", {"%l terms by etymology", "Contractions by language"}},
    {"Reduplications by language", {"Terms by etymology subcategories by language"}},
    {"Deadjectivals by language", {"Terms by etymology subcategories by language"}},
    {"Terms with unknown etymology by language", {"Terms by etymology subcategories by language"}},
    {"%l deadjectivals", {"%l terms by etymology", "Deadjectivals by language"}},
    {"Terms with multiple etymologies by language", {"Terms by etymology subcategories by language"}},
    {"Denominals by language", {"Terms by etymology subcategories by language"}},
    {"Verbalisations by language", {"Terms by etymology subcategories by language"}},
    {"%l denominals", {"%l terms by etymology", "Denominals by language"}},
    -- Language etymology (no source)
    {"Deverbals by language", {"Terms by etymology subcategories by language"}},
    {"%l abbreviations", {"%l terms by etymology", "Abbreviations by language"}},
    {"%l deverbals", {"%l terms by etymology", "Deverbals by language"}},
    {"%l acronyms", {"%l terms by etymology", "Acronyms by language"}},
    {"Doublets by language", {"Terms by etymology subcategories by language"}},
    {"%l adjectivisations", {"%l terms by etymology", "Adjectivisations by language"}},
    {"%l doublets", {"%l terms by etymology", "Doublets by language"}},
    {"%l back-formations", {"%l terms by etymology", "Back-formations by language"}},
    {"Ellipses by language", {"Terms by etymology subcategories by language"}},
    {"%l clippings", {"%l terms by etymology", "Clippings by language"}},
    {"%l ellipses", {"%l terms by etymology", "Ellipses by language"}},
    {"%l contractions", {"%l terms by etymology", "Contractions by language"}},
    {"Grammaticalisations by language", {"Terms by etymology subcategories by language"}},
    {"%l deadjectivals", {"%l terms by etymology", "Deadjectivals by language"}},
    {"%l grammaticalisations", {"%l terms by etymology", "Grammaticalisations by language"}},
    {"%l denominals", {"%l terms by etymology", "Denominals by language"}},
    {"Initialisms by language", {"Terms by etymology subcategories by language"}},
    {"%l deverbals", {"%l terms by etymology", "Deverbals by language"}},
    {"%l initialisms", {"%l terms by etymology", "Initialisms by language"}},
    {"%l doublets", {"%l terms by etymology", "Doublets by language"}},
    {"Nominalisations by language", {"Terms by etymology subcategories by language"}},
    {"%l ellipses", {"%l terms by etymology", "Ellipses by language"}},
    {"%l nominalisations", {"%l terms by etymology", "Nominalisations by language"}},
    {"%l initialisms", {"%l terms by etymology", "Initialisms by language"}},
    {"Onomatopoeias by language", {"Terms by etymology subcategories by language"}},
    {"%l nominalisations", {"%l terms by etymology", "Nominalisations by language"}},
    {"%l onomatopoeias", {"%l terms by etymology", "Onomatopoeias by language"}},
    {"%l onomatopoeias", {"%l terms by etymology", "Onomatopoeias by language"}},
    {"Rebracketings by language", {"Terms by etymology subcategories by language"}},
    {"%l rebracketings", {"%l terms by etymology", "Rebracketings by language"}},
        {"%l rebracketings", {"%l terms by etymology", "Rebracketings by language"}},
    {"%l reduplications", {"%l terms by etymology", "Reduplications by language"}},
    {"Reduplications by language", {"Terms by etymology subcategories by language"}},
    {"%l terms with unknown etymology", {"%l terms by etymology", "Terms with unknown etymology by language"}},
    {"%l reduplications", {"%l terms by etymology", "Reduplications by language"}},
    {"%l terms by etymology", {"%l language", "Terms by etymology by language"}},
    {"Univerbations by language", {"Terms by etymology subcategories by language"}},
    {"%l terms with multiple etymologies", {"%l terms by etymology", "Terms with multiple etymologies by language"}},
    {"%l univerbations", {"%l terms by etymology", "Univerbations by language"}},
    {"%l verbalisations", {"%l terms by etymology", "Verbalisations by language"}},
    {"Terms with uncertain etymologies by language", {"Terms by etymology subcategories by language"}},
    {"%l terms with uncertain etymologies", {"%l terms by etymology", "Terms with uncertain etymologies by language"}},
    {"Terms with unknown etymologies by language", {"Terms by etymology subcategories by language"}},
    {"%l terms with unknown etymologies", {"%l terms by etymology", "Terms with unknown etymologies by language"}},
    {"Terms with multiple etymologies by language", {"Terms by etymology subcategories by language"}},
    {"%l terms with multiple etymologies", {"%l terms by etymology", "Terms with multiple etymologies by language"}},
    {"Verbalisations by language", {"Terms by etymology subcategories by language"}},
    {"%l verbalisations", {"%l terms by etymology", "Verbalisations by language"}},
{"%l terms by etymology", {"%l language| ", "Terms by etymology by language"}},
 
     -- Etymology source by language
     -- Etymology source by language
     {"Terms derived from %l", {"%l language"}},
     {"Terms derived from %l", {"%l language| "}},
    {"%l terms derived from %u", {"Terms derived from %u"}},
    {"Terms borrowed from %l", {"Terms derived from %l", "Borrowed terms by language"}},
     {"Inherited terms by language", {"Terms by etymology subcategories by language"}},
     {"Inherited terms by language", {"Terms by etymology subcategories by language"}},
    {"%l inherited terms", {"%l terms by etymology| ", "Inherited terms by language"}},
     {"Borrowed terms by language", {"Terms by etymology subcategories by language"}},
     {"Borrowed terms by language", {"Terms by etymology subcategories by language"}},
    {"Calqued terms by language", {"Terms by etymology subcategories by language"}},
    {"%l borrowed terms", {"%l terms by etymology| ", "Borrowed terms by language"}},
    {"Learned borrowings from %s by language", {"Terms borrowed from %s", "Borrowed terms by language"}},
    {"%l terms borrowed from %s", {"%l borrowed terms| ", "%l terms derived from %s| ", "Terms borrowed from %s"}},
    {"Orthographic borrowings from %s by language", {"Terms borrowed from %s", "Borrowed terms by language"}},
    {"%l orthographic borrowings", {"%l borrowed terms| ", "Orthographic borrowings by language"}},
    {"Semantic loans from %s", {"Terms borrowed from %s", "Borrowed terms by language"}},
    {"Orthographic borrowings from %s by language", {"Terms borrowed from %s| ", "Borrowed terms by language"}},
    {"Phono-semantic matchings from %s", {"Terms borrowed from %s", "Borrowed terms by language"}},
{"Semantic loans from %s", {"Terms borrowed from %s| ", "Borrowed terms by language"}},
    {"Transliterations of %s", {"Terms borrowed from %s", "Borrowed terms by language"}},
{"Phono-semantic matchings from %s", {"Terms borrowed from %s| ", "Borrowed terms by language"}},
     {"Terms borrowed from %s", {"Terms derived from %s", "Borrowed terms by language"}},
{"Transliterations of %s", {"Terms borrowed from %s| ", "Borrowed terms by language"}},
     {"Calques by language", {"Terms by etymology subcategories by language"}},
    {"%l calques", {"%l terms by etymology", "Calques by language"}},
    {"%l terms calqued from %s", {"%l calques", "%l terms borrowed from %s", "Terms calqued from %s"}},
     {"Terms inherited from %s", {"Terms derived from %s", "Inherited terms by language"}},
     {"Terms inherited from %s", {"Terms derived from %s", "Inherited terms by language"}},
    {"%l terms inherited from %s", {"%l inherited terms", "%l terms derived from %s", "Terms inherited from %s"}},
     {"Terms calqued from %s", {"Terms borrowed from %s", "Borrowed terms by language"}},
     {"Terms calqued from %s", {"Terms borrowed from %s", "Borrowed terms by language"}},
     {"Learned borrowings by language", {"Terms by etymology subcategories by language"}},
     {"Learned borrowings by language", {"Terms by etymology subcategories by language"}},
    {"Learned borrowings from %s by language", {"Terms borrowed from %s", "Borrowed terms by language"}},
    {"%l learned borrowings from %s", {"%l learned borrowings", "%l terms borrowed from %s", "Learned borrowings from %s by language"}},
{"%l learned borrowings", {"%l borrowed terms", "Learned borrowings by language"}},
     {"Orthographic borrowings by language", {"Terms by etymology subcategories by language"}},
     {"Orthographic borrowings by language", {"Terms by etymology subcategories by language"}},
    {"%l orthographic borrowings from %s", {"%l orthographic borrowings", "%l terms borrowed from %s", "Orthographic borrowings from %s by language"}},
     {"Semantic loans by language", {"Terms by etymology subcategories by language"}},
     {"Semantic loans by language", {"Terms by etymology subcategories by language"}},
    {"%l semantic loans", {"%l borrowed terms", "Semantic loans by language"}},
    {"%l semantic loans from %s", {"%l semantic loans", "%l terms borrowed from %s", "Semantic loans from %s"}},
     {"Phono-semantic matchings by language", {"Terms by etymology subcategories by language"}},
     {"Phono-semantic matchings by language", {"Terms by etymology subcategories by language"}},
    {"%l phono-semantic matchings", {"%l borrowed terms", "Phono-semantic matchings by language"}},
    {"%l phono-semantic matchings from %s", {"%l phono-semantic matchings", "%l terms borrowed from %s", "Phono-semantic matchings from %s"}},
     {"Transliterations by language", {"Terms by etymology subcategories by language"}},
     {"Transliterations by language", {"Terms by etymology subcategories by language"}},
    -- Language etymology (with source)
    {"%l transliterations", {"%l borrowed terms", "Transliterations by language"}},
    {"%l terms borrowed from %s", {"%l borrowed terms", "%l terms derived from %s", "Terms borrowed from %s"}},
    {"%l transliterations of %s", {"%l transliterations", "%l terms borrowed from %s", "Transliterations of %s"}},
    {"%l terms calqued from %s", {"%l calques", "%l terms borrowed from %s", "Terms calqued from %s"}},
 
    {"%l terms derived from %s", {"Terms derived from %s"}},
    {"%l terms inherited from %s", {"%l inherited terms", "%l terms derived from %s", "Terms inherited from %s"}},
    {"%l learned borrowings from %s", {"%l learned borrowings", "%l terms borrowed from %s", "Learned borrowings from %s by language"}},
    {"%l orthographic borrowings from %s", {"%l orthographic borrowings", "%l terms borrowed from %s", "Orthographic borrowings from %s by language"}},
    {"%l semantic loans from %s", {"%l semantic loans", "%l terms borrowed from %s", "Semantic loans from %s"}},
    {"%l phono-semantic matchings from %s", {"%l phono-semantic matchings", "%l terms borrowed from %s", "Phono-semantic matchings from %s"}},
    {"%l transliterations of %s", {"%l transliterations", "%l terms borrowed from %s", "Transliterations of %s"}},
    {"%l borrowed terms", {"%l terms by etymology", "Borrowed terms by language"}},
    {"%l calques", {"%l terms by etymology", "Calques by language"}},
    {"%l inherited terms", {"%l terms by etymology", "Inherited terms by language"}},
    {"%l learned borrowings", {"%l borrowed terms", "Learned borrowings by language"}},
    {"%l orthographic borrowings", {"%l borrowed terms", "Orthographic borrowings by language"}},
    {"%l semantic loans", {"%l borrowed terms", "Semantic loans by language"}},
    {"%l phono-semantic matchings", {"%l borrowed terms", "Phono-semantic matchings by language"}},
    {"%l transliterations", {"%l borrowed terms", "Transliterations by language"}},
     -- Affix etymology
     -- Affix etymology
     {"Compound terms by language", {"Terms by etymology subcategories by language"}},
     {"Compound terms by language", {"Terms by etymology subcategories by language"}},
    {"%l compound terms", {"%l terms by etymology|compound terms", "Compound terms by language"}},
    {"%l %s compounds", {"%l compound terms|%s"}},
     {"Terms by prefix by language", {"Terms by etymology subcategories by language"}},
     {"Terms by prefix by language", {"Terms by etymology subcategories by language"}},
    {"%l terms by prefix", {"%l prefixes| ", "%l terms by etymology| ", "Terms by prefix by language"}},
    {"%l terms prefixed with %s", {"%l terms by prefix| "}},
     {"Terms by suffix by language", {"Terms by etymology subcategories by language"}},
     {"Terms by suffix by language", {"Terms by etymology subcategories by language"}},
    {"%l terms by suffix", {"%l suffixes| ", "%l terms by etymology| ", "Terms by suffix by language"}},
    {"%l terms suffixed with %s", {"%l terms by suffix| "}},
     {"Terms by infix by language", {"Terms by etymology subcategories by language"}},
     {"Terms by infix by language", {"Terms by etymology subcategories by language"}},
    {"%l terms by infix", {"%l infixes| ", "%l terms by etymology| ", "Terms by infix by language"}},
    {"%l terms infixed with %s", {"%l terms by infix| "}},
     {"Terms by circumfix by language", {"Terms by etymology subcategories by language"}},
     {"Terms by circumfix by language", {"Terms by etymology subcategories by language"}},
    {"%l terms by prefix", {"%l prefixes", "%l terms by etymology", "Terms by prefix by language"}},
    {"%l terms by circumfix", {"%l circumfixes| ", "%l terms by etymology| ", "Terms by circumfix by language"}},
    {"%l terms by suffix", {"%l suffixes", "%l terms by etymology", "Terms by suffix by language"}},
    {"%l terms circumfixed with %s", {"%l terms by circumfix| "}},
    {"%l terms by infix", {"%l infixes", "%l terms by etymology", "Terms by infix by language"}},
 
    {"%l terms by circumfix", {"%l circumfixes", "%l terms by etymology", "Terms by circumfix by language"}},
    {"%l terms prefixed with %s", {"%l terms by prefix"}},
    {"%l terms suffixed with %s", {"%l terms by suffix"}},
    {"%l terms infixed with %s", {"%l terms by infix"}},
    {"%l terms circumfixed with %s", {"%l terms by circumfix"}},
    {"%l compound terms", {"%l terms by etymology", "Compound terms by language"}},
     -- Coinage
     -- Coinage
     {"Coinages by language", {"Terms by etymology subcategories by language"}},
     {"Coinages by language", {"Terms by etymology subcategories by language"}},
     {"%l coinages", {"%l terms by etymology", "Coinages by language"}},
     {"%l coinages", {"%l terms by etymology", "Coinages by language"}},
   
     -- Entry maintenance
     -- Entry maintenance
     {"Entry maintenance by language", {"Fundamental"}},
     {"Entry maintenance", {"Fundamental| "}},
    {"Terms with usage examples by language", {"Entry maintenance by language| "}},
    {"Terms which require adding to also data", {"Entry maintenance| "}},
    {"%l entry maintenance", {"%l language", "Entry maintenance by language"}},
    {"Pages using outdated templates", {"Entry maintenance| "}},
    {"%l terms with usage examples", {"%l entry maintenance", "Terms with usage examples by language"}},
    {"Category pages not matched by auto cat", {"Entry maintenance| "}},
    {"Translations to update", {"Entry maintenance| "}},
    {"Etymology headings to update", {"Entry maintenance| "}},
    {"Entry maintenance by language", {"Entry maintenance| "}},
    {"Terms with usage examples by language", {"Entry maintenance by language| "}},
    {"%l entry maintenance", {"%l language| ", "Entry maintenance by language"}},
    {"%l terms with manually entered pronunciation", {"%l entry maintenance| "}},
    {"%l terms with usage examples", {"%l entry maintenance| ", "Terms with usage examples by language"}},
   
    {"Terms with translations by language", {"Entry maintenance by language| "}},
    {"%l terms with translations", {"Terms with translations by language"}},
    {"Terms with %l translations by language", {"Terms with translations by language|%l"}},
    {"%l terms with %u translations", {"%l terms with translations", "Terms with %u translations by language"}},
    {"Terms needing %l translations", {"Entry maintenance by language| "}},
   
    {"Terms with cognates by language", {"Entry maintenance by language| "}},
    {"%l terms with cognates", {"Terms with cognates by language"}},
    {"Terms with %l cognates by language", {"Terms with cognates by language|%l"}},
    {"%l terms with %u cognates", {"%l terms with cognates", "Terms with %u cognates by language"}},
   
    {"%l terms missing %s", {"%l entry maintenance"}},
    {"%l terms needing %s", {"%l entry maintenance"}},
    {"%l terms without %s", {"%l entry maintenance"}},
   
     -- Miscellaneous terms (custom)
     -- Miscellaneous terms (custom)
     {"Interlingual homographs", {"Fundamental"}},
     {"Homophones by language", {"Fundamental| "}},
    {"Requested terms by language", {"Fundamental"}},
    {"%l homophones", {"%l language| ", "Homophones by language"}},
     {"Nth terms by language", {"Fundamental"}},
    {"Interlingual homographs", {"Fundamental| "}},
    {"%l requested terms", {"%l language", "Requested terms by language"}},
     {"Requested terms by language", {"Fundamental| "}},
    {"%l terms requested by my boyfriend", {"%l requested terms"}},
    {"%l requested terms", {"%l language| ", "Requested terms by language"}},
     {"%l terms requested by my partner", {"%l requested terms"}},
    {"%l terms requested by my %s", {"%l requested terms"}},
    {"%l nth terms", {"%l language", "Nth terms by language"}},
     {"Nth terms by language", {"Fundamental| "}},
    {"%l nth terms", {"%l language| ", "Nth terms by language"}},
   
     -- Usage labels by language
     -- Usage labels by language
     {"Terms by usage by language", {"Fundamental"}},
    -- Language usage labels
     {"Terms by usage by language", {"Fundamental| "}},
    {"%l terms by usage", {"%l language| ", "Terms by usage by language"}},
     {"Terms by usage subcategories by language", {"Terms by usage by language| "}},
     {"Terms by usage subcategories by language", {"Terms by usage by language| "}},
    {"Archaic terms by language", {"Terms by usage subcategories by language"}},
    {"Archaic terms by language", {"Terms by usage subcategories by language"}},
    {"%l archaic terms", {"%l terms by usage", "Archaic terms by language"}},
    {"Colloquial terms by language", {"Terms by usage subcategories by language"}},
    {"Colloquial terms by language", {"Terms by usage subcategories by language"}},
    {"%l colloquial terms", {"%l terms by usage", "Colloquial terms by language"}},
    {"Dated terms by language", {"Terms by usage subcategories by language"}},
    {"Dated terms by language", {"Terms by usage subcategories by language"}},
    {"%l dated terms", {"%l terms by usage", "Dated terms by language"}},
    {"Derogatory terms by language", {"Terms by usage subcategories by language"}},
    {"Derogatory terms by language", {"Terms by usage subcategories by language"}},
    {"%l derogatory terms", {"%l terms by usage", "Derogatory terms by language"}},
    {"Dialectal terms by language", {"Terms by usage subcategories by language"}},
    {"Dialectal terms by language", {"Terms by usage subcategories by language"}},
    {"%l dialectal terms", {"%l terms by usage", "Dialectal terms by language"}},
    {"Euphemisms by language", {"Terms by usage subcategories by language"}},
    {"Euphemisms by language", {"Terms by usage subcategories by language"}},
    {"%l euphemisms", {"%l terms by usage", "Euphemisms by language"}},
    {"Formal terms by language", {"Terms by usage subcategories by language"}},
    {"Formal terms by language", {"Terms by usage subcategories by language"}},
    {"%l formal terms", {"%l terms by usage", "Formal terms by language"}},
    {"Gender-neutral terms by language", {"Terms by usage subcategories by language"}},
    {"Gender-neutral terms by language", {"Terms by usage subcategories by language"}},
    {"%l gender-neutral terms", {"%l terms by usage", "Gender-neutral terms by language"}},
    {"Humble terms by language", {"Terms by usage subcategories by language"}},
    {"Humble terms by language", {"Terms by usage subcategories by language"}},
    {"%l humble terms", {"%l terms by usage", "Humble terms by language"}},
    {"Idioms by language", {"Terms by usage subcategories by language"}},
    {"%l idioms", {"%l terms by usage", "Idioms by language"}},
    {"Jocular terms by language", {"Terms by usage subcategories by language"}},
    {"Jocular terms by language", {"Terms by usage subcategories by language"}},
    {"%l jocular terms", {"%l terms by usage", "Jocular terms by language"}},
    {"Obsolete terms by language", {"Terms by usage subcategories by language"}},
    {"Obsolete terms by language", {"Terms by usage subcategories by language"}},
    {"%l obsolete terms", {"%l terms by usage", "Obsolete terms by language"}},
    {"Offensive terms by language", {"Terms by usage subcategories by language"}},
    {"Offensive terms by language", {"Terms by usage subcategories by language"}},
    {"%l offensive terms", {"%l terms by usage", "Offensive terms by language"}},
    {"Pejorative terms by language", {"Terms by usage subcategories by language"}},
    {"Pejorative terms by language", {"Terms by usage subcategories by language"}},
    {"%l pejorative terms", {"%l terms by usage", "Pejorative terms by language"}},
    {"Sarcastic terms by language", {"Terms by usage subcategories by language"}},
    {"%l sarcastic terms", {"%l terms by usage", "Sarcastic terms by language"}},
    {"Slang terms by language", {"Terms by usage subcategories by language"}},
    {"Slang terms by language", {"Terms by usage subcategories by language"}},
    {"%l slang terms", {"%l terms by usage", "Slang terms by language"}},
    {"Slurs by language", {"Terms by usage subcategories by language"}},
    {"Slurs by language", {"Terms by usage subcategories by language"}},
    {"%l slurs", {"%l terms by usage", "Slurs by language"}},
    {"Vulgar terms by language", {"Terms by usage subcategories by language"}},
    {"Vulgar terms by language", {"Terms by usage subcategories by language"}},
    -- Language usage labels
{"%l vulgar terms", {"%l terms by usage", "Vulgar terms by language"}},
    {"%l terms by usage", {"%l language", "Terms by usage by language"}},
    {"%l archaic terms", {"%l terms by usage", "Archaic terms by language"}},
    {"%l colloquial terms", {"%l terms by usage", "Colloquial terms by language"}},
    {"%l dated terms", {"%l terms by usage", "Dated terms by language"}},
    {"%l derogatory terms", {"%l terms by usage", "Derogatory terms by language"}},
    {"%l dialectal terms", {"%l terms by usage", "Dialectal terms by language"}},
    {"%l euphemisms", {"%l terms by usage", "Euphemisms by language"}},
    {"%l formal terms", {"%l terms by usage", "Formal terms by language"}},
    {"%l gender-neutral terms", {"%l terms by usage", "Gender-neutral terms by language"}},
    {"%l humble terms", {"%l terms by usage", "Humble terms by language"}},
    {"%l jocular terms", {"%l terms by usage", "Jocular terms by language"}},
    {"%l obsolete terms", {"%l terms by usage", "Obsolete terms by language"}},
    {"%l offensive terms", {"%l terms by usage", "Offensive terms by language"}},
    {"%l pejorative terms", {"%l terms by usage", "Pejorative terms by language"}},
    {"%l slang terms", {"%l terms by usage", "Slang terms by language"}},
    {"%l slurs", {"%l terms by usage", "Slurs by language"}},
    {"%l vulgar terms", {"%l terms by usage", "Vulgar terms by language"}},
    -- Topics
    {"Topics by language", {"Fundamental"}},
    {"In-world terms by language", {"Topics by language| "}},
    {"Out-of-world terms by language", {"Topics by language| "}},
    {"Names by language", {"Topics by language| "}},
    {"%s topic by language", {"Topics by language| "}},
    {"%l topics", {"%l language", "Topics by language"}},
    -- World specificity
    {"%l in-world terms", {"%l topics", "In-world terms by language"}},
    {"%l out-of-world terms", {"%l topics", "Out-of-world terms by language"}},
    -- Names
    {"%l names", {"%l topics", "Names by language| "}},
    {"%l given names", {"%l topics", "Given names by language", "%l names"}},
    {"%l surnames", {"%l topics", "Surnames by language", "%l names"}},
    -- Chemistry sub-topics
    {"%c:Biochemistry", {"%l topics", "Biochemistry topic by language", "%c:Chemistry"}},
    {"%c:Enzymes", {"%l topics", "Enzymes topic by language", "%c:Biochemistry"}},
    {"%c:Organic chemistry", {"%l topics", "Organic chemistry topic by language", "%c:Chemistry"}},
    {"%c:Sugars", {"%l topics", "Sugars topic by language", "%c:Chemistry"}},
    -- Biology sub-topics
    {"%c:Cytology", {"%l topics", "Cytology topic by language", "%c:Biology"}},
    {"%c:Genetics", {"%l topics", "Genetics topic by language", "%c:Biology"}},
    {"%c:Molecular biology", {"%l topics", "Molecular biology topic by language", "%c:Biology"}},
    {"%c:Physiology", {"%l topics", "Physiology topic by language", "%c:Biology"}},
    {"%c:Taxonomy", {"%l topics", "Taxonomy topic by language", "%c:Biology"}},
    -- Linguistics sub-topics
    {"%c:Phonetics", {"%l topics", "Phonetics topic by language", "%c:Linguistics"}},
    {"%c:Phonology", {"%l topics", "Phonology topic by language", "%c:Linguistics"}},
    -- Mathematics sub-topics
    {"%c:Algebra", {"%l topics", "Algebra topic by language", "%c:Mathematics"}},
    {"%c:Arithmetic", {"%l topics", "Arithmetic topic by language", "%c:Mathematics"}},
    {"%c:Calculus", {"%l topics", "Calculus topic by language", "%c:Mathematics"}},
    {"%c:Geometry", {"%l topics", "Geometry topic by language", "%c:Mathematics"}},
    {"%c:Statistics", {"%l topics", "Statistics topic by language", "%c:Mathematics"}},
    {"%c:Trigonometry", {"%l topics", "Trigonometry topic by language", "%c:Mathematics"}},
    {"%c:Trigonometric functions", {"%l topics", "Trigonometric functions topic by language", "%c:Trigonometry"}},
    -- Physics sub-topics
    {"%c:Nuclear physics", {"%l topics", "Nuclear physics topic by language", "%c:Physics"}},
    -- Time sub-topics
    {"%c:Months", {"%l topics", "Months topic by language", "%c:Time"}},
    {"%c:Seasons", {"%l topics", "Seasons topic by language", "%c:Time"}},
    {"%c:Days", {"%l topics", "Days topic by language", "%c:Time"}},
    -- End of sub-topics
    {"%c:%s", {"%l topics", "%s topic by language"}},
     -- Templates
     -- Templates
     {"Templates", {"Fundamental"}},
     {"Templates", {"Fundamental| "}},
    {"Template documentation", {"Templates| "}},
    {"Documentation subpages", {"Fundamental| ", "Templates| ", "Modules| "}},
     {"Templates by language", {"Templates"}},
     {"Templates by language", {"Templates"}},
     {"Entry templates", {"Templates"}},
     {"Entry templates", {"Templates"}},
Line 374: Line 491:
     {"Banner templates", {"Templates"}},
     {"Banner templates", {"Templates"}},
     {"Encyclopedia templates", {"Templates"}},
     {"Encyclopedia templates", {"Templates"}},
    {"Meta", {"Templates"}},
     {"Etymology templates", {"Entry templates"}},
     {"Etymology templates", {"Entry templates"}},
     {"Definition templates", {"Entry templates"}},
     {"Definition templates", {"Entry templates"}},
Line 379: Line 497:
     {"Translation templates", {"Entry templates"}},
     {"Translation templates", {"Entry templates"}},
     {"%l templates", {"Templates by language"}},
     {"%l templates", {"Templates by language"}},
    {"%s templates", {"Templates"}},
     -- Modules
     -- Modules
     {"Modules", {"Fundamental"}},
     {"Modules", {"Fundamental| "}},
     {"Modules by language", {"Modules"}},
     {"Modules by language", {"Modules"}},
     {"%l modules", {"Modules by language"}},
     {"%l modules", {"Modules by language"}},
    -- Topics
    {"Topics by language", {"Fundamental| "}},
    {"In-world terms by language", {"Topics by language"}},
    {"Out-of-world terms by language", {"Topics by language"}},
    {"%l topics", {"%l language| ", "Topics by language| "}},
    -- Topic subcategories
    -- World specificity
    {"%l in-world terms", {"%l topics| ", "In-world terms by language"}},
    {"%l out-of-world terms", {"%l topics| ", "Out-of-world terms by language"}},
    -- Names
    {"%l names", {"%l topics| ", "Names by language"}},
    {"%l given names", {"Given names by language", "%l names| "}},
    {"%l %s given names", {"%s given names by language", "%l given names| "}},
    {"%l surnames", {"Surnames by language", "%l names| "}},
    {"%l %s surnames", {"%s surnames by language", "%l surnames| "}},
   
    {"Names by language", {"Topics by language"}},
    {"Given names by language", {"Names by language| "}},
    {"%s given names by language", {"Given names by language| "}},
    {"Surnames by language", {"Names by language| "}},
    {"%s surnames by language", {"Surnames by language| "}},
   
{"%l names %s", {"%l names| "}},
-- Sort other term descriptors as lemma subcategories (needs to be at the end)
{"%s terms by language", {"Lemmas subcategories by language"}},
    {"%l comparable terms", {"%l language| ", "Comparable terms by language"}},
    {"%l comparable %ps", {"%l %ps| ", "Comparable terms by language"}},
    {"%l uncomparable terms", {"%l language| ", "Uncomparable terms by language"}},
    {"%l %s terms", {"%l language| ", "%s terms by language"}},
{"%l uncomparable terms", {"%l language| ", "Uncomparable terms by language"}},
{"%l %ps %s", {"%l %ps| "}},
}
-- provides initial capitalisation
local function capitalize(word)
if mw.ustring.len(word) > 1 then
return mw.ustring.upper(mw.ustring.sub(word, 1, 1)) .. mw.ustring.sub(word, 2)
elseif mw.ustring.len(word) == 1 then
return mw.ustring.upper(word)
end
error("Empty input for capitalisation")
end
-- process subtopics
for subtopic, supertopics in pairs(subtopics) do
local subcats = {"%l topics|" .. subtopic, capitalize(subtopic) .. " topic by language| "}
local subcats_topic = {"Topics by language"}
if type(supertopics) == "string" then
table.insert(subcats, "%c:" .. capitalize(supertopics) .. "|" .. subtopic)
table.insert(subcats_topic, capitalize(supertopics) .. " topic by language")
elseif type(supertopics) == "table" then
for _, supertopic in ipairs(supertopics) do
table.insert(subcats, "%c:" .. capitalize(supertopic) .. "|" .. subtopic)
table.insert(subcats_topic, capitalize(supertopic) .. " topic by language")
end
end
table.insert(cats, {capitalize(subtopic) .. " topic by language", subcats_topic})
table.insert(cats, {"%c:" .. capitalize(subtopic), subcats})
end
table.insert(cats, {"%s topic by language", {"Topics by language"}})
table.insert(cats, {"%c:%s", {"%l topics|%s", "%s topic by language| "}})
return {
cats = cats,
pos = pos,
}
}

Latest revision as of 15:10, 26 October 2024

-------------------------
--[[  AUTO CAT DATA  ]]--
-------------------------
-- %l = any language name
-- %u = any language name (different to %l)
-- %c = any language code
-- %p = any part of speech
-- %ps = any part of speech (plural)
-- %s = any string
-------------------------
-- Please note that the order of patterns
-- makes a difference
-- Patterns higher up in the table will be
-- matched against first.
-------------------------
local subtopics = {
	-- ["this is a subtopic of"] = "just this", 
	-- ["this is a subtopic of"] = {"this", "this too"}, 
	
	-- LIFEFORMS
	
	["animals"] = "lifeforms",
		["birds"] = "animals",
		["insects"] = "animals",
	["plants"] = "lifeforms",
	
	-- TECHNOLOGY
	
	["computing"] = "technology",
	["electronics"] = "technology",
	
	-- TIME
	
	["months"] = "time",
	["seasons"] = "time",
	["days"] = "time",
	
	-- SCIENCES
	
	["astronomy"] = "sciences",
	
	["biology"] = "sciences",
		["anatomy"] = {"biology", "medicine"},
			["organs"] = {"anatomy"},
		["botany"] = "biology",
		["cytology"] = "biology",
		["genetics"] = "biology",
		["microbiology"] = "biology",
		["molecular biology"] = "biology",
		["physiology"] = "biology",
		["taxonomy"] = "biology",
			["taxonomic names"] = "taxonomy",
				["taxonomic names %s"] = "taxonomic names",
		["virology"] = "biology",
		["zoology"] = "biology",
	
	["chemistry"] = "sciences",
		["inorganic chemistry"] = "chemistry",
		["organic chemistry"] = "chemistry",
		["sugars"] = "chemistry",
		
	["biochemistry"] = {"biology","chemistry"},
		["enzymes"] = "biochemistry",
	
	["applied sciences"] = "sciences",
		["metrology"] = "applied sciences",
	
	["formal sciences"] = "sciences",
		["logic"] = "formal sciences",
		["mathematics"] = "formal sciences",
			["algebra"] = "mathematics",
			["arithmetic"] = "mathematics",
			["calculus"] = "mathematics",
			["geometry"] = "mathematics",
			["statistics"] = "mathematics",
			["trigonometry"] = "mathematics",
				["trigonometric functions"] = "trigonometry",
	
	["social sciences"] = "sciences",
		["linguistics"] = "social sciences",
			["phonetics"] = "linguistics",
			["phonology"] = "linguistics",
		["psychology"] = "social sciences",
		
	["medicine"] = "sciences",
		["pharmacology"] = "medicine",
		["psychiatry"] = "medicine",
		["surgery"] = "medicine",
		
	["physics"] = "sciences",
		["nuclear physics"] = "physics",
}

local pos = {
    "adjective",
    "adverb",
	"article",
    "conjunction",
    "determiner",
    "interjection",
	"noun",
    "numeral",
    "particle",
    "participle",
    "phrase",
    "postposition",
    "preposition",
    "pronoun",
    "proper noun",
    "symbol",
    "verb",
}

local cats = {
    {"Fundamental", {"Fundamental| "}},
    
    -- General maintenance
    {"Hidden categories", {"Fundamental| "}},
    {"Pages with script errors", {"Fundamental| "}},
    {"Pages marked as works in progress", {"Fundamental| "}},
    {"Obsolete", {"Fundamental| "}},
    	{"%l active rhymes", {"Obsolete| "}},
    	{"Label templates", {"Obsolete| "}},
    	{"%s entries", {"Obsolete| "}},
    
    -- Languages
    {"All languages", {"Fundamental| "}},
    	{"%l language", {"All languages"}},
    		{"%l images", {"%l language| "}},
    -- Encyclopedia
    {"Encyclopedia articles by language", {"Fundamental"}},
    	{"%l encyclopedia articles", {"%l language| ", "Encyclopedia articles by language"}},
    {"Phrasebooks", {"Fundamental"}},
    -- Appendices
    {"Appendices", {"Fundamental| "}},
	    {"Appendices by language", {"Appendices| "}},
	    	{"%l appendices", {"Appendices by language"}},
    -- Lexember
    {"Lexember", {"Fundamental"}},
	    {"Lexember 2023", {"Lexember|2023"}},
	    		{"Lexember 2023 Day %s: %l", {"Lexember 2023: %l| ", "Lexember 2023 Day %s|%l"}},
	    	{"Lexember 2023 Day %s", {"Lexember 2023| "}},
		    {"Lexember 2023: %l", {"%l language|Lexember 2023", "Lexember 2023|%l"}},
    -- Rhymes
    {"Rhymes", {"Fundamental"}},
    	{"Inactive rhymes by language", {"Rhymes| "}},
    	{"Rhymes:%l", {"%l language| ", "Rhymes|%l"}},
    		{"Rhymes:%l/%s", {"Rhymes:%l|%s"}},
    		{"%l inactive rhymes", {"Rhymes:%l| ", "Inactive rhymes by language"}},
    -- Lemmas by language
    {"Lemmas by language", {"Fundamental| "}},
    	{"Lemmas subcategories by language", {"Lemmas by language| "}},
    		{"Multiword terms by language", {"Lemmas subcategories by language"}},
    			{"%l multiword terms", {"%l language| ", "Multiword terms by language"}},
			{"Terms with multiple pronunciations by language", {"Lemmas subcategories by language"}},
    			{"%l terms with multiple pronunciations", {"%l language| ", "Terms with multiple pronunciations by language"}},
			{"Terms with dialect pronunciations by language", {"Lemmas subcategories by language"}},
    			{"%l terms with %s dialect pronunciation", {"%l language| ", "Terms with dialect pronunciations by language", "Terms with dialect pronunciations by language"}},
    	{"%ps by language", {"Lemmas by language| "}},
    	{"%l lemmas", {"%l language| ", "Lemmas by language"}},
    		{"%l %ps", {"%l lemmas|%ps", "%ps by language"}},

    -- Non-lemmas by language
    {"Non-lemma forms by language", {"Fundamental| "}},
    	{"Non-lemma forms subcategories by language", {"Non-lemma forms by language| "}},
    		{"%p forms by language", {"Non-lemma forms subcategories by language"}},
    		{"Suffix forms by language", {"Non-lemma forms subcategories by language"}},
    	{"%l non-lemma forms", {"%l language| ", "Non-lemma forms by language"}},
    		{"%l %p forms", {"%l non-lemma forms|%p forms", "%l %ps| ", "%p forms by language"}},
    			{"%l %s %p forms", {"%l %p forms|%s"}},
    			{"%l suffix forms", {"%l non-lemma forms|suffix forms", "%l suffixes| ", "Suffix forms by language"}},
    		{"%l verbal nouns", {"%l non-lemma forms|verbal nouns", "%l nouns| ", "Verbal nouns by language"}},
    		{"Verbal nouns by language", {"Non-lemma forms subcategories by language"}},
    
    
    -- Morphemes by language
    {"Morphemes by language", {"Lemmas by language"}},
    {"Affixes by language", {"Morphemes by language"}},
    {"Prefixes by language", {"Affixes by language| "}},
    {"Suffixes by language", {"Affixes by language| "}},
    {"Infixes by language", {"Affixes by language| "}},
    {"Circumfixes by language", {"Affixes by language| "}},
    {"Clitics by language", {"Morphemes by language"}},
    -- Language morphemes
    {"%l morphemes", {"%l lemmas", "Morphemes by language"}},
    {"%l affixes", {"%l morphemes", "%l lemmas", "Affixes by language"}},
    {"%l prefixes", {"%l morphemes", "%l affixes", "Prefixes by language"}},
    	{"%l %s prefixes", {"%l prefixes"}},
    {"%l suffixes", {"%l morphemes", "%l affixes", "Suffixes by language"}},
    	{"Nominal suffixes by language", {"Lemmas subcategories by language"}},
    	{"Verbal suffixes by language", {"Lemmas subcategories by language"}},
    	{"Adjectival suffixes by language", {"Lemmas subcategories by language"}},
    	{"%l nominal suffixes", {"%l suffixes", "Nominal suffixes by language"}},
		{"%l adjectival suffixes", {"%l suffixes", "Adjectival suffixes by language"}},
    	{"%l verbal suffixes", {"%l suffixes", "Verbal suffixes by language"}},
    	{"%l %s suffixes", {"%l suffixes"}},
    {"%l infixes", {"%l morphemes", "%l affixes", "Infixes by language"}},
    	{"%l %s infixes", {"%l infixes"}},
    {"%l circumfixes", {"%l morphemes", "%l affixes", "Circumfixes by language"}},
    {"%l clitics", {"%l morphemes", "Clitics by language"}},
    -- Types of lemma by language
    {"%ps with multiple genders by language", {"Lemmas subcategories by language"}},
    {"%ps with multiple animacies by language", {"Lemmas subcategories by language"}},
    
    -- Language types of lemma *with cross-linguistic category*
    {"%s %ps by language", {"Lemmas subcategories by language"}},
	    {"%l comparable %ps", {"%l %ps| ", "Comparable %ps by language"}},
	    {"%l uncomparable %ps", {"%l %ps| ", "Uncomparable %ps by language"}},
		{"%l spatial prepositions", {"%l prepositions| ", "Spatial prepositions by language"}},
		{"%l temporal prepositions", {"%l prepositions| ", "Temporal prepositions by language"}},
	    {"%l possessive pronouns", {"%l pronouns| ", "Possessive pronouns by language"}},
	    {"%l relative pronouns", {"%l pronouns| ", "Relative pronouns by language"}},
	    {"%l imperfective verbs", {"%l verbs| ", "Imperfective verbs by language"}},
	    {"%l perfective verbs", {"%l verbs| ", "Perfective verbs by language"}},
	    {"%l biaspectual verbs", {"%l verbs| ", "Biaspectual verbs by language"}},
	    {"%l transitive verbs", {"%l verbs| ", "Transitive verbs by language"}},
	    {"%l intransitive verbs", {"%l verbs| ", "Intransitive verbs by language"}},
	    {"%l auxiliary verbs", {"%l verbs| ", "Auxiliary verbs by language"}},
	    {"%l copulative verbs", {"%l verbs| ", "Copulative verbs by language"}},
	    {"%l deponent verbs", {"%l verbs| ", "Deponent verbs by language"}},
	    {"%l ditransitive verbs", {"%l verbs| ", "Ditransitive verbs by language"}},
	    {"%l impersonal verbs", {"%l verbs| ", "Impersonal verbs by language"}},
	    {"%l stative verbs", {"%l verbs| ", "Stative verbs by language"}},
	    {"%l passive verbs", {"%l verbs| ", "Passive verbs by language"}},
	    {"%l reflexive verbs", {"%l verbs| ", "Reflexive verbs by language"}},
	    {"%l mediopassive verbs", {"%l verbs| ", "Mediopassive verbs by language"}},
	    {"%l neuter %ps", {"%l %ps| ", "Neuter %ps by language"}},
	    {"%l feminine %ps", {"%l %ps| ", "Feminine %ps by language"}},
	    {"%l masculine %ps", {"%l %ps| ", "Masculine %ps by language"}},
	    {"%l common %ps", {"%l %ps| ", "Common %ps by language"}},
	    {"%l inanimate %ps", {"%l %ps| ", "Inanimate %ps by language"}},
	    {"%l animate %ps", {"%l %ps| ", "Animate %ps by language"}},
	    {"%l personal %ps", {"%l %ps| ", "Personal %ps by language"}},
	    {"%l nonpersonal %ps", {"%l %ps| ", "Nonpersonal %ps by language"}},
	    {"%l animal %ps", {"%l %ps| ", "Animal %ps by language"}},
	    {"%l nonvirile %ps", {"%l %ps| ", "Nonvirile %ps by language"}},
	    {"%l virile %ps", {"%l %ps| ", "Virile %ps by language"}},
		   
	{"Singularia tantum by language", {"Lemmas subcategories by language"}},
	    {"%l singularia tantum", {"%l nouns| ", "Singularia tantum by language"}},
	{"Dualia tantum by language", {"Lemmas subcategories by language"}},
	    {"%l dualia tantum", {"%l nouns| ", "Dualia tantum by language"}},
	{"Pluralia tantum by language", {"Lemmas subcategories by language"}},
	    {"%l pluralia tantum", {"%l nouns| ", "Pluralia tantum by language"}},
    {"%ps with multiple genders by language", {"Lemmas subcategories by language"}},
	    {"%l %ps with multiple genders", {"%l %ps| ", "%ps with multiple genders by language"}},
    {"%ps with multiple animacies by language", {"Lemmas subcategories by language"}},
	    {"%l %ps with multiple animacies", {"%l %ps| ", "%ps with multiple animacies by language"}},
 
	{"Diminutive %ps by language", {"Lemmas subcategories by language"}},
		{"%l diminutive %ps", {"%l %ps| ", "Diminutive %ps by language"}},
			{"%l %s diminutive %ps", {"%l diminutive %ps| "}},
	{"Augmentative %ps by language", {"Lemmas subcategories by language"}},
		{"%l augmentative %ps", {"%l %ps| ", "Augmentative %ps by language"}},
			{"%l %s augmentative %ps", {"%l augmentative %ps| "}},
	
	    -- Radestrian-specific non-automatic PoS subcategories
	    {"Radestrian pluralia binaria", {"Radestrian nouns| "}},
	    	{"Radestrian pluralia binaria tantum", {"Radestrian nouns| ", "Radestrian pluralia binaria| "}},
    
    {"%l %s %ps", {"%l %ps| "}}, -- sorts all other PoS descriptors under the PoS but not under a cross-linguistic category (e.g. Virile nouns by language). More for language-specific PoS subcategories.
    
    -- Stems
    	{"%l terms by stem type", {"%l language| "}},
	    	{"%l %s stems", {"%l terms by stem type"}},
    
    -- Government
    {"Lemmas government by language", {"Lemmas subcategories by language| "}},
	    {"%ps governing the %s by language", {"Lemmas government by language| "}},
	    {"%l lemmas government", {"%l lemmas| ", "Lemmas government by language"}},
	    	{"%l %ps governing the %s", {"%l %ps| ", "%l lemmas government| ", "%ps governing the %s by language"}},
    
    -- Roots by language
    {"Root-derived terms by language", {"Fundamental| "}},
    	{"Terms derived from %l roots", {"%l roots", "Terms derived from %l| ", "Root-derived terms by language"}},
    		{"Terms derived from the %l root %s", {"Terms derived from %l roots"}},
    {"Terms by root by language", {"Terms by etymology subcategories by language"}},
    {"Roots by language", {"Terms by etymology subcategories by language"}},
    	{"Nominal roots by language", {"Roots by language| "}},
    	{"Numeral roots by language", {"Roots by language| "}},
    	{"Verbal roots by language", {"Roots by language| "}},
    	{"Adjectival roots by language", {"Roots by language| "}},
    	{"Grammatical roots by language", {"Roots by language| "}},
    {"Terms by %l root by language", {"Terms by etymology subcategories by language|%l"}},
    -- Language roots
    {"%l roots", {"%l language| ", "%l morphemes", "Roots by language"}},
		{"%l nominal roots", {"%l roots", "Nominal roots by language"}},
		{"%l numeral roots", {"%l roots", "Numeral roots by language"}},
		{"%l verbal roots", {"%l roots", "Verbal roots by language"}},
		{"%l adjectival roots", {"%l roots", "Adjectival roots by language"}},
		{"%l grammatical roots", {"%l roots", "Grammatical roots by language"}},
		{"%l terms by root", {"%l terms by etymology", "%l roots", "Terms by root by language"}},
    		{"%l terms belonging to the root %s", {"%l terms by root|%s"}},
    		{"%l terms by %u root", {"%l terms by etymology", "%l terms derived from %u", "Terms by %u root by language"}},
    {"%l terms derived from the %u root %s", {"%l terms by %u root", "Terms derived from the %u root %s"}},
    -- Etymology by language
    {"Terms by etymology by language", {"Fundamental| "}},
	    {"Terms by etymology subcategories by language", {"Terms by etymology by language| "}},
	    	-- Language etymology (no source)
		    {"Abbreviations by language", {"Terms by etymology subcategories by language"}},
		    	{"%l abbreviations", {"%l terms by etymology", "Abbreviations by language"}},
		    {"Acronyms by language", {"Terms by etymology subcategories by language"}},
		    	{"%l acronyms", {"%l terms by etymology", "Acronyms by language"}},
		    {"Adjectivisations by language", {"Terms by etymology subcategories by language"}},
    			{"%l adjectivisations", {"%l terms by etymology", "Adjectivisations by language"}},
		    {"Back-formations by language", {"Terms by etymology subcategories by language"}},
		    	{"%l back-formations", {"%l terms by etymology", "Back-formations by language"}},
		    {"Blends by language", {"Terms by etymology subcategories by language"}},
		    	{"%l blends", {"%l terms by etymology", "Blends by language"}},
		    {"Clippings by language", {"Terms by etymology subcategories by language"}},
		    	{"%l clippings", {"%l terms by etymology", "Clippings by language"}},
		    {"Contractions by language", {"Terms by etymology subcategories by language"}},
		    	{"%l contractions", {"%l terms by etymology", "Contractions by language"}},
		    {"Deadjectivals by language", {"Terms by etymology subcategories by language"}},
		    	{"%l deadjectivals", {"%l terms by etymology", "Deadjectivals by language"}},
		    {"Denominals by language", {"Terms by etymology subcategories by language"}},
		    	{"%l denominals", {"%l terms by etymology", "Denominals by language"}},
		    {"Deverbals by language", {"Terms by etymology subcategories by language"}},
		    	{"%l deverbals", {"%l terms by etymology", "Deverbals by language"}},
		    {"Doublets by language", {"Terms by etymology subcategories by language"}},
		    	{"%l doublets", {"%l terms by etymology", "Doublets by language"}},
		    {"Ellipses by language", {"Terms by etymology subcategories by language"}},
		    	{"%l ellipses", {"%l terms by etymology", "Ellipses by language"}},
	    	{"Grammaticalisations by language", {"Terms by etymology subcategories by language"}},
		    	{"%l grammaticalisations", {"%l terms by etymology", "Grammaticalisations by language"}},
		    {"Initialisms by language", {"Terms by etymology subcategories by language"}},
		    	{"%l initialisms", {"%l terms by etymology", "Initialisms by language"}},
		    {"Nominalisations by language", {"Terms by etymology subcategories by language"}},
		    	{"%l nominalisations", {"%l terms by etymology", "Nominalisations by language"}},
		    {"Onomatopoeias by language", {"Terms by etymology subcategories by language"}},
		    	{"%l onomatopoeias", {"%l terms by etymology", "Onomatopoeias by language"}},
		    {"Rebracketings by language", {"Terms by etymology subcategories by language"}},
	    	    {"%l rebracketings", {"%l terms by etymology", "Rebracketings by language"}},
		    {"Reduplications by language", {"Terms by etymology subcategories by language"}},
		    	{"%l reduplications", {"%l terms by etymology", "Reduplications by language"}},
	    	{"Univerbations by language", {"Terms by etymology subcategories by language"}},
		    	{"%l univerbations", {"%l terms by etymology", "Univerbations by language"}},
		    {"Terms with uncertain etymologies by language", {"Terms by etymology subcategories by language"}},
		    	{"%l terms with uncertain etymologies", {"%l terms by etymology", "Terms with uncertain etymologies by language"}},
		    {"Terms with unknown etymologies by language", {"Terms by etymology subcategories by language"}},
		    	{"%l terms with unknown etymologies", {"%l terms by etymology", "Terms with unknown etymologies by language"}},
		    {"Terms with multiple etymologies by language", {"Terms by etymology subcategories by language"}},
		    	{"%l terms with multiple etymologies", {"%l terms by etymology", "Terms with multiple etymologies by language"}},
		    {"Verbalisations by language", {"Terms by etymology subcategories by language"}},
    			{"%l verbalisations", {"%l terms by etymology", "Verbalisations by language"}},
		{"%l terms by etymology", {"%l language| ", "Terms by etymology by language"}},

    -- Etymology source by language
    {"Terms derived from %l", {"%l language| "}},
    	{"%l terms derived from %u", {"Terms derived from %u"}},
    	{"Terms borrowed from %l", {"Terms derived from %l", "Borrowed terms by language"}},
    {"Inherited terms by language", {"Terms by etymology subcategories by language"}},
    	{"%l inherited terms", {"%l terms by etymology| ", "Inherited terms by language"}},
    {"Borrowed terms by language", {"Terms by etymology subcategories by language"}},
    	{"%l borrowed terms", {"%l terms by etymology| ", "Borrowed terms by language"}},
    		{"%l terms borrowed from %s", {"%l borrowed terms| ", "%l terms derived from %s| ", "Terms borrowed from %s"}},
    		{"%l orthographic borrowings", {"%l borrowed terms| ", "Orthographic borrowings by language"}},
    	{"Orthographic borrowings from %s by language", {"Terms borrowed from %s| ", "Borrowed terms by language"}},
		{"Semantic loans from %s", {"Terms borrowed from %s| ", "Borrowed terms by language"}},
		{"Phono-semantic matchings from %s", {"Terms borrowed from %s| ", "Borrowed terms by language"}},
		{"Transliterations of %s", {"Terms borrowed from %s| ", "Borrowed terms by language"}},
    {"Calques by language", {"Terms by etymology subcategories by language"}},
    	{"%l calques", {"%l terms by etymology", "Calques by language"}},
    		{"%l terms calqued from %s", {"%l calques", "%l terms borrowed from %s", "Terms calqued from %s"}},
    {"Terms inherited from %s", {"Terms derived from %s", "Inherited terms by language"}},
    	{"%l terms inherited from %s", {"%l inherited terms", "%l terms derived from %s", "Terms inherited from %s"}},
    {"Terms calqued from %s", {"Terms borrowed from %s", "Borrowed terms by language"}},
    {"Learned borrowings by language", {"Terms by etymology subcategories by language"}},
    	{"Learned borrowings from %s by language", {"Terms borrowed from %s", "Borrowed terms by language"}},
    			{"%l learned borrowings from %s", {"%l learned borrowings", "%l terms borrowed from %s", "Learned borrowings from %s by language"}},
		{"%l learned borrowings", {"%l borrowed terms", "Learned borrowings by language"}},
    {"Orthographic borrowings by language", {"Terms by etymology subcategories by language"}},
    	{"%l orthographic borrowings from %s", {"%l orthographic borrowings", "%l terms borrowed from %s", "Orthographic borrowings from %s by language"}},
    {"Semantic loans by language", {"Terms by etymology subcategories by language"}},
    	{"%l semantic loans", {"%l borrowed terms", "Semantic loans by language"}},
    		{"%l semantic loans from %s", {"%l semantic loans", "%l terms borrowed from %s", "Semantic loans from %s"}},
    {"Phono-semantic matchings by language", {"Terms by etymology subcategories by language"}},
    	{"%l phono-semantic matchings", {"%l borrowed terms", "Phono-semantic matchings by language"}},
    		{"%l phono-semantic matchings from %s", {"%l phono-semantic matchings", "%l terms borrowed from %s", "Phono-semantic matchings from %s"}},
    {"Transliterations by language", {"Terms by etymology subcategories by language"}},
    	{"%l transliterations", {"%l borrowed terms", "Transliterations by language"}},
    		{"%l transliterations of %s", {"%l transliterations", "%l terms borrowed from %s", "Transliterations of %s"}},

    -- Affix etymology
    {"Compound terms by language", {"Terms by etymology subcategories by language"}},
    	{"%l compound terms", {"%l terms by etymology|compound terms", "Compound terms by language"}},
    		{"%l %s compounds", {"%l compound terms|%s"}},
    {"Terms by prefix by language", {"Terms by etymology subcategories by language"}},
    	{"%l terms by prefix", {"%l prefixes| ", "%l terms by etymology| ", "Terms by prefix by language"}},
    		{"%l terms prefixed with %s", {"%l terms by prefix| "}},
    {"Terms by suffix by language", {"Terms by etymology subcategories by language"}},
    	{"%l terms by suffix", {"%l suffixes| ", "%l terms by etymology| ", "Terms by suffix by language"}},
    		{"%l terms suffixed with %s", {"%l terms by suffix| "}},
    {"Terms by infix by language", {"Terms by etymology subcategories by language"}},
    	{"%l terms by infix", {"%l infixes| ", "%l terms by etymology| ", "Terms by infix by language"}},
    		{"%l terms infixed with %s", {"%l terms by infix| "}},
    {"Terms by circumfix by language", {"Terms by etymology subcategories by language"}},
    	{"%l terms by circumfix", {"%l circumfixes| ", "%l terms by etymology| ", "Terms by circumfix by language"}},
    		{"%l terms circumfixed with %s", {"%l terms by circumfix| "}},

    -- Coinage
    {"Coinages by language", {"Terms by etymology subcategories by language"}},
    {"%l coinages", {"%l terms by etymology", "Coinages by language"}},
    
    -- Entry maintenance
    {"Entry maintenance", {"Fundamental| "}},
    	{"Terms which require adding to also data", {"Entry maintenance| "}},
	    {"Pages using outdated templates", {"Entry maintenance| "}},
	    {"Category pages not matched by auto cat", {"Entry maintenance| "}},
	    {"Translations to update", {"Entry maintenance| "}},
	    {"Etymology headings to update", {"Entry maintenance| "}},
	    {"Entry maintenance by language", {"Entry maintenance| "}},
		    {"Terms with usage examples by language", {"Entry maintenance by language| "}},
		    {"%l entry maintenance", {"%l language| ", "Entry maintenance by language"}},
		    	{"%l terms with manually entered pronunciation", {"%l entry maintenance| "}},
		    {"%l terms with usage examples", {"%l entry maintenance| ", "Terms with usage examples by language"}},
		    
		    {"Terms with translations by language", {"Entry maintenance by language| "}},
		    	{"%l terms with translations", {"Terms with translations by language"}},
		    	{"Terms with %l translations by language", {"Terms with translations by language|%l"}},
		    		{"%l terms with %u translations", {"%l terms with translations", "Terms with %u translations by language"}},
		    {"Terms needing %l translations", {"Entry maintenance by language| "}},	
		    
		    {"Terms with cognates by language", {"Entry maintenance by language| "}},
		    	{"%l terms with cognates", {"Terms with cognates by language"}},
		    	{"Terms with %l cognates by language", {"Terms with cognates by language|%l"}},
		    		{"%l terms with %u cognates", {"%l terms with cognates", "Terms with %u cognates by language"}},
		    
		    {"%l terms missing %s", {"%l entry maintenance"}},
		    {"%l terms needing %s", {"%l entry maintenance"}},
		    {"%l terms without %s", {"%l entry maintenance"}},
    
    -- Miscellaneous terms (custom)
    {"Homophones by language", {"Fundamental| "}},
    	{"%l homophones", {"%l language| ", "Homophones by language"}},
    {"Interlingual homographs", {"Fundamental| "}},
    {"Requested terms by language", {"Fundamental| "}},
    	{"%l requested terms", {"%l language| ", "Requested terms by language"}},
    		{"%l terms requested by my %s", {"%l requested terms"}},
    {"Nth terms by language", {"Fundamental| "}},
    	{"%l nth terms", {"%l language| ", "Nth terms by language"}},
    
    -- Usage labels by language
    	-- Language usage labels
    {"Terms by usage by language", {"Fundamental| "}},
    	{"%l terms by usage", {"%l language| ", "Terms by usage by language"}},
    {"Terms by usage subcategories by language", {"Terms by usage by language| "}},
	    {"Archaic terms by language", {"Terms by usage subcategories by language"}},
	    	{"%l archaic terms", {"%l terms by usage", "Archaic terms by language"}},
	    {"Colloquial terms by language", {"Terms by usage subcategories by language"}},
	    	{"%l colloquial terms", {"%l terms by usage", "Colloquial terms by language"}},
	    {"Dated terms by language", {"Terms by usage subcategories by language"}},
	    	{"%l dated terms", {"%l terms by usage", "Dated terms by language"}},
	    {"Derogatory terms by language", {"Terms by usage subcategories by language"}},
	    	{"%l derogatory terms", {"%l terms by usage", "Derogatory terms by language"}},
	    {"Dialectal terms by language", {"Terms by usage subcategories by language"}},
	    	{"%l dialectal terms", {"%l terms by usage", "Dialectal terms by language"}},
	    {"Euphemisms by language", {"Terms by usage subcategories by language"}},
	    	{"%l euphemisms", {"%l terms by usage", "Euphemisms by language"}},
	    {"Formal terms by language", {"Terms by usage subcategories by language"}},
	    	{"%l formal terms", {"%l terms by usage", "Formal terms by language"}},
	    {"Gender-neutral terms by language", {"Terms by usage subcategories by language"}},
	    	{"%l gender-neutral terms", {"%l terms by usage", "Gender-neutral terms by language"}},
	    {"Humble terms by language", {"Terms by usage subcategories by language"}},
	    	{"%l humble terms", {"%l terms by usage", "Humble terms by language"}},
    	{"Idioms by language", {"Terms by usage subcategories by language"}},
	    	{"%l idioms", {"%l terms by usage", "Idioms by language"}},
	    {"Jocular terms by language", {"Terms by usage subcategories by language"}},
	    	{"%l jocular terms", {"%l terms by usage", "Jocular terms by language"}},
	    {"Obsolete terms by language", {"Terms by usage subcategories by language"}},
	    	{"%l obsolete terms", {"%l terms by usage", "Obsolete terms by language"}},
	    {"Offensive terms by language", {"Terms by usage subcategories by language"}},
	    	{"%l offensive terms", {"%l terms by usage", "Offensive terms by language"}},
	    {"Pejorative terms by language", {"Terms by usage subcategories by language"}},
	    	{"%l pejorative terms", {"%l terms by usage", "Pejorative terms by language"}},
	    {"Sarcastic terms by language", {"Terms by usage subcategories by language"}},
	    	{"%l sarcastic terms", {"%l terms by usage", "Sarcastic terms by language"}},
	    {"Slang terms by language", {"Terms by usage subcategories by language"}},
	    	{"%l slang terms", {"%l terms by usage", "Slang terms by language"}},
	    {"Slurs by language", {"Terms by usage subcategories by language"}},
	    	{"%l slurs", {"%l terms by usage", "Slurs by language"}},
	    {"Vulgar terms by language", {"Terms by usage subcategories by language"}},
			{"%l vulgar terms", {"%l terms by usage", "Vulgar terms by language"}},
    -- Templates
    {"Templates", {"Fundamental| "}},
    {"Template documentation", {"Templates| "}},
    {"Documentation subpages", {"Fundamental| ", "Templates| ", "Modules| "}},
    {"Templates by language", {"Templates"}},
    {"Entry templates", {"Templates"}},
    {"Link templates", {"Templates"}},
    {"Banner templates", {"Templates"}},
    {"Encyclopedia templates", {"Templates"}},
    {"Meta", {"Templates"}},
    {"Etymology templates", {"Entry templates"}},
    {"Definition templates", {"Entry templates"}},
    {"Pronunciation templates", {"Entry templates"}},
    {"Translation templates", {"Entry templates"}},
    {"%l templates", {"Templates by language"}},
    {"%s templates", {"Templates"}},
    -- Modules
    {"Modules", {"Fundamental| "}},
    {"Modules by language", {"Modules"}},
    {"%l modules", {"Modules by language"}},
    -- Topics
    {"Topics by language", {"Fundamental| "}},
    	{"In-world terms by language", {"Topics by language"}},
    	{"Out-of-world terms by language", {"Topics by language"}},
    	{"%l topics", {"%l language| ", "Topics by language| "}},
    -- Topic subcategories 
    	-- World specificity
	    {"%l in-world terms", {"%l topics| ", "In-world terms by language"}},
	    {"%l out-of-world terms", {"%l topics| ", "Out-of-world terms by language"}},
	    -- Names
	    {"%l names", {"%l topics| ", "Names by language"}},
	    	{"%l given names", {"Given names by language", "%l names| "}},
	    		{"%l %s given names", {"%s given names by language", "%l given names| "}},
	    	{"%l surnames", {"Surnames by language", "%l names| "}},
	    		{"%l %s surnames", {"%s surnames by language", "%l surnames| "}},
	    	
    	{"Names by language", {"Topics by language"}},
    		{"Given names by language", {"Names by language| "}},
    			{"%s given names by language", {"Given names by language| "}},
    		{"Surnames by language", {"Names by language| "}},
    			{"%s surnames by language", {"Surnames by language| "}},
    		
		{"%l names %s", {"%l names| "}},
			
	-- Sort other term descriptors as lemma subcategories (needs to be at the end)
		{"%s terms by language", {"Lemmas subcategories by language"}},
	    {"%l comparable terms", {"%l language| ", "Comparable terms by language"}},
    	{"%l comparable %ps", {"%l %ps| ", "Comparable terms by language"}},
	    {"%l uncomparable terms", {"%l language| ", "Uncomparable terms by language"}},
	    {"%l %s terms", {"%l language| ", "%s terms by language"}},
		{"%l uncomparable terms", {"%l language| ", "Uncomparable terms by language"}},
		{"%l %ps %s", {"%l %ps| "}},
}

-- provides initial capitalisation
local function capitalize(word)
	if mw.ustring.len(word) > 1 then
		return mw.ustring.upper(mw.ustring.sub(word, 1, 1))	.. mw.ustring.sub(word, 2)
	elseif mw.ustring.len(word) == 1 then
		return mw.ustring.upper(word)
	end
	error("Empty input for capitalisation")
end

-- process subtopics

for subtopic, supertopics in pairs(subtopics) do
	local subcats = {"%l topics|" .. subtopic, capitalize(subtopic) .. " topic by language| "}
	local subcats_topic = {"Topics by language"}
	if type(supertopics) == "string" then
		table.insert(subcats, "%c:" .. capitalize(supertopics) .. "|" .. subtopic)
		table.insert(subcats_topic, capitalize(supertopics) .. " topic by language")
	elseif type(supertopics) == "table" then
		for _, supertopic in ipairs(supertopics) do
			table.insert(subcats, "%c:" .. capitalize(supertopic) .. "|" .. subtopic)
			table.insert(subcats_topic, capitalize(supertopic) .. " topic by language")
		end
	end
	table.insert(cats, {capitalize(subtopic) .. " topic by language", subcats_topic})
	table.insert(cats, {"%c:" .. capitalize(subtopic), subcats})
end
table.insert(cats, {"%s topic by language", {"Topics by language"}})
table.insert(cats, {"%c:%s", {"%l topics|%s", "%s topic by language| "}})


return {
	cats = cats,
	pos = pos,
}