acor

module
v1.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 8, 2021 License: MIT

README

ACOR

ACOR means Aho-Corasick automation working On Redis, Written in Go

Current Release CI Status Go Reference Go Report Card License

Prerequisites

  • Golang >= 1.13
  • Redis >= 3.0

Getting Started

$ 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
}

Contributing

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.

License

Copyright (c) 2016-2021 Sung-Kyu Yoo.

This project is MIT license.

Directories

Path Synopsis
cmd
internal
pkg/utils
Package utils stateless and useful functions or structs
Package utils stateless and useful functions or structs
pkg
acor
Package acor means Aho-Corasick automation working On Redis, Written in Go
Package acor means Aho-Corasick automation working On Redis, Written in Go

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL