Jump to content

Module:Sandbox/CAS222222221

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by 風中的刀劍 (talk | contribs) at 02:43, 11 December 2014 (Created page with 'local getArgs = require('Module:Arguments').getArgs local function makeInvokeFunc(funcName) return function (frame) local args = getArgs(frame, { valueFu...'). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)

local getArgs = require('Module:Arguments').getArgs
 
local function makeInvokeFunc(funcName)
	return function (frame)
		local args = getArgs(frame, {
			valueFunc = function (key, value)
				if key == '' or key == nil then
					value = 0
				end
				return value
			end 
		})
		return p[funcName](args)
	end
end

local p = {}

local categoryList = {
	{'fa', '特色'},
	{'a', '甲'},
	{'ga', '优良'},
	{'b', '乙'},
	{'c', '丙'},
	{'start', '初'},
	{'stub', '小作品'},
	{'fl', '特色列表'},
	{'list', '列表'},
	
	{'category', '分类'},
	{'disambig', '消歧义'},
	{'file', '文件'},
	{'portal', '主题'},
	{'project', '专题'},
	{'template', '模板'},
	{'na', '非条目'},
	{'unassessed', '未评'},

}

local importanceList = {
	{'top', '极高'},
	{'high', '高'},
	{'mid', '中'},
	{'low', '低'},
	{'bottom', '极低'},
	{'no', '无'},
	{'na','不适用'},
	{'unknown', '未知'},
}

classCategory = p.makeInvokeFunc('_classCategory')

local function _classCategory(classCode)
	local ret = ''
	if class ~= 'total' then
		ret = categoryList[i][2] .. '级' .. 'projectName' .. '条目'
	end
	return ret
end
 
p.func2 = makeInvokeFunc('_func2')

function p._func2(args)
	-- Code for the second function goes here.
end

p.main = makeInvokeFunc('main')
function p._main(args)
	-- Code for the second function goes here.
	return classCategory(args[1])
end