"""Corpus-filter constants for the paper eval (released path, no scorer import). They are pure eval configuration, kept separate from the (closed-scorer-importing) modules so the released analysis path can import them without touching the scorer. """ from __future__ import annotations # Drop these subcorpora / title substrings before any paper statistic. EXCLUDE_CORPUS = {"bible_workin_progress", "bible_awaiting_proof"} EXCLUDE_SUBSTR = ("Märchen", "Marchen") def keep(rec: dict) -> bool: """The paper's corpus filter: drop excluded subcorpora / fairy-tale titles. `rec` needs only a `corpus` field (bundle rows pass `{"corpus": row["sub"]}`).""" c = rec.get("corpus", "") or "" if c in EXCLUDE_CORPUS: return False return all(sub.lower() not in c.lower() for sub in EXCLUDE_SUBSTR)