Jump to content

Module:Infobox television disambiguation check

Permanently protected module
From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Gonnym (talk | contribs) at 18:40, 9 June 2019. The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

-- This module requires the use of the following modules.
local getArgs = require('Module:Arguments').getArgs
local validateDisambiguation = require('Module:Television infoboxes disambiguation check')

local p = {}

local validDisambiguationTypeList = {
	"TV series",
	"TV program",
	"TV programme",
	"TV film",
	"film",
	"miniseries",
	"serial",
	"game show",
	"talk show",
	"web series"
}

local validDisambiguationPatternList  = {
	validateDisambiguation.DisambiguationPattern{pattern = "^(%d+) (%D+)", type = 1}, --"VALIDATION_TYPE_YEAR_COUNTRY"
	validateDisambiguation.DisambiguationPattern{pattern = "^%d+$", type = 2}, --"VALIDATION_TYPE_YEAR"
	validateDisambiguation.DisambiguationPattern{pattern = "^%D+$", type = 3} --"VALIDATION_TYPE_COUNTRY"
}

local exceptionList = {
	"The (206)",
	"Bigg Boss (Hindi TV series)",
	"Cinderella (Apakah Cinta Hanyalah Mimpi?)",
	"Deal or No Deal Malaysia (English-language game show)",
	"Deal or No Deal Malaysia (Mandarin-language game show)",
	"How to Live with Your Parents (For the Rest of Your Life)",
	"I (Almost) Got Away With It",
	"Monty Python: Almost the Truth (Lawyers Cut)",
	"Randall and Hopkirk (Deceased)",
	"Who the (Bleep)...",
	"Who the (Bleep) Did I Marry?",
}

local otherInfoboxList = {
	["franchise"] = "[[Category:Television articles using incorrect infobox|F]]",
	["season"] = "[[Category:Television articles using incorrect infobox|S]]",
	["series %d*"] = "[[Category:Television articles using incorrect infobox|S]]",
	["radio"] = "[[Category:Television articles using incorrect infobox|R]]"
}

local function _main(args)
	local title = args[1]
	return validateDisambiguation.main(title, validDisambiguationTypeList, validDisambiguationPatternList, exceptionList, otherInfoboxList)
end

function p.main(frame)
	local args = getArgs(frame)
	local category, debugString = _main(args)
	return category
end

function p.test(frame)
	local args = getArgs(frame)
	local category, debugString = _main(args)
	return debugString
end

return p