Fix corpus response parsing on "document"
Change-Id: Ib305c6430e997f5afdf07310844fab6c7f6443ac
diff --git a/matcher/snippet_matcher_test.go b/matcher/snippet_matcher_test.go
index 3142f9f..9b3a2fd 100644
--- a/matcher/snippet_matcher_test.go
+++ b/matcher/snippet_matcher_test.go
@@ -1,6 +1,7 @@
package matcher
import (
+ "slices"
"testing"
"github.com/KorAP/Koral-Mapper/ast"
@@ -269,13 +270,7 @@
assert.Equal(t, expectedTexts[i], token.Text)
// Verify that each token has the required annotation
- hasGenderMasc := false
- for _, annotation := range token.Annotations {
- if annotation == "marmot/m:gender:masc" {
- hasGenderMasc = true
- break
- }
- }
+ hasGenderMasc := slices.Contains(token.Annotations, "marmot/m:gender:masc")
assert.True(t, hasGenderMasc, "Token %s should have marmot/m:gender:masc annotation", token.Text)
}
}