Lompat ke isi

Modul:Infobox television season disambiguation check

Dari Wikipedia bahasa Indonesia, ensiklopedia bebas

-- 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 = {
	"seri TV, musim",
	"seri TV, musim",
	"musim",
	"seri",
	"vol."
}

local validDisambiguationPatternList = {
	validateDisambiguation.DisambiguationPattern{pattern = "^seri TV (%d+) ([%D]+), musim (%d+)$", type = 8},	-- "VALIDATION_TYPE_YEAR_COUNTRY_SEASON_NUMBER"
	validateDisambiguation.DisambiguationPattern{pattern = "^seri TV (%d+) ([%D]+), seri (%d+)$", type = 8},	-- "VALIDATION_TYPE_YEAR_COUNTRY_SEASON_NUMBER"
	validateDisambiguation.DisambiguationPattern{pattern = "^seri TV (%d+), musim (%d+)$", type = 4},			-- "VALIDATION_TYPE_YEAR_SEASON_NUMBER"
	validateDisambiguation.DisambiguationPattern{pattern = "^seri TV (%d+), seri (%d+)$", type = 4},
	validateDisambiguation.DisambiguationPattern{pattern = "^seri TV ([%D]+), musim (%d+)$", type = 5},			-- "VALIDATION_TYPE_COUNTRY_SEASON_NUMBER"
	validateDisambiguation.DisambiguationPattern{pattern = "^seri TV ([%D]+), seri (%d+)$", type = 5},
	validateDisambiguation.DisambiguationPattern{pattern = "^([%D]+) musim (%d+)$", type = 5},						-- "VALIDATION_TYPE_COUNTRY_SEASON_NUMBER"
	validateDisambiguation.DisambiguationPattern{pattern = "^([%D]+) seri (%d+)$", type = 5},
	validateDisambiguation.DisambiguationPattern{pattern = "^([%D]+) musim$", type = 7},							-- "VALIDATION_TYPE_COUNTRY_SEASON"
	validateDisambiguation.DisambiguationPattern{pattern = "^musim (%d+)$", type = 6},								-- "VALIDATION_TYPE_SEASON_NUMBER"
	validateDisambiguation.DisambiguationPattern{pattern = "^seri (%d+)$", type = 6},
	validateDisambiguation.DisambiguationPattern{pattern = "^vol. (%d+)$", type = 6}
}

local exceptionList = {
	"^Bigg Boss %(Benggala musim %d+%)$",
	"^Bigg Boss %(Hindi musim %d+%)$",
	"^Bigg Boss %(Malayalam musim %d+%)$",
	"^Bigg Boss %(Tamil musim %d+%)$",
	"^Bigg Boss %(Telugu musim %d+%)$"
}

local otherInfoboxList = {
	["^[^,]*TV series$"] = "[[Category:Artikel televisi dengan kotak info yang salah|T]]"
}

local invalidTitleStyleList = {
	"Daftar"
}

local function getOtherInfoboxListMerged()
	local infoboxTelevisionDisambiguation = require('Module:Infobox television disambiguation check')
	local list = infoboxTelevisionDisambiguation.getDisambiguationTypeList()

	for i = 1, #list do
		otherInfoboxList[list[i]] = "[[Category:Artikel televisi dengan kotak info yang salah|T]]"
	end
	
	return otherInfoboxList
end

local function _main(args)
	local title = args[1]
	local otherInfoboxListMerged = getOtherInfoboxListMerged()
	return validateDisambiguation.main(title, "infobox television season", validDisambiguationTypeList, validDisambiguationPatternList, exceptionList, otherInfoboxListMerged, invalidTitleStyleList)
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