Skip to content

feat(readability-lab): Readability Lab — 4 indices de lisibilité (français)#11

Open
freemind25 wants to merge 2 commits into
mainfrom
feat/readability-lab
Open

feat(readability-lab): Readability Lab — 4 indices de lisibilité (français)#11
freemind25 wants to merge 2 commits into
mainfrom
feat/readability-lab

Conversation

@freemind25

Copy link
Copy Markdown
Owner

Readability Lab — UnRobot v3.0 (premier lab)

Premier pas concret vers la vision Linguistic Intelligence Lab : un module d'analyse de lisibilité 100 % local, sans nouvelle dépendance.

4 indices implémentés

Indice Référence Particularité
Flesch-Kincaid Reading Ease Kandel & Moles, 1958 Adapté au français (constantes recalibrées)
LIX — Läsbarhetsindex Björnsson, 1968 Langue-agnostique (mots ≥ 7 caractères)
Gunning Fog Adapté FR Proxy 3 syllabes+ pour la complexité
Coleman-Liau Original Opère sur les caractères → robuste toutes langues

Ce qui a été livré

  • : moteur pur (heuristique syllabique française avec suppression du e muet et regroupement des voyelles consécutives), score global 0–100, 5 labels qualitatifs
  • : panneau repliable, barres de progression colorées par indice, grille de métriques brutes, tooltips avec plages de référence et sens du score
  • : 11 tests (texte simple vs complexe, bornes, labels, texte réglementaire urbanistique)
  • : montage conditionnel (visible dès qu'il y a du texte)

Vérifications

  • Aucune nouvelle erreur TypeScript dans les fichiers ajoutés
  • [x]

unrobot@0.0.0 test
vitest run

�[1m�[30m�[46m RUN �[49m�[39m�[22m �[36mv4.1.9 �[39m�[90m/home/claude/UnRobot�[39m

�[32m✓�[39m src/lib/tests/engine.test.ts �[2m(�[22m�[2m26 tests�[22m�[2m)�[22m�[32m 39�[2mms�[22m�[39m
�[32m✓�[39m src/lib/tests/readability.test.ts �[2m(�[22m�[2m11 tests�[22m�[2m)�[22m�[32m 11�[2mms�[22m�[39m

�[2m Test Files �[22m �[1m�[32m2 passed�[39m�[22m�[90m (2)�[39m
�[2m Tests �[22m �[1m�[32m37 passed�[39m�[22m�[90m (37)�[39m
�[2m Start at �[22m 11:46:48
�[2m Duration �[22m 1.00s�[2m (transform 281ms, setup 0ms, import 344ms, tests 50ms, environment 0ms)�[22m : 37/37 (26 existants + 11 nouveaux)

  • [x]

unrobot@0.0.0 build
vite build

vite v5.4.19 building for production...
transforming...
✓ 1718 modules transformed. : build de production OK

Non inclus (volontairement)

  • Quality Lab / détection de contradictions : nécessite un LLM embarqué
  • Semantic coherence : idem (spike Phase 1/2 déjà identifié)

…wired, toggle buttons

- PWA: manifest.json with icons, Apple meta tags, service worker (cache-first for assets, network-first for HTML)
- Service worker: pre-caches app shell, font caching, offline fallback
- Transfer Learning: panel now accessible via toggle button, linked to ML detector's custom model
- Added 'Outils' toolbar with Plagiat and Transfer Learning toggle buttons
- VS Code extension already functional (scan file, scan workspace, clear, inline decorations, diagnostics)
- 26/26 tests, build successful
Implement the Readability Lab, first step toward the Linguistic
Intelligence Lab vision (UnRobot v3.0).

Four indices calibrated for French, 100% local, zero new dependency:
- Flesch-Kincaid Reading Ease (Kandel & Moles 1958, FR adaptation)
- LIX Läsbarhetsindex (Björnsson 1968, language-agnostic)
- Gunning Fog (adapted: words >= 3 syllables as complexity proxy)
- Coleman-Liau (character-based, fully language-agnostic)

Changes:
- src/lib/readability.ts: syllable heuristic for French (mute-e
  stripping, consecutive vowel grouping), per-index normalization,
  combined 0-100 global score with 5 qualitative labels
- src/components/TextCleaner/ReadabilityLab.tsx: collapsible panel,
  progress bars per index, raw metrics grid, info tooltips with
  range explanations, epistemic note
- src/components/TextCleaner/index.tsx: mount ReadabilityLab below
  AIAnalysis when text is present
- src/lib/__tests__/readability.test.ts: 11 tests covering null
  guards, simple vs complex ranking, per-index direction, label
  assignment, and a realistic urban planning text fixture

Verified: zero new TS errors, npm test 37/37, npm run build OK.
@vercel

vercel Bot commented Jul 2, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
unrobot Ready Ready Preview, Comment Jul 2, 2026 11:47am

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant