update
This commit is contained in:
@@ -93,9 +93,53 @@ def test_note_kalibrierung():
|
||||
assert qa.note({"fremd": 1.0}) == 0.0 # komplett fremdes Inventar = 0, nicht 7.7
|
||||
|
||||
|
||||
def test_note_verdacht_zaehlt_nicht():
|
||||
"""dubletten_verdacht ist Verdachtsliste, kein Urteil — beeinflusst die Note nicht."""
|
||||
assert qa.note({"dubletten_verdacht": 1.0}) == 10.0
|
||||
def test_note_dubletten_verdacht_zaehlt():
|
||||
"""dubletten_verdacht bildet das Dopplungs-Nutzerproblem ab → zählt jetzt (Gewicht 1.0),
|
||||
bleibt aber das leichteste Gewicht. 36 % Verdacht → −3.6 → 6.4; die Liste kann >1 sein → geklemmt."""
|
||||
assert qa.note({"dubletten_verdacht": 0.0}) == 10.0
|
||||
assert qa.note({"dubletten_verdacht": 0.36}) == 6.4
|
||||
assert qa.note({"dubletten_verdacht": 2.0}) == 0.0 # >1 wird auf 1.0 geklemmt
|
||||
|
||||
# sub_dubletten_verdacht bleibt gewichtslos (Artefakt-Verdacht, kein Urteil)
|
||||
assert qa.note({"sub_dubletten_verdacht": 1.0}, qa.NOTE_GEWICHTE_ARTEFAKTE) == 10.0
|
||||
|
||||
|
||||
def test_note_konzept_luecken_zaehlt():
|
||||
"""Fehlende benannte Kernresultate drücken die Note (Gewicht 1.5): 20 % → −3.0 → 7.0."""
|
||||
assert qa.note({"konzept_luecken": 0.0}) == 10.0
|
||||
assert qa.note({"konzept_luecken": 0.2}) == 7.0
|
||||
|
||||
|
||||
def test_named_results_only_numbered(monkeypatch):
|
||||
"""Benannte Ergebnisse: nur NUMMERIERTE Katalog-Referenzen mit Namen zählen — Prosa ohne
|
||||
Nummer ('Satz von Goethe') und nackte Nummern ('Satz 7.18') liefern nichts (generisch)."""
|
||||
corpus = {"skript.txt":
|
||||
"Satz 7.13 (Christofides) liefert eine 3/2-Approximation.\n"
|
||||
"Satz 6.24: Satz von Cook und Levin.\n"
|
||||
"Nach Satz 7.18 folgt daraus die Schranke.\n"
|
||||
"Ein Satz von Goethe steht hier."}
|
||||
named = qa._named_results(corpus)
|
||||
assert "Christofides" in named
|
||||
assert any("Cook" in n and "Levin" in n for n in named)
|
||||
assert not any("Goethe" in n for n in named) # keine Nummer → kein False Positive
|
||||
assert all(n.strip() for n in named)
|
||||
|
||||
|
||||
def test_konzept_luecken_flags_missing():
|
||||
"""Benanntes Kernresultat ohne Baustein = Lücke; ein gedecktes Resultat nicht."""
|
||||
corpus = {"s.txt": "Satz 7.13 (Christofides). Satz 6.16 (Kriterium für P=NP)."}
|
||||
named = qa._named_results(corpus)
|
||||
blocks = [{"title": "Christofides-Algorithmus", "description": "3/2-Approximation für TSP"}]
|
||||
gaps = qa.konzept_luecken(blocks, named)
|
||||
assert "Christofides" not in gaps
|
||||
assert any("P=NP" in g or "Kriterium" in g for g in gaps)
|
||||
|
||||
|
||||
def test_konzept_luecken_declension_tolerant():
|
||||
"""Andere Flexion im Baustein deckt das Resultat trotzdem — kein falscher Lücken-Alarm."""
|
||||
named = qa._named_results({"s.txt": "Satz 7.6: Kriterium für Eulerschen Kreis."})
|
||||
blocks = [{"title": "Kriterium für Eulerscher Kreis", "description": "Grad aller Knoten gerade"}]
|
||||
assert qa.konzept_luecken(blocks, named) == []
|
||||
|
||||
|
||||
def test_note_artefakte_getrennt():
|
||||
|
||||
Reference in New Issue
Block a user