可在模块:Class/doc创建此模块的帮助文档
local p = {}
local getArgs = require('Module:Arguments').getArgs
local convert = require('Module:NumberToChinese')._numberToChinese
function p.genName(frame)
local args = getArgs(frame)
return p._genName(args)
end
function p._levelLint(level)
if level=='高中' or level=='高' then
return {'高中','高'}
else
return {'初中','初'}
end
end
function p._genName(args)
current = require('Module:Date')._current
if current.month >= 9 then
grade = current.year + 1 - args.year
else
grade = current.year - args.year
end
level = p._levelLint(args.level)
if grade > 3 then
return level[1] .. args.year+3 .. '届' .. args.class .. '班' .. args.sub
else
return level[2] .. convert(grade) .. args.class .. '班' .. args.sub
end
end
return p