Soft launch: Soldier biographies and research notes vary in completeness. Prefer class-roster, NARA, newspapers, and other cited sources for contested facts — treat Research notes as leads, not settled history. Anyone can correct a page; contact us with questions.

Module:ClassDates

From Ritchie Boys Wiki
Jump to navigation Jump to search

Documentation for this module may be created at Module:ClassDates/doc

local p = {}

-- Eight-week MITC class dates and graduation counts from Beverley Driver Eddy
-- (Ritchie Boy Secrets), via theritchieboys.com / By The Numbers spreadsheet.
local DATA = {
	['1'] = { dates = '27 July – 19 September 1942', graduated = '32 of 36' },
	['2'] = { dates = '24 August – 17 October 1942', graduated = '125 of 256' },
	['3'] = { dates = '2 November – 23 December 1942', graduated = '300 of 341' },
	['4'] = { dates = '6 January – 6 March 1943', graduated = '359 of 454' },
	['5'] = { dates = '8 February – 9 April 1943', graduated = '471 of 555' },
	['6'] = { dates = '13 March – 11 May 1943', graduated = '426 of 559' },
	['7'] = { dates = '15 April – 12 June 1943', graduated = '537 of 609' },
	['8'] = { dates = '17 May – 16 July 1943', graduated = '402 of 556' },
	['9'] = { dates = '21 June – 18 August 1943', graduated = '413 of 602' },
	['10'] = { dates = '23 July – 20 September 1943', graduated = '537 of 645' },
	['11'] = { dates = '25 August – 23 October 1943', graduated = '427 of 511' },
	['12'] = { dates = '27 September – 25 November 1943', graduated = '394 of 461' },
	['13'] = { dates = '30 October – 23 December 1943', graduated = '460 of 516' },
	['14'] = { dates = '2 December 1943 – 31 January 1944', graduated = '427 of 503' },
	['15'] = { dates = '4 January – 3 March 1944', graduated = '359 of 552' },
	['16'] = { dates = '6 February – 5 April 1944', graduated = '513 of 613' },
	['17'] = { dates = '11 March – 8 May 1944', graduated = '511 of 696' },
	['18'] = { dates = '13 April – 10 June 1944', graduated = '622 of 708' },
	['19'] = { dates = '16 May – 13 July 1944', graduated = '489 of 583' },
	['20'] = { dates = '19 June – 16 August 1944', graduated = '355 of 551' },
	['21'] = { dates = '21 July – 18 September 1944', graduated = '309 of 416' },
	['22'] = { dates = '23 August – 21 October 1944', graduated = '344 of 465' },
	['23'] = { dates = '25 September – 23 November 1944', graduated = '360 of 576' },
	['24'] = { dates = '26 October – 29 December 1944', graduated = '514 of 653' },
	['25'] = { dates = '30 November 1944 – 29 January 1945', graduated = '579 of 779' },
	['26'] = { dates = '3 January – 3 March 1945', graduated = '418 of 580' },
	['27'] = { dates = '5 February – 5 April 1945', graduated = '237 of 329' },
	['28'] = { dates = '11 March – 10 May 1945', graduated = '257 of 344' },
	['29'] = { dates = '13 April – 12 June 1945', graduated = '265 of 548' },
	['30'] = { dates = '18 May – 17 July 1945', graduated = '121 of 148' },
	['31'] = { dates = '26 July – 22 September 1945', graduated = '74 of 108' },
}

