# README
cedar
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"
)
func main() {
// 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))
}
License
This is released under the BSD-2 license, following the original license of C++ cedar.
Reference
# Packages
No description provided by the author
# Functions
New initialize the Cedar for further use.
# Variables
ErrInvalidKey invalid key error.
ErrInvalidVal invalid value error.
ErrNoKey not have key error.
ErrNoVal not have value error.
# Structs
Block stores the linked-list pointers and the stats info for blocks.
Cedar holds all of the information about double array trie.
NInfo stores the information about the trie.
Node contains the array of `base` and `check` as specified in the paper: "An efficient implementation of trie structures" https://dl.acm.org/citation.cfm?id=146691.