10,735
edits
TheNightAvl (talk | contribs) No edit summary |
TheNightAvl (talk | contribs) 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"}}, | ||
-- 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 { |