Skip to content

Repository files navigation

cedar

Build StatusBuild StatusCircleCI StatuscodecovGo Report CardGoDocRelease

Package cedar implementes double-array trie and aho corasick

It is implements the cedar and paper by golang.

Install

go get -u github.com/vcaesar/cedar

Usage

package main
import (
"fmt""github.com/vcaesar/cedar"
)
funcmain() {
// Create a new cedar trie.d:=cedar.New()
d.Insert([]byte("ab"), 1)
d.Insert([]byte("abc"), 2)
d.Insert([]byte("abcd"), 3)
fmt.Println(d.Jump([]byte("ab"), 0))
fmt.Println(d.Find([]byte("bc"), 0))
fmt.Println(d.PrefixMatch([]byte("bc"), 0))
fmt.Println(d.ExactMatch([]byte("ab")))
}

License

This is released under the BSD-2 license, following the original license of C++ cedar.

Reference

About

Go efficiently double-array trie and aho corasick

Topics

Resources

Contributing

Stars

14 stars

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages