Project Files
src / data / notions.ts
// Les 17 notions canoniques du programme de philosophie
// terminale (séries générales), BO 2026.
// Ordre alphabétique pour l'affichage dropdown.
export const NOTIONS: readonly string[] = [
"L'art",
"Le bonheur",
"La conscience",
"Le devoir",
"L'État",
"L'inconscient",
"La justice",
"Le langage",
"La liberté",
"La nature",
"La raison",
"La religion",
"La science",
"La technique",
"Le temps",
"Le travail",
"La vérité",
] as const;
export type Notion = (typeof NOTIONS)[number];
const NORMALIZED = new Map<string, Notion>();
for (const n of NOTIONS) NORMALIZED.set(normalizeNotion(n), n);
// B3 — ̀-ͯ = combining diacritical marks (Unicode block).
// Forme échappée (vs caractères combinants littéraux) : lisible dans
// tout éditeur, robuste aux formatters qui normaliseraient le source.
export function normalizeNotion(s: string): string {
return s
.toLowerCase()
.normalize("NFD")
.replace(/[̀-ͯ]/g, "")
.replace(/^(l'|la |le |les )/, "")
.trim();
}
export function canonicalNotion(s: string): Notion | null {
return NORMALIZED.get(normalizeNotion(s)) ?? null;
}
export function isCanonicalNotion(s: string): s is Notion {
return NORMALIZED.has(normalizeNotion(s));
}