Jump to content

Module:American football positions

From Wikipedia, the free encyclopedia

-- this module implements [[Template:AmFootball positions]]

local p = {}

local positions = {
["back"] = {"Back (American football)", "Back", "B"},
["blocking back"] = {"Quarterback", "Blocking back", "BB"},
["center (american football)"] = {"Center (gridiron football)", "Center", "C"},
["corner"] = {"Cornerback", "Cornerback", "CB"},
["defensiveback"] = {"Defensive back", "Defensive back", "DB"},
["defensiveend"] = {"Defensive end", "Defensive end", "DE"},
["dimeback"] = {"Dimeback", "Dimeback", "DIME"},
["defensivelinemen"] = {"Defensive line", "Defensive lineman", "DL"},
["defensivetackle"] = {"Defensive tackle", "Defensive tackle", "DT"},
["middleguard"] = {"Nose tackle", "Middle guard", "MG"},
["nosetackle"] = {"Nose tackle", "Nose tackle", "NT"},
["edge rusher"] = {"Edge rusher", "Edge rusher", "EDGE"},
["end"] = {"End (gridiron football)", "End", "E"},
["full back"] = {"Fullback (gridiron football)", "Fullback", "FB"},
["guard (american football)"] = {"Guard (gridiron football)", "Guard", "OG"},
["halfback (american football)"] = {"Halfback (American football)", "Halfback", "HB"},
["tailback (american football)"] = {"Halfback (American football)", "Tailback", "TB"},
["wingback (american football)"] = {"Wingback (American football)", "Wingback", "WB"},
["place kicker"] = {"Placekicker", "Placekicker", "K"},
["returnspecialist"] = {"Kick returner", "Kick returner", "KR"},
["tackle (american football)"] = {"Tackle (gridiron football position)", "Tackle", "T"},
["offensive tackle (american football)"] = {"Offensive tackle", "Offensive tackle", "OT"},
["offensivelinemen"] = {"Offensive line", "Offensive lineman", "OL"},
["nickelback"] = {"Nickelback (American football)", "Nickelback", "NB"},
["linebacker (american football)"] = {"Linebacker", "Linebacker", "LB"},
["outside linebacker (american football)"] = {"Linebacker", "Outside linebacker", "OLB"},
["inside linebacker (american football)"] = {"Linebacker", "Inside linebacker", "ILB"},
["middle linebacker (american football)"] = {"Linebacker", "Middle linebacker", "MLB"},
["snapper"] = {"Long snapper", "Long snapper", "LS"},
["punter (football)"] = {"Punter (football)", "Punter", "P"},
["quarter back"] = {"Quarterback", "Quarterback", "QB"},
["running back (american football)"] = {"Running back", "Running back", "RB"},
["safety (american football)"] = {"Safety (gridiron football position)", "Safety", "S"},
["free safety (american football)"] = {"Free safety", "Free safety", "FS"},
["strong safety (american football)"] = {"Strong safety", "Strong safety", "SS"},
["tight end (american football)"] = {"Tight end", "Tight end", "TE"},
["reciever"] = {"Wide receiver", "Wide receiver", "WR"},
["splitend"] = {"Wide receiver", "Split end", "SE"},
["flanker"] = {"Wide receiver", "Flanker", "F"},
["slotback"] = {"Slotback", "Slotback", "SB"},
["punt returner"] = {"Punt returner", "Punt returner", "PR"},
}
local aliases = {
["b"] = "back",
["bb"] = "blocking back",
["c"] = "center (american football)",
["center"] = "center (american football)",
["oc"] = "center (american football)",
["offensive center"] = "center (american football)",
["cb"] = "corner",
["cornerback"] = "corner",
["corner back"] = "corner",
["db"] = "defensiveback",
["defensive back"] = "defensiveback",
["de"] = "defensiveend",
["defensive end"] = "defensiveend",
["dime"] = "dimeback",
["dime back"] = "dimeback",
["dl"] = "defensivelinemen",
["defensive line"] = "defensivelinemen",
["defensiveline"] = "defensivelinemen",
["defensive lineman"] = "defensivelinemen",
["defensivelineman"] = "defensivelinemen",
["defensive linemen"] = "defensivelinemen",
["dt"] = "defensivetackle",
["defensive tackle"] = "defensivetackle",
["mg"] = "middleguard",
["middle guard"] = "middleguard",
["nt"] = "nosetackle",
["nose"] = "nosetackle",
["nose tackle"] = "nosetackle",
["edge"] = "edge rusher",
["e"] = "end",
["fb"] = "full back",
["fullback"] = "full back",
["g"] = "guard (american football)",
["guard"] = "guard (american football)",
["og"] = "guard (american football)",
["offensive guard"] = "guard (american football)",
["offensiveguard"] = "guard (american football)",
["hb"] = "halfback (american football)",
["halfback"] = "halfback (american football)",
["half back"] = "halfback (american football)",
["tb"] = "tailback (american football)",
["tailback"] = "tailback (american football)",
["tail back"] = "tailback (american football)",
["wb"] = "wingback (american football)",
["wingback"] = "wingback (american football)",
["wing back"] = "wingback (american football)",
["k"] = "place kicker",
["pk"] = "place kicker",
["kicker"] = "place kicker",
["placekicker"] = "place kicker",
["kr"] = "returnspecialist",
["kick returner"] = "returnspecialist",
["kickreturner"] = "returnspecialist",
["kickoff returner"] = "returnspecialist",
["kickoffreturner"] = "returnspecialist",
["kick-off returner"] = "returnspecialist",
["kick-offreturner"] = "returnspecialist",
["r"] = "returnspecialist",
["returner"] = "returnspecialist",
["rs"] = "returnspecialist",
["return specialist"] = "returnspecialist",
["t"] = "tackle (american football)",
["tackle"] = "tackle (american football)",
["ot"] = "offensive tackle (american football)",
["offensive tackle"] = "offensive tackle (american football)",
["offensivetackle"] = "offensive tackle (american football)",
["ol"] = "offensivelinemen",
["offensive line"] = "offensivelinemen",
["offensiveline"] = "offensivelinemen",
["offensive lineman"] = "offensivelinemen",
["offensivelineman"] = "offensivelinemen",
["offensive linemen"] = "offensivelinemen",
["nickel"] = "nickelback",
["slot corner"] = "nickelback",
["nickel back"] = "nickelback",
["lb"] = "linebacker (american football)",
["linebacker"] = "linebacker (american football)",
["line backer"] = "linebacker (american football)",
["backer"] = "linebacker (american football)",
["olb"] = "outside linebacker (american football)",
["outside linebacker"] = "outside linebacker (american football)",
["outside line backer"] = "outside linebacker (american football)",
["outsidelinebacker"] = "outside linebacker (american football)",
["ilb"] = "inside linebacker (american football)",
["inside linebacker"] = "inside linebacker (american football)",
["inside line backer"] = "inside linebacker (american football)",
["insidelinebacker"] = "inside linebacker (american football)",
["mlb"] = "middle linebacker (american football)",
["middle Linebacker"] = "middle linebacker (american football)",
["middle line backer"] = "middle linebacker (american football)",
["middlelinebacker"] = "middle linebacker (american football)",
["ls"] = "snapper",
["longsnapper"] = "snapper",
["long snapper"] = "snapper",
["p"] = "punter (football)",
["punter"] = "punter (football)",
["punter (american football)"] = "punter (football)",
["qb"] = "quarter back",
["quarterback"] = "quarter back",
["rb"] = "running back (american football)",
["runningback"] = "running back (american football)",
["running back"] = "running back (american football)",
["s"] = "safety (american football)",
["safety"] = "safety (american football)",
["fs"] = "free safety (american football)",
["free safety"] = "free safety (american football)",
["ss"] = "strong safety (american football)",
["strong safety"] = "strong safety (american football)",
["te"] = "tight end (american football)",
["tight end"] = "tight end (american football)",
["tightend"] = "tight end (american football)",
["wr"] = "reciever",
["wide receiver"] = "reciever",
["wide reciever"] = "reciever",
["widereceiver"] = "reciever",
["widereciever"] = "reciever",
["se"] = "splitend",
["split end"] = "splitend",
["f"] = "flanker",
["sb"] = "slotback",
["slot receiver"] = "slotback",
["slot reciever"] = "slotback",
["slot back"] = "slotback",
["pr"] = "punt returner"
}

function p._main(pos, long)
	
	pos = (pos or ''):lower()
	if aliases[pos] then
		pos = aliases[pos]
	end
	local t = positions[pos]
	if t then
		return '[[' .. t[1] .. '|' .. (long and t[2] or t[3]) .. ']]'
	end
	return 'N/A'
end

function p.main(frame)
	local args = frame:getParent().args
	local pos = args[1]
	local long = (args[2] or '') == 'long'
	return p._main(pos, long)
end

return p