feat(media): JSON v3.0 avec 171 auteurs Bonpote + flag ingere (Phase 8.A)
Sync corpus auteurs-pensees pour transposition 1:1 carte Bonpote V2. 171 auteurs (vs 28 v2.1), 32 ingeres + 139 non-ingeres avec bio provisoire. Flag ingere:true/false sur chaque auteur pour grisage Phase 8.D. Preservation 100% des entrees enrichies v2.1 (theses_cles, bio_courte, slugs compat D3 Phase 7). scripts/build_authors_v3.mjs : helper Node.js reproductible pour re-runs apres nouvelles ingestions LightRAG. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
File diff suppressed because it is too large
Load Diff
376
scripts/build_authors_v3.mjs
Normal file
376
scripts/build_authors_v3.mjs
Normal file
@@ -0,0 +1,376 @@
|
||||
// Build auteurs-pensees.json v3.0 — Phase 8.A
|
||||
// Sync corpus JSON unifié : Bonpote authors + LightRAG ingestion flags
|
||||
|
||||
import fs from 'node:fs';
|
||||
import path from 'node:path';
|
||||
|
||||
const JSON_PATH = 'C:\\Users\\jules\\Dropbox\\ATIS - IPCJRA\\1 PROJETS\\TECH - infra VPS, website pro, RAG\\nav-carte\\public\\data\\auteurs-pensees.json';
|
||||
|
||||
// === LightRAG slug prefixes (from /documents endpoint 2026-05-12) ===
|
||||
const LIGHTRAG_PREFIX_TO_AUTHOR_SLUG = {
|
||||
bookchin: 'murray-bookchin',
|
||||
brand: 'steward-brand',
|
||||
carson: 'rachel-carson',
|
||||
charbonneau: 'bernard-charbonneau',
|
||||
descola: 'philippe-descola',
|
||||
despret: 'vinciane-despret',
|
||||
eaubonne: 'francoise-deaubonne',
|
||||
ellul: 'jacques-ellul',
|
||||
federici: 'silvia-federici',
|
||||
ferdinand: 'malcolm-ferdinand',
|
||||
figueres: 'christiana-figueres',
|
||||
georgescu: 'nicholas-georgescu-roegen',
|
||||
gorz: 'andre-gorz',
|
||||
graeber: 'david-graeber',
|
||||
keith: 'david-keith',
|
||||
klein: 'naomi-klein',
|
||||
kropotkine: 'pierre-kropotkine',
|
||||
latouche: 'serge-latouche',
|
||||
latour: 'bruno-latour',
|
||||
lowy: 'michael-lowy',
|
||||
malm: 'andreas-malm',
|
||||
marx: 'karl-marx',
|
||||
meadows: 'donella-meadows',
|
||||
morizot: 'baptiste-morizot',
|
||||
naess: 'arne-naess',
|
||||
ouassak: 'fatima-ouassak',
|
||||
reclus: 'elisee-reclus',
|
||||
saito: 'kohei-saito',
|
||||
servigne: 'pablo-servigne',
|
||||
shiva: 'vandana-shiva',
|
||||
stengers: 'isabelle-stengers',
|
||||
vettese: 'troy-vettese',
|
||||
};
|
||||
|
||||
const INGESTED_AUTHOR_SLUGS = new Set(Object.values(LIGHTRAG_PREFIX_TO_AUTHOR_SLUG));
|
||||
|
||||
// === Bonpote authors (nom, dates, ecole_principale, ecoles_secondaires[]) ===
|
||||
const BONPOTE_AUTHORS = [
|
||||
// Éco-anarchisme
|
||||
['Pierre Kropotkine', '1842-1921', 'eco-anarchisme', []],
|
||||
['Élisée Reclus', '1830-1905', 'eco-anarchisme', []],
|
||||
['Murray Bookchin', '1921-2006', 'eco-anarchisme', []],
|
||||
['David Graeber', '1961-2020', 'eco-anarchisme', []],
|
||||
['James C. Scott', '1936-2024', 'eco-anarchisme', []],
|
||||
['Marshall Sahlins', '1930-2021', 'eco-anarchisme', []],
|
||||
['Pierre Clastres', '1934-1977', 'eco-anarchisme', []],
|
||||
['Cornélius Castoriadis', '1922-1997', 'eco-anarchisme', []],
|
||||
['David Harvey', '1935-', 'eco-anarchisme', ['ecosocialisme']],
|
||||
['Henri Lefebvre', '1901-1991', 'eco-anarchisme', ['ecosocialisme']],
|
||||
['Émile Gravelle', '1855-1920', 'eco-anarchisme', []],
|
||||
['Henri Zisly', '1872-1945', 'eco-anarchisme', []],
|
||||
['Edward Carpenter', '1844-1929', 'eco-anarchisme', []],
|
||||
['William Morris', '1834-1896', 'eco-anarchisme', []],
|
||||
['John Ruskin', '1819-1900', 'eco-anarchisme', []],
|
||||
['Kirkpatrick Sale', '1937-', 'eco-anarchisme', []],
|
||||
['Wendell Berry', '1934-', 'eco-anarchisme', []],
|
||||
['Kristin Ross', '1953-', 'eco-anarchisme', []],
|
||||
['Theodore Kaczynski', '1942-2023', 'eco-anarchisme', ['technocritique']],
|
||||
['Saint-Simon', '1760-1825', 'eco-anarchisme', []],
|
||||
['Auguste Comte', '1798-1857', 'eco-anarchisme', []],
|
||||
['Alberto Magnaghi', '1941-2023', 'eco-anarchisme', []],
|
||||
['Peter Berg', '1937-2011', 'eco-anarchisme', []],
|
||||
['Andreas Malm', '1977-', 'ecosocialisme', ['eco-anarchisme']],
|
||||
|
||||
// Écosocialisme
|
||||
['Karl Marx', '1818-1883', 'ecosocialisme', []],
|
||||
['Friedrich Engels', '1820-1895', 'ecosocialisme', []],
|
||||
['Rosa Luxemburg', '1871-1919', 'ecosocialisme', []],
|
||||
['Walter Benjamin', '1892-1940', 'ecosocialisme', []],
|
||||
['John Maynard Keynes', '1883-1946', 'ecosocialisme', []],
|
||||
['Pascal Lamy', '1947-', 'ecosocialisme', []],
|
||||
['Ann Pettifor', '1947-', 'ecosocialisme', []],
|
||||
['Holly Jean Buck', '', 'ecosocialisme', []],
|
||||
['Cédric Durand', '1975-', 'ecosocialisme', []],
|
||||
['Kim Stanley Robinson', '1952-', 'ecosocialisme', []],
|
||||
['André Gorz', '1923-2007', 'ecosocialisme', ['decroissance', 'technocritique']],
|
||||
['Kohei Saito', '1987-', 'ecosocialisme', ['decroissance']],
|
||||
['Razmig Keucheyan', '1975-', 'ecosocialisme', []],
|
||||
['Dominique Méda', '1962-', 'ecosocialisme', []],
|
||||
['Dominique Bourg', '1953-', 'ecosocialisme', []],
|
||||
['Troy Vettese', '', 'ecosocialisme', []],
|
||||
['Loïc Blondiaux', '1962-', 'ecosocialisme', []],
|
||||
['Drew Pendergrass', '', 'ecosocialisme', []],
|
||||
['Jason W. Moore', '', 'ecosocialisme', []],
|
||||
["James O'Connor", '1930-2017', 'ecosocialisme', []],
|
||||
['Herman Daly', '1938-2022', 'ecosocialisme', ['capitalisme-vert']],
|
||||
['John Bellamy Foster', '1953-', 'ecosocialisme', []],
|
||||
['Michael Löwy', '1938-', 'ecosocialisme', []],
|
||||
['Joel Kovel', '1936-2018', 'ecosocialisme', []],
|
||||
['Naomi Klein', '1970-', 'ecosocialisme', []],
|
||||
|
||||
// Technocritique
|
||||
['Jacques Ellul', '1912-1994', 'technocritique', []],
|
||||
['Bernard Charbonneau', '1910-1996', 'technocritique', []],
|
||||
['Lewis Mumford', '1895-1990', 'technocritique', []],
|
||||
['Alain Caillé', '1944-', 'technocritique', []],
|
||||
['Hans Jonas', '1903-1993', 'technocritique', ['ethiques-environnementales']],
|
||||
['Herbert Marcuse', '1898-1979', 'technocritique', []],
|
||||
['Günther Anders', '1902-1992', 'technocritique', []],
|
||||
['Pierre Fournier', '1937-1973', 'technocritique', []],
|
||||
['Alexandre Grothendieck', '1928-2014', 'technocritique', []],
|
||||
['Patrick Viveret', '1948-', 'technocritique', []],
|
||||
['Philippe Bihouix', '1971-', 'technocritique', []],
|
||||
['Jean Baudrillard', '1929-2007', 'technocritique', []],
|
||||
['Serge Latouche', '1940-', 'decroissance', ['technocritique']],
|
||||
['Ivan Illich', '1926-2002', 'technocritique', ['decroissance']],
|
||||
['Leopold Kohr', '1909-1994', 'technocritique', ['decroissance']],
|
||||
['Ernst Schumacher', '1911-1977', 'technocritique', ['decroissance']],
|
||||
['Nicholas Georgescu-Roegen', '1906-1994', 'decroissance', ['technocritique']],
|
||||
|
||||
// Écoféminismes
|
||||
["Françoise d'Eaubonne", '1920-2005', 'ecofeminismes', []],
|
||||
['Vandana Shiva', '1952-', 'ecofeminismes', ['ecologies-decoloniales']],
|
||||
['Starhawk', '1951-', 'ecofeminismes', []],
|
||||
['Ariel Salleh', '1944-', 'ecofeminismes', []],
|
||||
['Maria Mies', '1931-2023', 'ecofeminismes', []],
|
||||
['Carolyn Merchant', '1936-', 'ecofeminismes', []],
|
||||
['Silvia Federici', '1942-', 'ecofeminismes', []],
|
||||
['Val Plumwood', '1939-2008', 'ecofeminismes', []],
|
||||
['Susan Griffin', '1943-', 'ecofeminismes', []],
|
||||
['Veronika Bennholdt-Thomsen', '1944-', 'ecofeminismes', []],
|
||||
['Geneviève Pruvost', '1973-', 'ecofeminismes', []],
|
||||
['Donna Haraway', '1944-', 'ecofeminismes', ['pensees-vivant']],
|
||||
['Émilie Hache', '', 'ecofeminismes', []],
|
||||
['Joanna Macy', '1929-', 'ecofeminismes', ['ethiques-environnementales']],
|
||||
|
||||
// Capitalisme vert
|
||||
['Bill Gates', '1955-', 'capitalisme-vert', []],
|
||||
['Christiana Figueres', '1956-', 'capitalisme-vert', []],
|
||||
['Nicholas Stern', '1946-', 'capitalisme-vert', []],
|
||||
['Jeffrey Sachs', '1954-', 'capitalisme-vert', []],
|
||||
['Jared Diamond', '1937-', 'capitalisme-vert', ['decroissance']],
|
||||
['Jørgen Randers', '1945-', 'capitalisme-vert', ['decroissance']],
|
||||
['Donella Meadows', '1941-2001', 'decroissance', ['capitalisme-vert']],
|
||||
['Dennis Meadows', '1942-', 'decroissance', ['capitalisme-vert']],
|
||||
['Kate Raworth', '1970-', 'capitalisme-vert', []],
|
||||
['Al Gore', '1948-', 'capitalisme-vert', []],
|
||||
['Hal Harvey', '1960-', 'capitalisme-vert', []],
|
||||
['Laurence Tubiana', '1951-', 'capitalisme-vert', []],
|
||||
['Amory Lovins', '1947-', 'capitalisme-vert', []],
|
||||
['David Pearce', '1959-', 'capitalisme-vert', []],
|
||||
['Kerry Turner', '1948-', 'capitalisme-vert', []],
|
||||
['David Keith', '1963-', 'capitalisme-vert', []],
|
||||
['Ted Nordhaus', '1965-', 'capitalisme-vert', []],
|
||||
['Michael Shellenberger', '1971-', 'capitalisme-vert', []],
|
||||
['Pavan Sukhdev', '1960-', 'capitalisme-vert', []],
|
||||
['Janine Benyus', '1958-', 'capitalisme-vert', []],
|
||||
['Robert Costanza', '1950-', 'capitalisme-vert', []],
|
||||
['Peter Kareiva', '1951-', 'capitalisme-vert', []],
|
||||
['Michelle Marvier', '', 'capitalisme-vert', []],
|
||||
['Robert Lalasz', '1915-2003', 'capitalisme-vert', []],
|
||||
['Steward Brand', '1938-', 'capitalisme-vert', []],
|
||||
['Paul Crutzen', '1933-2021', 'capitalisme-vert', []],
|
||||
['Kenneth Boulding', '1910-1993', 'capitalisme-vert', []],
|
||||
['Eugene Odum', '1913-2002', 'capitalisme-vert', []],
|
||||
['Howard Odum', '1924-2002', 'capitalisme-vert', []],
|
||||
['Jean-Marc Jancovici', '1962-', 'capitalisme-vert', []],
|
||||
['Yves Cochet', '1946-', 'capitalisme-vert', ['decroissance']],
|
||||
['Pablo Servigne', '1978-', 'decroissance', ['capitalisme-vert']],
|
||||
['Gauthier Chapelle', '1968-', 'decroissance', ['capitalisme-vert']],
|
||||
|
||||
// Écologies décoloniales
|
||||
['Malcom Ferdinand', '1985-', 'ecologies-decoloniales', []],
|
||||
['Frantz Fanon', '1925-1961', 'ecologies-decoloniales', []],
|
||||
['Édouard Glissant', '1928-2011', 'ecologies-decoloniales', []],
|
||||
['Aimé Césaire', '1913-2008', 'ecologies-decoloniales', []],
|
||||
['Mohamad Amer Meziane', '', 'ecologies-decoloniales', []],
|
||||
['Chico Mendes', '1944-1988', 'ecologies-decoloniales', []],
|
||||
['Joan Martínez Alier', '1939-', 'ecologies-decoloniales', []],
|
||||
['Arturo Escobar', '1951-', 'ecologies-decoloniales', []],
|
||||
['Sous-commandant Marcos', '1957-', 'ecologies-decoloniales', []],
|
||||
['Alberto Acosta', '1948-', 'ecologies-decoloniales', []],
|
||||
['Jérôme Baschet', '1960-', 'ecologies-decoloniales', []],
|
||||
['Fatima Ouassak', '1976-', 'ecofeminismes', ['ecologies-decoloniales']],
|
||||
['William Acker', '1991-', 'ecologies-decoloniales', []],
|
||||
['Giorgos Kallis', '1972-', 'ecologies-decoloniales', ['decroissance']],
|
||||
['Bernard Lambert', '1931-1984', 'ecologies-decoloniales', []],
|
||||
|
||||
// Écofascismes
|
||||
['Alain de Benoist', '1943-', 'ecofascismes', []],
|
||||
['Paul Ralph Ehrlich', '1932-', 'ecofascismes', []],
|
||||
['Garrett Hardin', '1915-2003', 'ecofascismes', []],
|
||||
['Edward Osborne Wilson', '1929-2021', 'ecofascismes', []],
|
||||
['Thomas Malthus', '1803-1882', 'ecofascismes', []],
|
||||
['David Foreman', '1946-2022', 'ecofascismes', []],
|
||||
['Piero San Giorgio', '1971-', 'ecofascismes', []],
|
||||
|
||||
// Éthique environnementale
|
||||
['Arne Næss', '1912-2009', 'ethiques-environnementales', []],
|
||||
['Rachel Carson', '1907-1964', 'ethiques-environnementales', []],
|
||||
['Aldo Leopold', '1887-1948', 'ethiques-environnementales', []],
|
||||
['Imanishi Kinji', '1902-1992', 'ethiques-environnementales', []],
|
||||
['Paul Watson', '1950-', 'ethiques-environnementales', []],
|
||||
['John Muir', '1838-1914', 'ethiques-environnementales', []],
|
||||
['Edward Abbey', '1927-1989', 'ethiques-environnementales', []],
|
||||
['John Baird Callicott', '1941-', 'ethiques-environnementales', []],
|
||||
['Bill Mollison', '1928-2016', 'ethiques-environnementales', []],
|
||||
['David Holmgren', '1955-', 'ethiques-environnementales', []],
|
||||
['Peter Singer', '1946-', 'ethiques-environnementales', []],
|
||||
['Pierre Rabhi', '1938-2021', 'ethiques-environnementales', []],
|
||||
['Rob Hopkins', '1968-', 'ethiques-environnementales', []],
|
||||
['Cyril Dion', '1978-', 'ethiques-environnementales', []],
|
||||
['Gandhi', '1869-1948', 'ethiques-environnementales', []],
|
||||
['Gifford Pinchot', '1865-1946', 'ethiques-environnementales', []],
|
||||
['Lanza del Vasto', '1901-1981', 'ethiques-environnementales', []],
|
||||
['Jorge Mario Bergoglio', '1936-', 'ethiques-environnementales', []],
|
||||
['Gary Snyder', '1930-', 'ethiques-environnementales', []],
|
||||
['Henry David Thoreau', '1817-1862', 'ethiques-environnementales', []],
|
||||
['Ralph Waldo Emerson', '1803-1882', 'ethiques-environnementales', []],
|
||||
['José Bové', '1953-', 'ethiques-environnementales', []],
|
||||
['Glenn Albrecht', '1953-', 'ethiques-environnementales', []],
|
||||
|
||||
// Pensées du vivant
|
||||
['Bruno Latour', '1947-2022', 'pensees-vivant', []],
|
||||
['Isabelle Stengers', '1949-', 'pensees-vivant', []],
|
||||
['Vinciane Despret', '1959-', 'pensees-vivant', []],
|
||||
['Baptiste Morizot', '1983-', 'pensees-vivant', []],
|
||||
['Philippe Descola', '1949-', 'pensees-vivant', []],
|
||||
['Eduardo Viveiros de Castro', '1951-', 'pensees-vivant', []],
|
||||
['Anna Tsing', '1952-', 'pensees-vivant', []],
|
||||
['Deborah Bird Rose', '1946-2018', 'pensees-vivant', []],
|
||||
['Lynn Margulis', '1938-2011', 'pensees-vivant', []],
|
||||
['James Lovelock', '1919-2022', 'pensees-vivant', []],
|
||||
['Serge Moscovici', '1925-2014', 'pensees-vivant', []],
|
||||
['Theodore Roszak', '1933-2011', 'pensees-vivant', []],
|
||||
['Baruch Spinoza', '1632-1677', 'pensees-vivant', []],
|
||||
];
|
||||
|
||||
// Special slug overrides (match v2.1 IDs + ligatures)
|
||||
const NAME_TO_SLUG_OVERRIDES = {
|
||||
'Malcom Ferdinand': 'malcolm-ferdinand',
|
||||
"Françoise d'Eaubonne": 'francoise-deaubonne',
|
||||
'Donella Meadows': 'donella-meadows',
|
||||
'Dennis Meadows': 'dennis-meadows',
|
||||
'Arne Næss': 'arne-naess',
|
||||
'Jørgen Randers': 'jorgen-randers',
|
||||
};
|
||||
|
||||
function slugify(name) {
|
||||
// Pre-process special ligatures and chars not handled by NFKD
|
||||
let pre = name
|
||||
.replace(/[æÆ]/g, 'ae')
|
||||
.replace(/[øØ]/g, 'o')
|
||||
.replace(/[œŒ]/g, 'oe')
|
||||
.replace(/ß/g, 'ss');
|
||||
// Remove diacritical marks
|
||||
const noAccent = pre.normalize('NFKD').replace(/[̀-ͯ]/g, '');
|
||||
return noAccent
|
||||
.toLowerCase()
|
||||
.replace(/[^a-z0-9]+/g, '-')
|
||||
.replace(/^-+|-+$/g, '');
|
||||
}
|
||||
|
||||
function getAuthorSlug(name) {
|
||||
if (NAME_TO_SLUG_OVERRIDES[name]) return NAME_TO_SLUG_OVERRIDES[name];
|
||||
return slugify(name);
|
||||
}
|
||||
|
||||
function main() {
|
||||
const raw = fs.readFileSync(JSON_PATH, 'utf-8');
|
||||
const data = JSON.parse(raw);
|
||||
|
||||
const existingBySlug = {};
|
||||
for (const a of data.auteurs) existingBySlug[a.id] = a;
|
||||
|
||||
const newAuthors = [];
|
||||
const seenSlugs = new Set();
|
||||
|
||||
for (const [nom, dates, ecolePrincipale, ecolesSecondaires] of BONPOTE_AUTHORS) {
|
||||
const slug = getAuthorSlug(nom);
|
||||
if (seenSlugs.has(slug)) {
|
||||
console.error(`DUPLICATE SKIP: ${nom} -> ${slug}`);
|
||||
continue;
|
||||
}
|
||||
seenSlugs.add(slug);
|
||||
|
||||
const ingere = INGESTED_AUTHOR_SLUGS.has(slug);
|
||||
const ecoles = [ecolePrincipale, ...ecolesSecondaires];
|
||||
|
||||
if (existingBySlug[slug]) {
|
||||
// Preserve enriched entry
|
||||
const entry = { ...existingBySlug[slug], ingere };
|
||||
newAuthors.push(entry);
|
||||
} else {
|
||||
// New minimal entry
|
||||
const bioProvisoire = ingere
|
||||
? `Auteur·ice ingéré·e dans le RAG ATIS, bio à enrichir lors de PRG-5.`
|
||||
: `Théoricien·ne présent·e sur le poster Bonpote (${ecolePrincipale}), non ingéré·e dans le RAG ATIS.`;
|
||||
newAuthors.push({
|
||||
id: slug,
|
||||
nom,
|
||||
dates,
|
||||
ecoles,
|
||||
ecole_principale: ecolePrincipale,
|
||||
livres_rag: [],
|
||||
theses_cles_attendues: [],
|
||||
bio_courte_provisoire: bioProvisoire,
|
||||
ingere,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// Preserve any v2.1 author not in Bonpote list
|
||||
for (const [slug, entry] of Object.entries(existingBySlug)) {
|
||||
if (!seenSlugs.has(slug)) {
|
||||
const copy = { ...entry };
|
||||
if (!('ingere' in copy)) copy.ingere = INGESTED_AUTHOR_SLUGS.has(slug);
|
||||
newAuthors.push(copy);
|
||||
seenSlugs.add(slug);
|
||||
console.error(`NOTE: preserved v2.1 author not in Bonpote canonical: ${slug}`);
|
||||
}
|
||||
}
|
||||
|
||||
const auteursCount = newAuthors.length;
|
||||
const auteursIngeresCount = newAuthors.filter(a => a.ingere).length;
|
||||
|
||||
data.meta.version = '3.0';
|
||||
data.meta.updated = '2026-05-12';
|
||||
data.meta.auteurs_count = auteursCount;
|
||||
data.meta.auteurs_ingeres_count = auteursIngeresCount;
|
||||
data.meta.source = 'FRACAS Bonpote V2 oct 2024 + LightRAG corpus 12/05/2026 (v3.0 sync)';
|
||||
data.meta.note_v3_0 = 'Phase 8.A sync corpus unifie : ~140 auteurs Bonpote integres, flag ingere:true/false selon LightRAG VPS. Auteurs non-ingeres = entrees minimales (bio provisoire, livres_rag vide), a enrichir lors de PRG-4/PRG-5.';
|
||||
|
||||
data.auteurs = newAuthors;
|
||||
|
||||
fs.writeFileSync(JSON_PATH, JSON.stringify(data, null, 2), 'utf-8');
|
||||
|
||||
// Validate parse-back
|
||||
const parsedBack = JSON.parse(fs.readFileSync(JSON_PATH, 'utf-8'));
|
||||
if (parsedBack.auteurs.length !== auteursCount) {
|
||||
console.error('PARSE-BACK MISMATCH');
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
// Stats
|
||||
const schoolsStats = {};
|
||||
for (const a of newAuthors) {
|
||||
const ep = a.ecole_principale || '?';
|
||||
if (!schoolsStats[ep]) schoolsStats[ep] = { total: 0, ingere: 0 };
|
||||
schoolsStats[ep].total++;
|
||||
if (a.ingere) schoolsStats[ep].ingere++;
|
||||
}
|
||||
|
||||
console.log('\n=== JSON v3.0 written ===');
|
||||
console.log(`Total auteurs : ${auteursCount}`);
|
||||
console.log(`Ingeres : ${auteursIngeresCount}`);
|
||||
console.log(`Non-ingeres : ${auteursCount - auteursIngeresCount}`);
|
||||
console.log(`Parse-back : OK (${parsedBack.auteurs.length} auteurs)`);
|
||||
console.log('\nPer school (ecole_principale):');
|
||||
const sortedSchools = Object.entries(schoolsStats).sort((a, b) => b[1].total - a[1].total);
|
||||
for (const [school, st] of sortedSchools) {
|
||||
console.log(` ${school.padEnd(30)} total=${String(st.total).padStart(3)} ingere=${String(st.ingere).padStart(3)} non-ing=${String(st.total - st.ingere).padStart(3)}`);
|
||||
}
|
||||
|
||||
// Top 5 schools with most non-ingested
|
||||
const nonIngStats = sortedSchools
|
||||
.map(([k, v]) => [k, v.total - v.ingere])
|
||||
.sort((a, b) => b[1] - a[1])
|
||||
.slice(0, 5);
|
||||
console.log('\nTop 5 ecoles avec le plus de non-ingeres (PRG-4 priorities):');
|
||||
for (const [school, count] of nonIngStats) {
|
||||
console.log(` ${school.padEnd(30)} non-ing=${count}`);
|
||||
}
|
||||
}
|
||||
|
||||
main();
|
||||
Reference in New Issue
Block a user