local p =
local data =
data["sbjv"] = data["sjv"]data["indef"] = data["ndef"] -- non-standarddata["indic"] = data["ind"]data["1sg"] = data["1s"]data["2sg"] = data["2s"]data["3sg"] = data["3s"]data["1pl"] = data["1p"]data["2pl"] = data["2p"]data["3pl"] = data["3p"]
function p.abbr(frame) local args = frame:getParent.args[1] and frame:getParent.args or frame.args local abbreviation = args[1] or error("Provide an abbreviation in parameter 1") local key = string.gsub(abbreviation, "%.$", "") key = string.lower(key) local expanded = data[key] or error("The abbreviation "..(abbreviation or "nil").." is not recognized") local _, count = mw.ustring.gsub(abbreviation, "%u", "") if count > #abbreviation * 3/4 then return ''..abbreviation..'' else return ''..abbreviation..'' endend
return p