모듈:Infobox television season disambiguation check

위키백과, 우리 모두의 백과사전.

-- 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 = {
	"텔레비전 프로그램, 시즌",
	"텔레비전 프로그램, 시리즈",
	"시즌",
	"시리즈"
}

local validDisambiguationPatternList = {
	validateDisambiguation.DisambiguationPattern{pattern = "^(%d+)년 ([%D]+)의 텔레비전 프로그램, 시즌 (%d+)$", type = 8},	-- "VALIDATION_TYPE_YEAR_COUNTRY_SEASON_NUMBER"
	validateDisambiguation.DisambiguationPattern{pattern = "^(%d+)년 ([%D]+)의 텔레비전 프로그램, 시리즈 (%d+)$", type = 8},	-- "VALIDATION_TYPE_YEAR_COUNTRY_SEASON_NUMBER"
	validateDisambiguation.DisambiguationPattern{pattern = "^(%d+)년 텔레비전 프로그램, 시즌 (%d+)$", type = 4},			-- "VALIDATION_TYPE_YEAR_SEASON_NUMBER"
	validateDisambiguation.DisambiguationPattern{pattern = "^(%d+)년 텔레비전 프로그램, 시리즈 (%d+)$", type = 4},
	validateDisambiguation.DisambiguationPattern{pattern = "^([%D]+)의 텔레비전 프로그램, 시즌 (%d+)$", type = 5},			-- "VALIDATION_TYPE_COUNTRY_SEASON_NUMBER"
	validateDisambiguation.DisambiguationPattern{pattern = "^([%D]+)의 텔레비전 프로그램, 시리즈 (%d+)$", type = 5},
	validateDisambiguation.DisambiguationPattern{pattern = "^([%D]+) 시즌 (%d+)$", type = 5},					-- "VALIDATION_TYPE_COUNTRY_SEASON_NUMBER"
	validateDisambiguation.DisambiguationPattern{pattern = "^([%D]+) 시리즈 (%d+)$", type = 5},
	validateDisambiguation.DisambiguationPattern{pattern = "^([%D]+) 시즌$", type = 7},							-- "VALIDATION_TYPE_COUNTRY_SEASON"
	validateDisambiguation.DisambiguationPattern{pattern = "^시즌 (%d+)$", type = 6},							-- "VALIDATION_TYPE_SEASON_NUMBER"
	validateDisambiguation.DisambiguationPattern{pattern = "^시리즈 (%d+)$", type = 6}
}

local otherInfoboxList = {
	["^[^,]*텔레비전 프로그램$"] = "[[분류:잘못된 정보상자가 사용된 텔레비전 문서|ㅌ]]"
}

local invalidTitleStyleList = {
	"목록"
}

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

	for i = 1, #list do
		otherInfoboxList[list[i]] = "[[분류:잘못된 정보상자가 사용된 텔레비전 문서|ㅌ]]"
	end
	
	return otherInfoboxList
end

local function _main(args)
	local title = args[1]
	local otherInfoboxListMerged = getOtherInfoboxListMerged()
	return validateDisambiguation.main(title, "텔레비전 시즌 정보", 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