local me =
-- mw.loadData doesn't support loading data that has function type, so use requirelocal config = require('Module:ArbCaseAlias/data')
local function sortByLastPart(a, b) local lastPartPattern = '([^-]+)$' local aLastPart = string.match(a, lastPartPattern) local bLastPart = string.match(b, lastPartPattern) return tonumber(aLastPart) < tonumber(bLastPart)end
local function reverseNumericCompare(a, b) return tonumber(a) > tonumber(b)end
function me.luaListCases(args) local outputBuffer = local primaryCategories = for primaryCategory, caseInfoForCategory in pairs(config.arbCaseAliasInfo.caseInfoFor) do -- skip test year 1000 if (primaryCategory ~= '1000') then table.insert(primaryCategories, primaryCategory) end end if (args['order']
function me.listCases(frame) local args = require('Module:Arguments').getArgs(frame) return me.luaListCases(args) or end
function me.luaMain(args) local alias = args[1] or
local primaryCategory = config.arbCaseAliasInfo.extractPrimaryKey(alias) if (primaryCategory
if (config.arbCaseAliasInfo.caseInfoFor[primaryCategory]
local aliasFor = for format, normalizer in pairs(config.arbCaseAliasInfo.normalizeAlias) do local normalizedAlias = normalizer(alias) if (normalizedAlias ~= nil) then aliasFor[format] = normalizedAlias end end -- loop over normalizers
for caseName, caseInfo in pairs(config.arbCaseAliasInfo.caseInfoFor[primaryCategory]) do for format, caseAlias in pairs(caseInfo) do if (aliasFor[format]
-- failed to find a match return aliasend
function me.main(frame) local args = require('Module:Arguments').getArgs(frame) return me.luaMain(args) or end
return me