ACOR means Aho-Corasick automation working On Redis, Written in Go
- Golang >= 1.13
- Redis >= 3.0
$ go get -u https://github.com/skyoo2003/acor
package main
import (
"fmt"
"github.com/skyoo2003/acor/pkg/acor"
)
func main() {
args := &acor.AhoCorasickArgs{
Addr: "localhost:6379",
Password: "",
DB: 0,
Name: "sample",
}
ac := acor.Create(args)
defer ac.Close()
keywords := []string{"he", "her", "him"}
for _, k := range keywords {
ac.Add(k)
}
matched := ac.Find("he is him")
fmt.Println(matched)
ac.Flush() // If you want to remove all of data
}
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.
Copyright (c) 2016-2021 Sung-Kyu Yoo.
This project is MIT license.