update
This commit is contained in:
@@ -97,9 +97,15 @@ def _corpus_texts(topic: str) -> dict[str, str]:
|
||||
out = {}
|
||||
for f in sorted(folder.glob("*.txt")):
|
||||
try:
|
||||
out[f.name] = f.read_text(encoding="utf-8")
|
||||
text = f.read_text(encoding="utf-8")
|
||||
except OSError:
|
||||
continue
|
||||
# QUELLE:-Header (Metadata, kein Lerninhalt) strippen — sonst bildet er bei großen
|
||||
# Seiten einen isolierten, block-losen Abschnitt = False-Positive-Lücke.
|
||||
lines = text.splitlines()
|
||||
if lines and lines[0].startswith("QUELLE:"):
|
||||
text = "\n".join(lines[1:]).lstrip("\n")
|
||||
out[f.name] = text
|
||||
return out
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user