feat(q1): D1 - import quarantine module + add quarantine_mgr param
Étape D1 du sprint Q-1 (sous-commit 1/3 pour process_pdf) : - Import try/except de quarantine.py : QuarantineManager, DocLogger, SEUIL_TEXTE_MINI (=100), SEUIL_RESCAN_RESIDUEL (=0) - Si quarantine.py absent, fallback None pour rétro-compat (anciennes installs continuent avec ancien comportement silencieux) - Nouveau param dans process_pdf : quarantine_mgr (Optional, default None) - Aucun changement de comportement à ce stade — D2 branchera l'usage Tests : import OK, process_pdf signature étendue (13 params), SEUIL_TEXTE_MINI accessible depuis le module. Ref: docs/coordination/inbox/for-dom/2026-05-29_consolide_pseudocode-Q1-v2.md §10 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -88,6 +88,22 @@ try:
|
||||
except Exception:
|
||||
VlmManager = None # type: ignore
|
||||
|
||||
# Quarantine manager (Q-1 — quarantaine différentielle)
|
||||
# Si quarantine.py est absent (ancienne install), le pipeline continue avec
|
||||
# l'ancien comportement (silence sur échec de rédaction). Recommandé : installer.
|
||||
try:
|
||||
from quarantine import (
|
||||
QuarantineManager,
|
||||
DocLogger,
|
||||
SEUIL_TEXTE_MINI,
|
||||
SEUIL_RESCAN_RESIDUEL,
|
||||
)
|
||||
except ImportError:
|
||||
QuarantineManager = None # type: ignore
|
||||
DocLogger = None # type: ignore
|
||||
SEUIL_TEXTE_MINI = 100
|
||||
SEUIL_RESCAN_RESIDUEL = 0
|
||||
|
||||
|
||||
def _load_edsnlp_drug_names() -> set:
|
||||
"""Charge les noms de médicaments mono-mot depuis edsnlp/resources/drugs.json.
|
||||
@@ -4256,6 +4272,7 @@ def process_pdf(
|
||||
vlm_manager=None,
|
||||
gliner_manager=None,
|
||||
camembert_manager=None,
|
||||
quarantine_mgr: Optional["QuarantineManager"] = None,
|
||||
) -> Dict[str, str]:
|
||||
out_dir.mkdir(parents=True, exist_ok=True)
|
||||
cfg = load_dictionaries(config_path)
|
||||
|
||||
Reference in New Issue
Block a user