Skip to content

Something is wrong! #1

@mr-ma

Description

@mr-ma

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

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions