-
Notifications
You must be signed in to change notification settings - Fork 5
Open
Description
Assume:
content := "hiholaop"
ac := goac.NewAhoCorasick()
ac.AddPattern("hi")
ac.AddPattern("hola")
ac.AddPattern("hiho")
ac.AddPattern("laop")
ac.Build()
results := ac.Scan(content)
fmt.Println("Given: " + content)
fmt.Println("Found: ")
for _, result := range results {
fmt.Println(string([]rune(content)[result.Start : result.End+1]))
}
Output:
Given: hiholaop
Found:
hi
hiho
laop
It does not return "hola"
Metadata
Metadata
Assignees
Labels
No labels