FANDOM


local p = {}
 
-- These functions load in the modules that provide maps.
local AbbreviationToFull = mw.loadData( 'Module:Abbreviation/full' )
local FullToAbbreviation = mw.loadData( 'Module:Abbreviation/abbrev' )
 
-- This function returns the title that maps to the given abbreviation. If one does not exist, it returns the abbreviation itself.
function p.ToFull( frame )
	local Abbrev = frame.args[1]
 
	return AbbreviationToFull[Abbrev] or Abbrev
end
 
-- This function returns the abbreviation that maps to the given title. If one does not exist, it returns the title itself.
function p.ToAbbrev( frame )
	local Full = frame.args[1]
 
	return FullToAbbreviation[Full] or Full
end
 
return p
 
--[[Category:Lua modules]]
Community content is available under CC-BY-SA unless otherwise noted.