ഘടകം:Team appearances list

ഈ ഘടകത്തിന്റെ വിവരണം ഘടകം:Team appearances list/വിവരണം എന്ന താളിൽ നിർമ്മിക്കാവുന്നതാണ്

-- This module implements [[Template:Team appearances list]].local p = {}local data_competitionslocal data_old_nameslocal function load_data(frame)-- Load data module (or its sandbox) and set variables from its exported data.if not data_competitions thenframe = frame or mw.getCurrentFrame()local sandbox = frame:getTitle():find('sandbox', 1, true) and '/sandbox' or ''local datamod = mw.loadData('Module:Team appearances list/data' .. sandbox)data_competitions = datamod.competitionsdata_old_names = datamod.old_namesendendlocal function strip_to_nil(text)-- If text is a string, return its trimmed content, or nil if empty.-- Otherwise return text (which may, for example, be nil).if type(text) == 'string' thentext = text:match('(%S.-)%s*$')endreturn textendlocal function make_options(args)-- Return table of options from validated args or throw error.local options = {}local function valid_integer(name, min, max, is_optional)local arg = args[name]if arg == nil or arg == '' thenif is_optional thenreturn nilenderror('Parameter ' .. name .. ' is missing')endarg = tonumber(arg)if type(arg) ~= 'number' thenerror('Parameter ' .. name .. ' is not a number')endif math.floor(arg) ~= arg thenerror('Parameter ' .. name .. ' is not an integer')endif not (min <= arg and arg <= max) thenerror('Parameter ' .. name .. ' is not valid')endreturn argendlocal function valid_text(name)local arg = args[name]if arg == nil or arg == '' thenerror('Parameter ' .. name .. ' is missing')endif type(arg) ~= 'string' thenerror('Parameter ' .. name .. ' is not a string')endreturn argendoptions.competition = valid_text('competition')options.team = valid_text('team')-- Check ROC/TPEif options.team=='Republic of China' thenlocal pageYear = tonumber(mw.ustring.match(mw.title.getCurrentTitle().text, '[%d]+')) -- mw.title.getCurrentTitle().text:match('^%d+')if pageYear and pageYear > 1950 and pageYear < 1980 thenoptions.team = 'Chinese Taipei'endend-- end of ROC/TPE checkoptions.competitions = data_competitions[options.competition] or data_competitions[data_old_names[options.competition]]local begin_optionalif options.competitions thenbegin_optional = trueelseoptions.interval = valid_integer('interval', 1, 30)endoptions.begin_year = valid_integer('begin_year', 1800, 2100, begin_optional)options.end_year = valid_integer('end_year', 1800, 2100, true)if options.begin_year and options.end_year thenif options.begin_year > options.end_year thenerror('Parameter end_year must not be before begin_year')endendoptions.disqualified_year = valid_integer('disqualified_year', 1800, 2100, true)return optionsendlocal function extract_range(text)-- Return first (if text is a single year), or first, last if a range.-- The returned values are numbers.-- Return nothing if text is invalid.local year = text:match('^(%d+)$')if year thenif #year == 4 thenreturn tonumber(year)endreturnendlocal first, dash, last = text:match('^(%d+)(%D+)(%d+)$')if not (first and #first == 4) thenreturnenddash = strip_to_nil(dash)if not (dash == '-' or dash == '–') thenreturnendif #last ~= 4 thenif #last == 2 thenlast = first:sub(1, 2) .. lastelsereturnendendfirst = tonumber(first)last = tonumber(last)if first < last thenreturn first, lastelseif first == last thenreturn firstendendlocal function competition_absences(data)-- Return two tables with absent years and absent year ranges.-- Parameter data is an array of strings from template parameters, or-- numbers or strings from built-in data.-- Parameters that are blank or not numbers or strings are ignored.local absent_years, absent_ranges = {}, {}for _, item in ipairs(data) doif type(item) == 'number' thenabsent_years[item] = trueelseitem = strip_to_nil(item)if type(item) == 'string' thenlocal first, last = extract_range(item)if not first thenerror('Year ' .. item .. ' is not valid')endif last thentable.insert(absent_ranges, {first, last})elseabsent_years[first] = trueendendendendreturn absent_years, absent_rangesendlocal function competition_information(args)-- Return four tables with competition and team information:-- * List of competition years that the team attended or could have attended.-- * Table of disqualified years (the team was absent, but there is an--   article regarding the absent year).-- * Table of absent years (when the team did not attend).-- * List of pairs of years (absent for each year in range, inclusive).local options = make_options(args)local absenceslocal comp_years = {}local begin_year = options.begin_yearlocal end_year = options.end_yearlocal competitions = options.competitionsif competitions thenabsences = competitions[options.team] or competitions[data_old_names[options.team]]begin_year = begin_year or (absences and absences.begin_year) or 0end_year = end_year or (absences and absences.end_year) or 9999for _, y in ipairs(competitions) doif y > end_year thenbreakelseif y >= begin_year thentable.insert(comp_years, y)endendelseend_year = end_year or (os.date('!*t').year + options.interval)for y = begin_year, end_year, options.interval dotable.insert(comp_years, y)endendlocal disqualified_years = {}if options.disqualified_year then-- Input currently only allows entry of a single disqualified year.-- However processing works for any number of such years.disqualified_years[options.disqualified_year] = trueendreturn comp_years, disqualified_years, competition_absences(absences or args)endlocal function gameName(year, inputName)-- Modifies output of display being sent back to the list--  for games that have had a name change but are still considered--  the same competition.if inputName=="World Athletics Championships" or inputName=="World Championships in Athletics" thenif year <= 2017 thenreturn "World Championships in Athletics"elsereturn "World Athletics Championships"endelseif (inputName=="British Empire Games"or inputName=="British Empire and Commonwealth Games"or inputName=="British Commonwealth Games"or inputName=="Commonwealth Games") thenif year <= 1950 thenreturn "British Empire Games"elseif year <= 1966 thenreturn "British Empire and Commonwealth Games"elseif year <= 1974 thenreturn "British Commonwealth Games"elsereturn "Commonwealth Games"endelseif inputName=="Southeast Asian Peninsular Games"or inputName=="Southeast Asian Games"or inputName=="SEAP Games"or inputName=="SEA Games" thenif year <= 1975 thenreturn "SEAP Games"elsereturn "SEA Games"endelseif inputName=="Asian Indoor Games" or inputName=="Asian Indoor and Martial Arts Games" thenif year <= 2009 thenreturn "Asian Indoor Games"elsereturn "Asian Indoor and Martial Arts Games"endelseif inputName=="Southern Cross Games" or inputName=="South American Games" thenif year <= 1982 thenreturn "Southern Cross Games"elsereturn "South American Games"endelseif inputName=="All-Africa Games" or inputName=="African Games" thenif year <= 2011 thenreturn "All-Africa Games"elsereturn "African Games"endelsereturn inputNameendendlocal function teamName(year, inputName, comp)-- Modifies output of display being sent back to the list--  for games that have had a name change but are still considered--  the same competition.if inputName=="Eswatini" or inputName=="Swaziland" thenif year < 2018 or year == 2018 and comp == 'Commonwealth Games' thenreturn "Swaziland"elsereturn "Eswatini"endelseif inputName=="Southern Rhodesia" or inputName=="Rhodesia" or inputName=="Zimbabwe" thenif year < 1980 thenif (comp=="British Empire Games"or comp=="British Empire and Commonwealth Games"or comp=="British Commonwealth Games"or comp=="Commonwealth Games") thenreturn "Southern Rhodesia"elseif comp=="Summer Olympics" or comp=="Summer Paralympics" thenreturn "Rhodesia"endelsereturn "Zimbabwe"endelseif (inputName=="Republic of China"or inputName=="Formosa"or inputName=="Taiwan"or inputName=="Chinese Taipei") thenif year <= 1956 or year == 1972 or year == 1976 thenreturn "Republic of China"elseif year==1960 thenreturn "Republic of China (Formosa)"elseif year==1964 or year==1968 thenreturn "Taiwan"elseif year > 1976 thenreturn "Chinese Taipei"endelseif inputName=="Northern Rhodesia" or inputName=="Zambia" thenif year <= 1964 thenreturn "Northern Rhodesia"elsereturn "Zambia"endelseif inputName=="Aden" or inputName=="South Arabia" or inputName=="Federation of South Arabia" thenif year < 1966 thenreturn "Aden"elsereturn "South Arabia"endelseif inputName=="British Guiana" or inputName=="Guyana" thenif year < 1966 thenreturn "British Guiana"elsereturn "Guyana"endelseif inputName=="Tanzania" or inputName=="Tanganyika" thenif year < 1966 thenreturn "Tanganyika"elsereturn "Tanzania"endelseif inputName=="Ceylon" or inputName=="Sri Lanka" thenif year <= 1972 thenreturn "Ceylon"elsereturn "Sri Lanka"endelseif inputName=="British Honduras" or inputName=="Belize" thenif year <= 1973 thenreturn "British Honduras"elsereturn "Belize"endelseif inputName=="Dahomey" or inputName=="Benin" thenif year <= 1975 thenreturn "Dahomey"elsereturn "Benin"endelseif inputName=="Upper Volta" or inputName=="Burkina Faso" thenif year <= 1983 thenreturn "Upper Volta"elsereturn "Burkina Faso"endelseif inputName=="Burma" or inputName=="Myanmar" thenif year < 1990 thenreturn "Burma"elsereturn "Myanmar"endelseif inputName=="Germany" or inputName=="West Germany" thenif comp == "Summer Paralympics" or comp == "Winter Paralympics" thenif year < 1992 thenreturn "West Germany"elsereturn "Germany"endendelseif inputName=="Democratic Republic of the Congo" or inputName=="Zaire" or inputName=="Congo-Kinshasa" thenif year < 1971 thenreturn "Congo-Kinshasa"elseif year >= 1971 and year <=1996 thenreturn "Zaire"elsereturn "Democratic Republic of the Congo"endelseif (inputName=="Individual Olympic Athletes" or inputName=="Independent Olympic Athletes" or inputName=="Independent Olympic Participants"or inputName=="Olympic Athletes from Russia"or inputName=="ROC") thenif year == 1992 or year==2014 thenreturn "Independent Olympic Participants"elseif year == 2000 thenreturn "Individual Olympic Athletes"elseif year == 2012 or year==2016 thenreturn "Independent Olympic Athletes"elseif year == 2018 thenreturn "Olympic Athletes from Russia"elseif year == 2020 thenreturn "Russian Olympic Committee athletes"elsereturn inputNameendelseif inputName=="Serbia and Montenegro" or inputName=="FR Yugoslavia" thenif year < 2004 thenif comp == "Mediterranean Games" thenreturn "FR Yugoslavia"elsereturn "Yugoslavia"endelsereturn "Serbia and Montenegro"endelseif (inputName=="Refugee Olympic Team" or inputName=="IOC Refugee Olympic Team") thenif year == 2016 thenreturn "Refugee Olympic Team"elseif year == 2020 thenreturn "IOC Refugee Olympic Team"elsereturn inputNameendelseif (inputName=="Independent Paralympic Participants" or inputName=="Individual Paralympic Athletes" or inputName=="Independent Paralympic Athletes"or inputName=="RPC"or inputName=="Neutral Paralympic Athletes") thenif year == 1992 thenreturn "Independent Paralympic Participants"elseif year == 2000 thenreturn "Individual Paralympic Athletes"elseif year==2016 thenreturn "Independent Paralympic Athletes"elseif year==2018 thenreturn "Neutral Paralympic Athletes"elseif year == 2020 or year==2022 thenreturn "Russian Paralympic Committee athletes"elsereturn inputNameendelseif inputName=="North Macedonia" or inputName=="Macedonia" thenif year < 2019 thenreturn "Macedonia"elsereturn "North Macedonia"endelseif inputName=="Malaysia" or inputName=="Malaya" thenif year < 1963 thenreturn "Malaya"elsereturn "Malaysia"endelseif inputName=="Ghana" or inputName=="Gold Coast" thenif year < 1957 thenreturn "Gold Coast"elsereturn "Ghana"endelseif inputName=="Independent FINA Athletes"or inputName=="FINA Refugee Team"or inputName=="FINA athletes" thenif year==2017 or year==2019 thenreturn "Independent FINA Athletes"elseif year==2022 thenreturn "FINA Refugee Team"elsereturn "FINA athletes"endendreturn inputNameendfunction p._main(args)load_data()  -- in case this function is called by another modulelocal list = require('Module:List').horizontallocal competitions, disqualified_years, absent_years, absent_ranges = competition_information(args)local current_year = os.date('!*t').yearlocal function is_absent(y)if absent_years[y] thenreturn trueendfor _, range in ipairs(absent_ranges) doif range[1] <= y and y <= range[2] thenreturn trueendendreturn falseendlocal appearances = {}local absent_first, absent_lastfor i = 1, #competitions + 1 do  -- +1 to handle any trailing absenceslocal y = competitions[i]if y and is_absent(y) thenif absent_first thenabsent_last = yelseabsent_first = yendelseif absent_first thentable.insert(appearances,'<span style="color:gray">' ..(absent_last and (absent_first .. '–' .. absent_last) or absent_first) ..'</span>')absent_first, absent_last = nil, nilendif y thenlocal display = tostring(y)if y > current_year thendisplay = '<i>' .. display .. '</i>'endif disqualified_years[y] thendisplay = '<del>' .. display .. '</del>'endlocal compName = gameName(y, args.competition)local teamOut = teamName(y, args.team, args.competition)if compName == 'FIS Alpine World Ski Championships' thentable.insert(appearances, string.format('[[%s at the %s %d|%s]]',teamOut, compName, y, display))elsetable.insert(appearances, string.format('[[%s at the %d %s|%s]]',teamOut, y, compName, display))endendendendreturn list(appearances)endfunction p.main(frame)load_data(frame)return p._main(frame.args['team'] and frame.args or frame:getParent().args)endreturn p
"https:https://www.how.com.vn/wiki/index.php?lang=ml&q=ഘടകം:Team_appearances_list&oldid=3937896" എന്ന താളിൽനിന്ന് ശേഖരിച്ചത്
🔥 Top keywords: കേന്ദ്ര മന്ത്രിസഭകുമാരനാശാൻതുഞ്ചത്തെഴുത്തച്ഛൻപ്രധാന താൾമലയാളം അക്ഷരമാലപ്രത്യേകം:അന്വേഷണംസുരേഷ് ഗോപിലോക പരിസ്ഥിതി ദിനംവള്ളത്തോൾ നാരായണമേനോൻഉള്ളൂർ എസ്. പരമേശ്വരയ്യർചെറുശ്ശേരിനിർമ്മല സീതാരാമൻസ്റ്റുഡന്റ് പോലീസ് കേഡറ്റ് പദ്ധതിബാബർപ്രാചീനകവിത്രയംആധുനിക കവിത്രയംദ്രൗപദി മുർമുഇന്ത്യയിലെ സംസ്ഥാനങ്ങളും കേന്ദ്രഭരണപ്രദേശങ്ങളുംമലയാളംകൊട്ടിയൂർ ശിവക്ഷേത്രങ്ങൾഇന്ത്യയുടെ രാഷ്‌ട്രപതിനരേന്ദ്ര മോദിഅക്‌ബർമുഗൾ സാമ്രാജ്യംകുഞ്ചൻ നമ്പ്യാർചെങ്കോട്ടചണ്ഡാലഭിക്ഷുകിസുഗതകുമാരിഇന്ത്യയുടെ പ്രധാനമന്ത്രിമാരുടെ പട്ടികറാം മോഹൻ നായിഡു കിഞ്ചരപുതകഴി ശിവശങ്കരപ്പിള്ളരാജ്യസഭകടത്തനാട്ട് മാധവിയമ്മഹുമായൂൺഈദുൽ അദ്‌ഹജി. കുമാരപിള്ളഔറംഗസേബ്കേരളംരാമപുരത്തുവാര്യർ