Skip to content
This repository has been archived by the owner on Apr 2, 2024. It is now read-only.

Commit

Permalink
Fix a major bug, forgot to add intentsPath to olivia_test
Browse files Browse the repository at this point in the history
  • Loading branch information
hugolgst committed Mar 25, 2020
1 parent 6592023 commit 1ea6cd4
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions olivia_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ import (
)

func TestCalculate(t *testing.T) {
model := training.CreateNeuralNetwork()
intentsPath := "res/intents.json"
model := training.CreateNeuralNetwork(intentsPath)
cache := gocache.New(5*time.Minute, 5*time.Minute)

sentences := map[string]string{
Expand All @@ -32,7 +33,7 @@ func TestCalculate(t *testing.T) {
}

for sentence, tag := range sentences {
responseTag, _ := analysis.NewSentence(sentence).Calculate(*cache, model, "1")
responseTag, _ := analysis.NewSentence(sentence).Calculate(*cache, model, intentsPath, "1")

if !regexp.MustCompile(tag).MatchString(responseTag) {
t.Errorf("Expected \"%s\" tag for \"%s\", found \"%s\"", tag, sentence, responseTag)
Expand Down

0 comments on commit 1ea6cd4

Please sign in to comment.