local p = {}
local map = {"S", "A", "B", "C", "D", "E", "F", "G"}
function p.max(frame)
local s = frame.args[1]
if s == nil then
return ""
end
for i, k in ipairs(map) do
if string.find(s, k) ~= nil then
return k
end
end
return ""
end
function p.sort(frame)
local s = frame.args[1]
if s == nil then
return ""
end
local tem = frame.args["template"]
if tem == nil then
tem = "%s"
end
local r = ""
for i, k in ipairs(map) do
if string.find(s, k) ~= nil then
r = r .. string.format(tem, k)
end
end
return frame:preprocess(r)
end
return p