MCPcopy Create free account
hub / github.com/astercloud/aster / TestDetectContradictions_Chinese

Function TestDetectContradictions_Chinese

pkg/memory/quality_analyzer_test.go:71–94  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

69}
70
71func TestDetectContradictions_Chinese(t *testing.T) {
72 config := DefaultQualityMetricsConfig()
73 qm := NewQualityMetrics(config)
74 qa := NewQualityAnalyzer(qm, nil)
75
76 memories := []MemoryWithScore{
77 {
78 DocID: "mem1",
79 Text: "用户有权限访问系统",
80 Provenance: NewProvenance(SourceUserInput, "user-1"),
81 },
82 {
83 DocID: "mem2",
84 Text: "用户没有权限访问系统",
85 Provenance: NewProvenance(SourceUserInput, "user-2"),
86 },
87 }
88
89 contradictions := qa.detectContradictions(memories)
90
91 if len(contradictions) == 0 {
92 t.Error("should detect contradiction in Chinese text")
93 }
94}
95
96func TestDetectDuplicates(t *testing.T) {
97 config := DefaultQualityMetricsConfig()

Callers

nothing calls this directly

Calls 6

detectContradictionsMethod · 0.95
NewQualityMetricsFunction · 0.85
NewQualityAnalyzerFunction · 0.85
NewProvenanceFunction · 0.85
ErrorMethod · 0.65

Tested by

no test coverage detected