mirror of
https://github.com/wgh136/nysoure.git
synced 2025-09-27 12:17:24 +00:00
Check stopwords
This commit is contained in:
@@ -163,3 +163,23 @@ func TestSearchResource(t *testing.T) {
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func TestIsStopWord(t *testing.T) {
|
||||
Init()
|
||||
defer TearDown()
|
||||
|
||||
stopWords := []string{"the", "is", "at", "which", "on", "and", "a", "an", "in", "to", "of"}
|
||||
nonStopWords := []string{"adventure", "mystery", "romance", "sci-fi", "comedy", "action", "horror"}
|
||||
|
||||
for _, word := range stopWords {
|
||||
if !IsStopWord(word) {
|
||||
t.Errorf("Expected '%s' to be identified as a stop word", word)
|
||||
}
|
||||
}
|
||||
|
||||
for _, word := range nonStopWords {
|
||||
if IsStopWord(word) {
|
||||
t.Errorf("Expected '%s' to not be identified as a stop word", word)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user