<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://www.boywiki.org/en/index.php?action=history&amp;feed=atom&amp;title=Module%3ATelevision_infoboxes_disambiguation_check</id>
	<title>Module:Television infoboxes disambiguation check - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://www.boywiki.org/en/index.php?action=history&amp;feed=atom&amp;title=Module%3ATelevision_infoboxes_disambiguation_check"/>
	<link rel="alternate" type="text/html" href="https://www.boywiki.org/en/index.php?title=Module:Television_infoboxes_disambiguation_check&amp;action=history"/>
	<updated>2026-04-06T11:56:03Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.45.1</generator>
	<entry>
		<id>https://www.boywiki.org/en/index.php?title=Module:Television_infoboxes_disambiguation_check&amp;diff=54599&amp;oldid=prev</id>
		<title>Etenne: Created page with &quot;local libraryUtil = require(&#039;libraryUtil&#039;)  --=============================================================-- -- DisambiguationPattern class. local function DisambiguationPattern(o) 	local DisambiguationPattern = o or {pattern = &quot;&quot;, type = &quot;&quot;} 	local checkSelf = libraryUtil.makeCheckSelfFunction( &#039;Television infoboxes disambiguation check&#039;, &#039;DisambiguationPattern&#039;, DisambiguationPattern, &#039;Television infoboxes disambiguation check object&#039; )  	return DisambiguationPattern...&quot;</title>
		<link rel="alternate" type="text/html" href="https://www.boywiki.org/en/index.php?title=Module:Television_infoboxes_disambiguation_check&amp;diff=54599&amp;oldid=prev"/>
		<updated>2022-08-17T17:56:14Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;local libraryUtil = require(&amp;#039;libraryUtil&amp;#039;)  --=============================================================-- -- DisambiguationPattern class. local function DisambiguationPattern(o) 	local DisambiguationPattern = o or {pattern = &amp;quot;&amp;quot;, type = &amp;quot;&amp;quot;} 	local checkSelf = libraryUtil.makeCheckSelfFunction( &amp;#039;Television infoboxes disambiguation check&amp;#039;, &amp;#039;DisambiguationPattern&amp;#039;, DisambiguationPattern, &amp;#039;Television infoboxes disambiguation check object&amp;#039; )  	return DisambiguationPattern...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;local libraryUtil = require(&amp;#039;libraryUtil&amp;#039;)&lt;br /&gt;
&lt;br /&gt;
--=============================================================--&lt;br /&gt;
-- DisambiguationPattern class.&lt;br /&gt;
local function DisambiguationPattern(o)&lt;br /&gt;
	local DisambiguationPattern = o or {pattern = &amp;quot;&amp;quot;, type = &amp;quot;&amp;quot;}&lt;br /&gt;
	local checkSelf = libraryUtil.makeCheckSelfFunction( &amp;#039;Television infoboxes disambiguation check&amp;#039;, &amp;#039;DisambiguationPattern&amp;#039;, DisambiguationPattern, &amp;#039;Television infoboxes disambiguation check object&amp;#039; )&lt;br /&gt;
&lt;br /&gt;
	return DisambiguationPattern&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--=============================================================--&lt;br /&gt;
&lt;br /&gt;
-- Constants.&lt;br /&gt;
local DAB_VALID = {&lt;br /&gt;
	[true] = &amp;quot;valid&amp;quot;,&lt;br /&gt;
	[false] = &amp;quot;invalid&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
local CATEGORY_INCORRECT = &amp;quot;[[Category:Television articles with incorrect naming style]]&amp;quot;&lt;br /&gt;
&lt;br /&gt;
local validationTypeList = {&lt;br /&gt;
	[&amp;quot;VALIDATION_TYPE_YEAR_COUNTRY&amp;quot;] = 1,&lt;br /&gt;
	[&amp;quot;VALIDATION_TYPE_YEAR&amp;quot;] = 2,&lt;br /&gt;
	[&amp;quot;VALIDATION_TYPE_COUNTRY&amp;quot;] = 3,&lt;br /&gt;
	[&amp;quot;VALIDATION_TYPE_YEAR_SEASON_NUMBER&amp;quot;] = 4,&lt;br /&gt;
	[&amp;quot;VALIDATION_TYPE_COUNTRY_SEASON_NUMBER&amp;quot;] = 5,&lt;br /&gt;
	[&amp;quot;VALIDATION_TYPE_SEASON_NUMBER&amp;quot;] = 6,&lt;br /&gt;
	[&amp;quot;VALIDATION_TYPE_COUNTRY_SEASON&amp;quot;] = 7,&lt;br /&gt;
	[&amp;quot;VALIDATION_TYPE_YEAR_COUNTRY_SEASON_NUMBER&amp;quot;] = 8&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
local debugMessageList = {&lt;br /&gt;
	[&amp;quot;DEBUG_EMPTY_TITLE&amp;quot;] = &amp;quot;Debug: Error: Empty title.&amp;quot;,&lt;br /&gt;
	[&amp;quot;DEBUG_NO_DAB&amp;quot;] = &amp;quot;Debug: No disambiguation.&amp;quot;,&lt;br /&gt;
	[&amp;quot;DEBUG_TITLE_ON_EXCEPTION&amp;quot;] = &amp;quot;Debug: Title on exception list.&amp;quot;,&lt;br /&gt;
	[&amp;quot;DEBUG_VALID_FORMAT&amp;quot;] = &amp;quot;Debug: Using a valid format.&amp;quot;,&lt;br /&gt;
	[&amp;quot;DEBUG_NOT_VALID_FORMAT&amp;quot;] = &amp;quot;Debug: Not a valid format.&amp;quot;,&lt;br /&gt;
	[&amp;quot;DEBUG_YEAR_COUNTRY&amp;quot;] = &amp;quot;Debug: Using a valid format with an extended Year and Country - {}.&amp;quot;,&lt;br /&gt;
	[&amp;quot;DEBUG_YEAR&amp;quot;] = &amp;quot;Debug: Using a valid format with an extended Year - {}.&amp;quot;,&lt;br /&gt;
	[&amp;quot;DEBUG_COUNTRY&amp;quot;] = &amp;quot;Debug: Using a valid format with an extended Country - {}.&amp;quot;,&lt;br /&gt;
	[&amp;quot;DEBUG_INCORRECT_STYLE&amp;quot;] = &amp;quot;Debug: Using a valid format but using an incorrect extended style.&amp;quot;,&lt;br /&gt;
	[&amp;quot;DEBUG_INCORRECT_INFOBOX&amp;quot;] = &amp;quot;Debug: Using incorrect infobox - {}.&amp;quot;,&lt;br /&gt;
	[&amp;quot;DEBUG_YEAR_SEASON_NUMBER&amp;quot;] = &amp;quot;Debug: Using a valid format with an extended Year and Season number - {}.&amp;quot;,	&lt;br /&gt;
	[&amp;quot;DEBUG_COUNTRY_SEASON_NUMBER&amp;quot;] = &amp;quot;Debug: Using a valid format with an extended Country and Season number - {}.&amp;quot;,	&lt;br /&gt;
	[&amp;quot;DEBUG_SEASON_NUMBER&amp;quot;] = &amp;quot;Debug: Using a valid format with a Season number - {}.&amp;quot;,&lt;br /&gt;
	[&amp;quot;DEBUG_COUNTRY_SEASON&amp;quot;] = &amp;quot;Debug: Using a valid format with a Country and the word Season - {}.&amp;quot;,&lt;br /&gt;
	[&amp;quot;DEBUG_YEAR_COUNTRY_SEASON_NUMBER&amp;quot;] = &amp;quot;Debug: Using a valid format with an extended Year, Country and Season number - {}.&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
-- Local function which checks if both booleans are true or not.&lt;br /&gt;
local function validateTwoParameters(isValid1, isValid2)&lt;br /&gt;
	if (isValid1 and isValid2) then&lt;br /&gt;
		return true&lt;br /&gt;
	else&lt;br /&gt;
		return false&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Validate that the season number entered is a valid number -&lt;br /&gt;
-- that it does not start with a leading zero (0).&lt;br /&gt;
local function validateSeasonNumber(seasonNumber)&lt;br /&gt;
	if (tonumber(string.sub(seasonNumber, 1, 1)) == 0) then&lt;br /&gt;
		return false&lt;br /&gt;
	else&lt;br /&gt;
		return true&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Validate that the year entered is a valid year.&lt;br /&gt;
local function validateYear(year)&lt;br /&gt;
	if (string.len(year) == 4) then&lt;br /&gt;
		return true&lt;br /&gt;
	else&lt;br /&gt;
		return false&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Validate that the text entered is a supported country adjective.&lt;br /&gt;
local function validateCountryAdjective(adjective)&lt;br /&gt;
	local data = mw.loadData(&amp;#039;Module:Country adjective&amp;#039;)&lt;br /&gt;
&lt;br /&gt;
	-- Search for a country corresponding to the given text.&lt;br /&gt;
	if (data.getCountryFromAdj[adjective]) then&lt;br /&gt;
		return true&lt;br /&gt;
	else&lt;br /&gt;
		return false&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Checks pages using by validating the disambiguation patterns.&lt;br /&gt;
local function validatePatterns(disambiguation, disambiguationPatternList)&lt;br /&gt;
	local year = &amp;quot;&amp;quot;&lt;br /&gt;
	local adjective = &amp;quot;&amp;quot;&lt;br /&gt;
	local seasonNumber = &amp;quot;&amp;quot;&lt;br /&gt;
	local isYearValid&lt;br /&gt;
	local isAdjectiveValid&lt;br /&gt;
	local isSeasonNumberValid&lt;br /&gt;
&lt;br /&gt;
	for i, v in ipairs(disambiguationPatternList) do&lt;br /&gt;
		local currentDisambiguationPattern = disambiguationPatternList[i]&lt;br /&gt;
		if (disambiguation:match(currentDisambiguationPattern.pattern)) then&lt;br /&gt;
			&lt;br /&gt;
			-- Year and Country styles: &amp;quot;1999 American TV series&amp;quot;&lt;br /&gt;
			if (currentDisambiguationPattern.type == validationTypeList[&amp;quot;VALIDATION_TYPE_YEAR_COUNTRY&amp;quot;]) then&lt;br /&gt;
				year, adjective = disambiguation:match(currentDisambiguationPattern.pattern)&lt;br /&gt;
				isYearValid = validateYear(year)&lt;br /&gt;
				isAdjectiveValid = validateCountryAdjective(adjective)&lt;br /&gt;
&lt;br /&gt;
				local isValid = validateTwoParameters(isYearValid, isAdjectiveValid)&lt;br /&gt;
				return isValid, debugMessageList[&amp;quot;DEBUG_YEAR_COUNTRY&amp;quot;]:gsub(&amp;quot;{}&amp;quot;, DAB_VALID[isValid])&lt;br /&gt;
&lt;br /&gt;
			-- Year styles: &amp;quot;1999 TV series&amp;quot;&lt;br /&gt;
			elseif (currentDisambiguationPattern.type == validationTypeList[&amp;quot;VALIDATION_TYPE_YEAR&amp;quot;]) then&lt;br /&gt;
				year = disambiguation&lt;br /&gt;
				isYearValid = validateYear(year)&lt;br /&gt;
				return isYearValid, debugMessageList[&amp;quot;DEBUG_YEAR&amp;quot;]:gsub(&amp;quot;{}&amp;quot;, DAB_VALID[isYearValid])&lt;br /&gt;
&lt;br /&gt;
			-- Country styles: &amp;quot;American TV series&amp;quot;&lt;br /&gt;
			elseif (currentDisambiguationPattern.type == validationTypeList[&amp;quot;VALIDATION_TYPE_COUNTRY&amp;quot;]) then&lt;br /&gt;
				adjective = disambiguation&lt;br /&gt;
				isAdjectiveValid = validateCountryAdjective(adjective)&lt;br /&gt;
				return isAdjectiveValid, debugMessageList[&amp;quot;DEBUG_COUNTRY&amp;quot;]:gsub(&amp;quot;{}&amp;quot;, DAB_VALID[isAdjectiveValid])&lt;br /&gt;
&lt;br /&gt;
			-- Year and Season number styles: &amp;quot;1999 TV series, season 1&amp;quot;&lt;br /&gt;
			elseif (currentDisambiguationPattern.type == validationTypeList[&amp;quot;VALIDATION_TYPE_YEAR_SEASON_NUMBER&amp;quot;]) then&lt;br /&gt;
				year, seasonNumber = disambiguation:match(currentDisambiguationPattern.pattern)&lt;br /&gt;
				isYearValid = validateYear(year)&lt;br /&gt;
				isSeasonNumberValid = validateSeasonNumber(seasonNumber)&lt;br /&gt;
&lt;br /&gt;
				local isValid = validateTwoParameters(isYearValid, isSeasonNumberValid)&lt;br /&gt;
				return isValid, debugMessageList[&amp;quot;DEBUG_YEAR_SEASON_NUMBER&amp;quot;]:gsub(&amp;quot;{}&amp;quot;, DAB_VALID[isValid])&lt;br /&gt;
&lt;br /&gt;
			-- Country and Season number styles: &amp;quot;American season 1&amp;quot; and &amp;quot;American TV series, season 1&amp;quot;&lt;br /&gt;
			elseif (currentDisambiguationPattern.type == validationTypeList[&amp;quot;VALIDATION_TYPE_COUNTRY_SEASON_NUMBER&amp;quot;]) then&lt;br /&gt;
				adjective, seasonNumber = disambiguation:match(currentDisambiguationPattern.pattern)&lt;br /&gt;
				isAdjectiveValid = validateCountryAdjective(mw.text.trim(adjective))&lt;br /&gt;
				isSeasonNumberValid = validateSeasonNumber(seasonNumber)&lt;br /&gt;
				&lt;br /&gt;
				local isValid = validateTwoParameters(isAdjectiveValid, isSeasonNumberValid)&lt;br /&gt;
				return isValid, debugMessageList[&amp;quot;DEBUG_COUNTRY_SEASON_NUMBER&amp;quot;]:gsub(&amp;quot;{}&amp;quot;, DAB_VALID[isValid])&lt;br /&gt;
&lt;br /&gt;
			-- Country and the word season: &amp;quot;American season&amp;quot;&lt;br /&gt;
			elseif (currentDisambiguationPattern.type == validationTypeList[&amp;quot;VALIDATION_TYPE_COUNTRY_SEASON&amp;quot;]) then&lt;br /&gt;
				adjective = disambiguation:match(currentDisambiguationPattern.pattern)&lt;br /&gt;
				isAdjectiveValid = validateCountryAdjective(mw.text.trim(adjective))&lt;br /&gt;
				return isAdjectiveValid, debugMessageList[&amp;quot;DEBUG_COUNTRY_SEASON&amp;quot;]:gsub(&amp;quot;{}&amp;quot;, DAB_VALID[isAdjectiveValid])&lt;br /&gt;
&lt;br /&gt;
			--Season number styles: &amp;quot;season 1&amp;quot;&lt;br /&gt;
			elseif (currentDisambiguationPattern.type == validationTypeList[&amp;quot;VALIDATION_TYPE_SEASON_NUMBER&amp;quot;]) then&lt;br /&gt;
				seasonNumber = disambiguation:match(currentDisambiguationPattern.pattern)&lt;br /&gt;
				isSeasonNumberValid = validateSeasonNumber(seasonNumber)&lt;br /&gt;
				return isSeasonNumberValid, debugMessageList[&amp;quot;DEBUG_SEASON_NUMBER&amp;quot;]:gsub(&amp;quot;{}&amp;quot;, DAB_VALID[isSeasonNumberValid])&lt;br /&gt;
&lt;br /&gt;
			-- Year, Country and Season number styles: &amp;quot;Gladiators (2008 British TV series, series 2)&amp;quot;&lt;br /&gt;
			elseif (currentDisambiguationPattern.type == validationTypeList[&amp;quot;VALIDATION_TYPE_YEAR_COUNTRY_SEASON_NUMBER&amp;quot;]) then&lt;br /&gt;
				year, adjective, seasonNumber = disambiguation:match(currentDisambiguationPattern.pattern)&lt;br /&gt;
				isYearValid = validateYear(year)&lt;br /&gt;
				isAdjectiveValid = validateCountryAdjective(mw.text.trim(adjective))&lt;br /&gt;
				isSeasonNumberValid = validateSeasonNumber(seasonNumber)&lt;br /&gt;
				&lt;br /&gt;
				local isValid = validateTwoParameters(isYearValid, isAdjectiveValid)&lt;br /&gt;
				isValid = validateTwoParameters(isValid, isSeasonNumberValid)&lt;br /&gt;
				return isValid, debugMessageList[&amp;quot;DEBUG_YEAR_COUNTRY_SEASON_NUMBER&amp;quot;]:gsub(&amp;quot;{}&amp;quot;, DAB_VALID[isValid])&lt;br /&gt;
				&lt;br /&gt;
			-- Not a valid supported style.&lt;br /&gt;
			else&lt;br /&gt;
				-- Do nothing.&lt;br /&gt;
			end&lt;br /&gt;
		else&lt;br /&gt;
			-- Do nothing.&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	return false, debugMessageList[&amp;quot;DEBUG_INCORRECT_STYLE&amp;quot;]&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Validate that the disambiguation type is one of the supported types.&lt;br /&gt;
local function validateDisambiguationType(disambiguation, validDisambiguationTypeList)&lt;br /&gt;
	local extendedDisambiguation&lt;br /&gt;
	local count = 0&lt;br /&gt;
	&lt;br /&gt;
	for i, v in ipairs(validDisambiguationTypeList) do&lt;br /&gt;
		extendedDisambiguation, count = disambiguation:gsub(v, &amp;#039;&amp;#039;)&lt;br /&gt;
		extendedDisambiguation = mw.text.trim(extendedDisambiguation)&lt;br /&gt;
		if (count ~= 0) then&lt;br /&gt;
			-- Disambiguation was a valid type; Exit loop.&lt;br /&gt;
			break&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	count = count ~= 0 &lt;br /&gt;
	return count, extendedDisambiguation&lt;br /&gt;
&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Validate that the complete disambiguation is using a supported style.&lt;br /&gt;
local function validateDisambiguation(invoker, disambiguation, validDisambiguationTypeList, validDisambiguationPatternList)&lt;br /&gt;
	-- Check if the list is empty.&lt;br /&gt;
	if (table.getn(validDisambiguationTypeList) ~= 0) then&lt;br /&gt;
		local isDisambiguationValid, extendedDisambiguation = validateDisambiguationType(disambiguation, validDisambiguationTypeList)&lt;br /&gt;
	&lt;br /&gt;
		-- Exit module if the disambiguation type is not a supported style.&lt;br /&gt;
		if (not isDisambiguationValid) then&lt;br /&gt;
			return false, debugMessageList[&amp;quot;DEBUG_NOT_VALID_FORMAT&amp;quot;]&lt;br /&gt;
		end&lt;br /&gt;
 &lt;br /&gt;
 		-- Check if there is no extended disambiguation.&lt;br /&gt;
		if (extendedDisambiguation == &amp;#039;&amp;#039;) then&lt;br /&gt;
			return true, debugMessageList[&amp;quot;DEBUG_VALID_FORMAT&amp;quot;]&lt;br /&gt;
		end&lt;br /&gt;
		&lt;br /&gt;
		-- A bit of hack so I won&amp;#039;t need to refactor a ton of code.&lt;br /&gt;
		if (invoker ~= &amp;quot;infobox television season&amp;quot;) then&lt;br /&gt;
			disambiguation = extendedDisambiguation&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	return validatePatterns(disambiguation, validDisambiguationPatternList)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Check if the page is using disambiguation style that belongs to a different infobox.&lt;br /&gt;
local function isPageUsingIncorrectInfobox(disambiguation, otherInfoboxList)&lt;br /&gt;
	for k, v in pairs(otherInfoboxList) do&lt;br /&gt;
		if (string.match(disambiguation, k)) then&lt;br /&gt;
			return true, v, debugMessageList[&amp;quot;DEBUG_INCORRECT_INFOBOX&amp;quot;]:gsub(&amp;quot;{}&amp;quot;, k)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	return false&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Validate that the title has brackets that are part of the title and not part of disambiguation.&lt;br /&gt;
local function isOnExceptionList(title, exceptionList)&lt;br /&gt;
	for _, v in ipairs(exceptionList) do&lt;br /&gt;
		if (v == title) then&lt;br /&gt;
			return true&lt;br /&gt;
		elseif (string.match(title, v)) then&lt;br /&gt;
			return true&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	return false&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Get the disambiguation text and make sure that if the title has more than 1 pair of brackets, it returns the last one.&lt;br /&gt;
local function getDisambiguation(title)&lt;br /&gt;
	local match = require(&amp;quot;Module:String&amp;quot;)._match&lt;br /&gt;
	return match(title, &amp;quot;%s%((.-)%)&amp;quot;, 1, -1, false, &amp;quot;&amp;quot;)&lt;br /&gt;
--	return (string.match (title, &amp;#039;%s*%b()$&amp;#039;) or &amp;#039;&amp;#039;):gsub(&amp;#039;[%(%)]&amp;#039;, &amp;#039;&amp;#039;)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Validate that arg is not nill and not empty.&lt;br /&gt;
local function isEmpty(arg)&lt;br /&gt;
	if (not arg or arg == &amp;quot;&amp;quot;) then&lt;br /&gt;
		return true&lt;br /&gt;
	else&lt;br /&gt;
		return false&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Returns two objects:&lt;br /&gt;
--- The first is either an empty string or a tracking category which will appear when using the live version.&lt;br /&gt;
--- The second is a debug string which will appear when using /testcases.&lt;br /&gt;
local function main(title, invoker, validDisambiguationTypeList, validDisambiguationPatternList, exceptionList, otherInfoboxList, invalidTitleStyleList)&lt;br /&gt;
	-- Exit module if the parameter has no value.&lt;br /&gt;
	if (isEmpty(title)) then&lt;br /&gt;
		return &amp;quot;&amp;quot;, debugMessageList[&amp;quot;DEBUG_EMPTY_TITLE&amp;quot;]&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Exit module if the title has brackets that are part of the title (not disambiguation).&lt;br /&gt;
	if (isOnExceptionList(title, exceptionList)) then&lt;br /&gt;
		return &amp;quot;&amp;quot;, debugMessageList[&amp;quot;DEBUG_TITLE_ON_EXCEPTION&amp;quot;]&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	if (invoker == &amp;quot;infobox television season&amp;quot;) then&lt;br /&gt;
		if (#invalidTitleStyleList ~= 0) then&lt;br /&gt;
			for i = 1, #invalidTitleStyleList do&lt;br /&gt;
				if (string.find(title, invalidTitleStyleList[i])) then&lt;br /&gt;
					return CATEGORY_INCORRECT, debugMessageList[&amp;quot;DEBUG_NOT_VALID_FORMAT&amp;quot;]&lt;br /&gt;
				end&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
		&lt;br /&gt;
				&lt;br /&gt;
	-- Get the disambiguation.&lt;br /&gt;
	local disambiguation = getDisambiguation(title)&lt;br /&gt;
&lt;br /&gt;
	-- Exit module if the title has no disambiguation.&lt;br /&gt;
	if (isEmpty(disambiguation)) then&lt;br /&gt;
		return &amp;quot;&amp;quot;, debugMessageList[&amp;quot;DEBUG_NO_DAB&amp;quot;]&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Exit module if the disambiguation belongs to a different infobox.&lt;br /&gt;
	local isValid, category, debugString = isPageUsingIncorrectInfobox(disambiguation, otherInfoboxList)&lt;br /&gt;
	if (isValid) then&lt;br /&gt;
		return category, debugString&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	-- Check if the disambiguation is valid.&lt;br /&gt;
	isValid, debugString = validateDisambiguation(invoker, disambiguation, validDisambiguationTypeList, validDisambiguationPatternList)&lt;br /&gt;
	&lt;br /&gt;
	-- Check if the disambiguation is not valid and add category.&lt;br /&gt;
	if (not isValid) then&lt;br /&gt;
		category = CATEGORY_INCORRECT&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	return category, debugString&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return {&lt;br /&gt;
	main = main,&lt;br /&gt;
	DisambiguationPattern = DisambiguationPattern&lt;br /&gt;
	}&lt;/div&gt;</summary>
		<author><name>Etenne</name></author>
	</entry>
</feed>