FANDOM


local CompanyNames = {
    ["america's best comics"] = "America's Best Comics",
    ['abc'] = "America's Best Comics",
    ["america's best"] = "America's Best Comics",
    ["[[america's best comics]]"] = "America's Best Comics",
    ['all-american comics'] = 'All-American Publications',
    ['all-american'] = 'All-American Publications',
    ['all american comics'] = 'All-American Publications',
    ['all american publications'] = 'All-American Publications',
	['[[all-american comics]]'] = 'All-American Publications',
	['all-american publications'] = 'All-American Publications',
	['[[all-american publications]]'] = 'All-American Publications',
	['dc'] = 'DC Comics',
	['dc comics'] = 'DC Comics',
	['national comics'] = 'DC Comics',
	['national allied'] = 'DC Comics',
	['national allied publications'] = 'DC Comics',
	['national periodicals'] = 'DC Comics',
	['national periodical'] = 'DC Comics',
	['national periodical publications'] = 'DC Comics',
	['[[national periodical publications]]'] = 'DC Comics',
	['johnny dc'] = 'Johnny DC',
	['[[johnny dc]]'] = 'Johnny DC',
	['marvel comics'] = 'Marvel Comics',
	['marvel'] = 'Marvel Comics',
	['[[marvel comics]]'] = 'Marvel Comics',
	['quality comics'] = 'Quality Comics',
	['quality'] = 'Quality Comics',
	['[[quality comics]]'] = 'Quality Comics',
	['vertigo'] = 'Vertigo',
	['[[vertigo]]'] = 'Vertigo',
	['wildstorm'] = 'WildStorm Productions',
	['wildstorm entertainment'] = 'WildStorm Productions',
	['wildstorm productions'] = 'WildStorm Productions',
	['[[wildstorm]]'] = 'WildStorm Productions',
	['[[wildstorm productions]]'] = 'WildStorm Productions',
	['image '] = 'Image Comics',
	['[[image]]'] = 'Image Comics',
	['[[image comics]]'] = 'Image Comics',
	['image comics'] = 'Image Comics',
	['darkhorse comics'] = 'Dark Horse Comics',
	['darkhorse'] = 'Dark Horse Comics',
	['[[darkhorse]]'] = 'Dark Horse Comics',
	['[[darkhorse comics]]'] = 'Dark Horse Comics',
	['dark horse'] = 'Dark Horse Comics',
	['[[dark horse]]'] = 'Dark Horse Comics',
	['[[dark horse comics]]'] = 'Dark Horse Comics',
	['dark horse comics'] = 'Dark Horse Comics',
	['ec'] = 'EC Comics',
	['educational comics'] = 'EC Comics',
	['ec comics'] = 'EC Comics',
	['top cow'] = 'Top Cow Productions',
	['[[top cow]]'] = 'Top Cow Productions',
	['[[top cow productions]]'] = 'Top Cow Productions',
	['top cow productions'] = 'Top Cow Productions',
	['charlton'] = 'Charlton Comics',
	['charlton comics'] = 'Charlton Comics',
	['[[charlton]]'] = 'Charlton Comics',
	['[[charlton comics]]'] = 'Charlton Comics',
	['fox'] = 'Fox Features Syndicate',
	['filmation'] = 'Filmation Associates',
	['wb'] = 'Warner Bros. Entertainment, Inc.',
	['warner bros.'] = 'Warner Bros. Entertainment, Inc.',
	['warner bros'] = 'Warner Bros. Entertainment, Inc.',
	['warner brothers'] = 'Warner Bros. Entertainment, Inc.',
	['mirage'] = 'Mirage Comics',
	['tundra'] = 'Tundra Comics',
	['tundra (comics)'] = 'Tundra Comics',
	['impact'] = 'Impact Comics',
	['impact comics'] = 'Impact Comics',
	['impact (comics)'] = 'Impact Comics',
	['fawcett'] = 'Fawcett Publications',
	['fawcett comics'] = 'Fawcett Publications',
	['fawcett (comics)'] = 'Fawcett Publications',
	['fawcett publications'] = 'Fawcett Publications',
	['dynamite'] = 'Dynamite Entertainment',
	['[[dynamite]]'] = 'Dynamite Entertainment',
	['dynamite comics'] = 'Dynamite Entertainment',
	['[[dynamite comics]]'] = 'Dynamite Entertainment',
	['dynamite entertainment'] = 'Dynamite Entertainment',
	['[[dynamite entertainment]]'] = 'Dynamite Entertainment',
	['cliffhanger!'] = 'Cliffhanger Productions',
	['cliffhanger'] = 'Cliffhanger Productions',
	['cliffhanger productions'] = 'Cliffhanger Productions',
	['homage'] = 'Homage Comics',
	['idw'] = 'IDW Publishing',
	['i.d.w.'] = 'IDW Publishing',
	['i.d.w. publishing'] = 'IDW Publishing',
	['humanoids'] = 'Humanoids Publishing',
}
 
----------------------------
-- Libraries of functions --
----------------------------
-- stands for High Frequency
-- local HF = require('Module:ComicsHF')
-- Parses invocation parameters, trims whitespace, and removes blanks.
local getArgs = require('Dev:Arguments').getArgs
-- Gives the name of the current page. It's expensive, so we only do it once.
-- The _G then makes it global, available to all page functions.
_G.vars = { Pagename = mw.title.getCurrentTitle().text }
 
----------------------------------------------------------
-- Public functions (called from a Template or article) --
----------------------------------------------------------
 
-- There is no standalone template, so no public functions.
 
--------------------------------------------------------
-- Internal functions (used in this and other Modules --
--------------------------------------------------------
function CompanyNames:normalize( name )
    lowername = string.lower( name )
    if type( self[lowername] ) == 'string' then
        return self[lowername]
    else
        return name
    end
end
 
function CompanyNames:link( name )
    return string.format('[['..'%s]]', self:normalize(name))
end
 
function CompanyNames:cat_staff( name  )
    return string.format( 
            '[['..'Category:%s Staff]]',
            self:normalize(name)
        )
end
 
function CompanyNames:in_database( name )
    if type( self[ string.lower( name ) ] ) == 'string' then
        return true
    else
        return nil
    end
end
 
-------------------------------------------------
-- Output (send it back to whatever called it) --
-------------------------------------------------
return CompanyNames