feat(chunks): sentence-boundary flush, math incomplete detection, structure profile export

- chunker: estrai _flush_chunk() con estensione al confine di frase (max 120%)
- verify: rileva chunk matematici incompleti come warning, gestisci hash hex e URL
- conversione: esporta structure_profile.json nell'output dir
This commit is contained in:
2026-04-20 12:27:58 +02:00
parent 240cad9830
commit f340c4c14e
3 changed files with 84 additions and 20 deletions
+3
View File
@@ -1538,6 +1538,9 @@ def run(stem: str, project_root: Path, force: bool) -> bool:
print(f" ✗ Permesso negato durante la scrittura: {e}")
return False
profile = analyze(clean_out)
(out_dir / "structure_profile.json").write_text(
json.dumps(profile, ensure_ascii=False, indent=2), encoding="utf-8"
)
_LIVELLO_DESC = {3: "ricca (h3)", 2: "parziale (h2)", 1: "paragrafi", 0: "testo piatto"}
print(f" ✅ Struttura: livello {profile['livello_struttura']}{_LIVELLO_DESC[profile['livello_struttura']]}")