local SPECIALTIES = {
	['1'] = { {'IPW German', '32'} },
	['2'] = { {'IPW German', '32'}, {'IPW Italian', '4'}, {'IPW other language', '56'}, {'Photo interpretation', '33'} },
	['3'] = { {'IPW German', '53'}, {'IPW Italian', '11'}, {'IPW other language', '100'}, {'Photo interpretation', '36'}, {'Counterintelligence', '100'} },
	['4'] = { {'IPW German', '123'}, {'IPW Italian', '22'}, {'IPW other language', '125'}, {'Photo interpretation', '57'}, {'Counterintelligence', '52'} },
	['5'] = { {'IPW German', '86'}, {'IPW Italian', '37'}, {'IPW other language', '194'}, {'Photo interpretation', '52'}, {'Counterintelligence', '80'}, {'Terrain intelligence', '22'} },
	['6'] = { {'IPW German', '80'}, {'IPW Italian', '25'}, {'IPW other language', '142'}, {'Photo interpretation', '95'}, {'Counterintelligence', '59'}, {'Terrain intelligence', '25'} },
	['7'] = { {'IPW German', '109'}, {'IPW Italian', '43'}, {'IPW other language', '155'}, {'Photo interpretation', '47'}, {'Counterintelligence', '165'}, {'Terrain intelligence', '18'} },
	['8'] = { {'IPW German', '130'}, {'IPW Italian', '23'}, {'IPW other language', '82'}, {'Photo interpretation', '74'}, {'Counterintelligence', '93'} },
	['9'] = { {'IPW German', '133'}, {'IPW other language', '73'}, {'Photo interpretation', '60'}, {'Counterintelligence', '36'}, {'Terrain intelligence', '79'}, {'Signal intelligence', '32'} },
	['10'] = { {'IPW German', '177'}, {'IPW Italian', '87'}, {'IPW other language', '98'}, {'Photo interpretation', '82'}, {'Counterintelligence', '37'}, {'Terrain intelligence', '28'}, {'Signal intelligence', '28'} },
	['11'] = { {'IPW German', '184'}, {'IPW Italian', '74'}, {'Photo interpretation', '136'}, {'Terrain intelligence', '33'} },
	['12'] = { {'IPW German', '119'}, {'IPW other language', '128'}, {'Photo interpretation', '147'} },
	['13'] = { {'IPW German', '189'}, {'IPW other language', '69'}, {'Photo interpretation', '166'}, {'Terrain intelligence', '36'} },
	['14'] = { {'IPW German', '130'}, {'IPW other language', '61'}, {'Photo interpretation', '165'}, {'Terrain intelligence', '71'} },
	['15'] = { {'IPW German', '61'}, {'IPW other language', '95'}, {'Photo interpretation', '168'}, {'Terrain intelligence', '35'} },
	['16'] = { {'IPW German', '163'}, {'IPW other language', '120'}, {'Photo interpretation', '193'}, {'Terrain intelligence', '37'} },
	['17'] = { {'IPW German', '127'}, {'IPW other language', '116'}, {'Photo interpretation', '231'}, {'Terrain intelligence', '37'} },
	['18'] = { {'IPW German', '147'}, {'IPW other language', '147'}, {'Photo interpretation', '328'} },
	['19'] = { {'IPW German', '140'}, {'IPW other language', '107'}, {'Photo interpretation', '242'} },
	['20'] = { {'IPW German', '107'}, {'IPW other language', '40'}, {'Photo interpretation', '164'}, {'Counterintelligence', '19'}, {'Terrain intelligence', '25'} },
	['21'] = { {'IPW German', '96'}, {'IPW other language', '51'}, {'Photo interpretation', '134'}, {'Terrain intelligence', '28'} },
	['22'] = { {'IPW German', '118'}, {'IPW other language', '62'}, {'Photo interpretation', '122'}, {'Counterintelligence', '18'}, {'Terrain intelligence', '24'} },
	['23'] = { {'IPW German', '70'}, {'IPW other language', '45'}, {'Photo interpretation', '85'}, {'Counterintelligence', '128'}, {'Russian interpreter', '32'} },
	['24'] = { {'IPW German', '35'}, {'Photo interpretation', '91'}, {'Counterintelligence', '261'}, {'Terrain intelligence', '15'}, {'Russian interpreter', '112'} },
	['25'] = { {'IPW German', '76'}, {'Photo interpretation', '71'}, {'Counterintelligence', '356'}, {'Terrain intelligence', '13'}, {'Russian interpreter', '63'} },
	['26'] = { {'IPW German', '58'}, {'Photo interpretation', '45'}, {'Counterintelligence', '272'}, {'Terrain intelligence', '12'}, {'German translation', '23'}, {'Russian interpreter', '8'} },
	['27'] = { {'IPW German', '47'}, {'Photo interpretation', '31'}, {'Counterintelligence', '99'}, {'Terrain intelligence', '16'}, {'German translation', '33'}, {'Russian interpreter', '11'} },
	['28'] = { {'IPW German', '46'}, {'Photo interpretation', '3'}, {'Counterintelligence', '78'}, {'Terrain intelligence', '25'}, {'German translation', '19'}, {'Russian interpreter', '11'}, {'Chinese interpreter', '58'}, {'General intelligence', '17 (Ge)'} },
	['29'] = { {'IPW German', '4'}, {'Photo interpretation', '44'}, {'Counterintelligence', '96'}, {'Terrain intelligence', '56'}, {'Russian interpreter', '9'}, {'Chinese interpreter', '39'}, {'General intelligence', '17 (Ru)'} },
	['30'] = { {'Photo interpretation', '22'}, {'Counterintelligence', '62'}, {'Terrain intelligence', '20'}, {'Chinese interpreter', '13'}, {'Japanese interpreter', '4'} },
	['31'] = { {'Photo interpretation', '4'}, {'Terrain intelligence', '64'}, {'Chinese interpreter', '6'} },
}

local function trim(s)
	return (mw.ustring.gsub(s or '', '^%s*(.-)%s*$', '%1'))
end

function p.lookup(num)
	return DATA[trim(tostring(num or ''))]
end

function p.dates(frame)
	local info = p.lookup(frame.args[1] or frame.args.class or '')
	if not info then
		return ''
	end
	return info.dates
end

function p.graduated(frame)
	local info = p.lookup(frame.args[1] or frame.args.class or '')
	if not info then
		return ''
	end
	return info.graduated
end

-- Wikitext blurb for Template:Class
function p.summary(frame)
	local num = trim(frame.args[1] or '')
	local info = p.lookup(num)
	if not info then
		return ''
	end
	local bits = {
		string.format(
			"'''Dates:''' %s<br />'''Graduated:''' %s (eight-week MITC class).",
			info.dates,
			info.graduated
		),
	}
	local specs = SPECIALTIES[num]
	if specs and #specs > 0 then
		local items = {}
		for _, pair in ipairs(specs) do
			table.insert(items, string.format('%s&nbsp;%s', pair[1], pair[2]))
		end
		table.insert(
			bits,
			"'''Specialties (class counts):''' " .. table.concat(items, '; ')
				.. ". See [[By The Numbers/Eight Week Courses by Specialties|By The Numbers]]."
		)
	else
		table.insert(
			bits,
			"See [[By The Numbers/Eight Week Classes - Dates & Graduation Numbers|By The Numbers]] for all classes."
		)
	end
	return table.concat(bits, '<br />')
end


return p