Interview cue: accept legacy items key as interviews alias
Infobox: drop certificate/arrive/depart/years; expand other_class codes
 
(2 intermediate revisions by the same user not shown)
Line 709: Line 709:
end
end
return prettyProse(s)
return prettyProse(s)
end
-- Roster "other_class" codes → readable course names (By The Numbers / MITC charts).
local function expandOtherClassToken(tok)
tok = tidyDisplay(tok)
if tok == '' then
return ''
end
local u = mw.ustring.upper(tok)
u = mw.ustring.gsub(u, '%s+', ' ')
u = trim(u)
local n = mw.ustring.match(u, '^SC%s*B%s*(%d+)$')
if n then
return 'Special Course B ' .. n
end
n = mw.ustring.match(u, '^SC%s*(%d+)$')
if n then
-- SC# aligns with AGF Photo Interpretation / “Special Course” numbering
-- (e.g. SC8 = Special Course 8 in PI).
return 'Special Course ' .. n
end
n = mw.ustring.match(u, '^DC%s*(%d+)$')
if n then
return 'Division Class ' .. n
end
n = mw.ustring.match(u, '^MITU%s*(%d+)$')
if n then
return 'Mobile Intelligence Training Unit ' .. n
end
n = mw.ustring.match(u, '^RDC%s*(%d+)$')
if n then
return 'Redeployment Class ' .. n
end
n = mw.ustring.match(u, '^RCM%s*(%d+)$')
if n then
return 'Radio Countermeasures Class ' .. n
end
n = mw.ustring.match(u, '^OB%s*(%d+)$')
if n then
return 'Order of Battle Class ' .. n
end
if u == 'SIG' or u == 'SIG-SIG' or mw.ustring.match(u, '^SIG[%s%-]') then
return 'Special Intelligence Group–Signal'
end
local unitNum, unitKind = mw.ustring.match(u, '^(%d+)(?:ST|ND|RD|TH)%s+(.+)$')
if unitNum and unitKind then
local kind = trim(unitKind)
if kind == 'INF' then
kind = 'Infantry'
elseif kind == 'ARMD' then
kind = 'Armored'
else
kind = prettyProse(kind)
end
local ord = unitNum
local last = mw.ustring.sub(unitNum, -1)
local last2 = mw.ustring.len(unitNum) >= 2 and mw.ustring.sub(unitNum, -2) or ''
if last2 ~= '11' and last2 ~= '12' and last2 ~= '13' then
if last == '1' then
ord = unitNum .. 'st'
elseif last == '2' then
ord = unitNum .. 'nd'
elseif last == '3' then
ord = unitNum .. 'rd'
else
ord = unitNum .. 'th'
end
else
ord = unitNum .. 'th'
end
return ord .. ' ' .. kind
end
return prettyProse(tok)
end
local function expandOtherClass(raw)
raw = tidyDisplay(raw)
if raw == '' then
return ''
end
local parts = {}
for piece in mw.ustring.gmatch(raw, '[^;,]+') do
local expanded = expandOtherClassToken(piece)
if expanded ~= '' then
table.insert(parts, expanded)
end
end
return table.concat(parts, '; ')
end
end


Line 1,861: Line 1,952:
local nativity = expandNativity(parentArg(frame, 'nativity'))
local nativity = expandNativity(parentArg(frame, 'nativity'))
local religion = expandReligion(parentArg(frame, 'religion'))
local religion = expandReligion(parentArg(frame, 'religion'))
local marital = prettyProse(parentArg(frame, 'marital'))
-- education / marital / occupation stay in Technical record (NARA snapshot);
local education = prettyProse(parentArg(frame, 'education'))
-- curated life facts belong in Biography / Timeline, not the infobox.
local occupation = prettyProse(parentArg(frame, 'occupation'))
local knownFor = prettyProse(parentArg(frame, 'known_for'))
local knownFor = prettyProse(parentArg(frame, 'known_for'))
local awards = prettyProse(parentArg(frame, 'awards'))
local awards = prettyProse(parentArg(frame, 'awards'))
Line 1,872: Line 1,962:
awards = trim(first or awards)
awards = trim(first or awards)
end
end
local state = prettyPlace(parentArg(frame, 'state'))


local function datePlaceCell(date, place, year)
local function datePlaceCell(date, place, year)
Line 1,891: Line 1,980:


if alias ~= '' or birth ~= '' or death ~= '' or nativity ~= ''
if alias ~= '' or birth ~= '' or death ~= '' or nativity ~= ''
or religion ~= '' or marital ~= '' or education ~= ''
or religion ~= '' or knownFor ~= '' or awards ~= '' then
or occupation ~= '' or knownFor ~= '' or awards ~= '' or state ~= '' then
addHeader(tbl, 'Personal details')
addHeader(tbl, 'Personal details')
end
end
Line 1,901: Line 1,989:
addRow(tbl, 'Nativity', nativity)
addRow(tbl, 'Nativity', nativity)
addRow(tbl, 'Religion', religion)
addRow(tbl, 'Religion', religion)
addRow(tbl, 'Spouse / marital', marital)
addRow(tbl, 'Education', education)
addRow(tbl, 'Occupation', occupation)
addRow(tbl, 'Known for', knownFor)
addRow(tbl, 'Known for', knownFor)
addRow(tbl, 'Awards', awards)
addRow(tbl, 'Awards', awards)
if state ~= '' then
addRow(tbl, 'State', state)
end


addHeader(tbl, 'Military service')
addHeader(tbl, 'Military service')
Line 1,925: Line 2,007:
addRow(tbl, 'Arm / service', prettyProse(armName))
addRow(tbl, 'Arm / service', prettyProse(armName))
end
end
addRow(tbl, 'Years of service', prettyProse(parentArg(frame, 'years_of_service')))
-- years_of_service / date_arrive / date_depart / certificate stay in Technical
-- record only (rarely curated; certificate is a cryptic chart number).
addRow(tbl, 'ASN', parentArg(frame, 'asn'), 'serial')
addRow(tbl, 'ASN', parentArg(frame, 'asn'), 'serial')


Line 1,947: Line 2,030:
end
end
addRow(tbl, 'Section', mw.ustring.upper(parentArg(frame, 'class_section')))
addRow(tbl, 'Section', mw.ustring.upper(parentArg(frame, 'class_section')))
addRow(tbl, 'Other class', parentArg(frame, 'other_class'))
addRow(tbl, 'Other class', expandOtherClass(parentArg(frame, 'other_class')))


local enlist = prettyPlace(parentArg(frame, 'enlistment_place'))
local enlist = prettyPlace(parentArg(frame, 'enlistment_place'))
Line 1,957: Line 2,040:
addRow(tbl, 'Battles / wars', formatBattles(parentArg(frame, 'battles')))
addRow(tbl, 'Battles / wars', formatBattles(parentArg(frame, 'battles')))
addTeamsInfoboxRow(tbl, frame)
addTeamsInfoboxRow(tbl, frame)
addRow(tbl, 'Arrived', parentArg(frame, 'date_arrive'))
addRow(tbl, 'Departed', parentArg(frame, 'date_depart'))
addRow(tbl, 'Certificate', realCertificate(parentArg(frame, 'certificate')))


-- Awards ribbons render in the article body (p.awardsSection), not this
-- Awards ribbons render in the article body (p.awardsSection), not this