Module:auto cat/data: Difference between revisions

Jump to navigation Jump to search
ਕੋਈ ਸੋਧ ਸਾਰ ਨਹੀਂ
No edit summary
No edit summary
Line 32: Line 32:
     "symbol",
     "symbol",
     "verb",
     "verb",
}
local d_subtopics = {
['biochemistry'] = {'biology','chemistry'},
['enzymes'] = 'biochemistry',
['organic chemistry'] = 'chemistry',
['sugars'] = 'chemistry',
['cytology'] = 'biology',
['genetics'] = 'biology',
['molecular biology'] = 'biology',
['physiology'] = 'biology',
['taxonomy'] = 'biology',
['phonetics'] = 'linguistics',
['phonology'] = 'linguistics',
['algebra'] = 'mathematics',
['arithmetic'] = 'mathematics',
['calculus'] = 'mathematics',
['geometry'] = 'mathematics',
['statistics'] = 'mathematics',
['trigonometry'] = 'mathematics',
['trigonometric functions'] = 'trigonometry',
['nuclear physics'] = 'physics',
['months'] = 'time',
['seasons'] = 'time',
['days'] = 'time',
}
}


Line 361: Line 386:
    {"%l given names", {"%l topics", "Given names by language", "%l names"}},
    {"%l given names", {"%l topics", "Given names by language", "%l names"}},
    {"%l surnames", {"%l topics", "Surnames 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"}},
Line 408: Line 403:
     {"%l modules", {"Modules by language"}},
     {"%l modules", {"Modules by language"}},
}
}
-- 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(d_subtopics) do
local subcats = {}
table.insert(subcats, "%l topics")
table.insert(subcats, capitalize(subtopic) .. " topic by language")
if type(supertopics) == "string" then
table.insert(subcats, "%c:" .. capitalize(supertopics))
elseif type(supertopics) == "table" then
for _, supertopic in ipairs(supertopics) do
table.insert(subcats, "%c:" .. capitalize(supertopic))
end
end
table.insert(cats, {"%c:" .. capitalize(subtopic), subcats})
mw.logObject({"%c:" .. capitalize(subtopic), subcats})
end
table.insert(cats, {"%c:%s", {"%l topics", "%s topic by language"}})


return {
return {

Navigation menu