Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

vcaesar/cedar

Repository files navigation

cedar

Build Status Build Status CircleCI Status codecov Go Report Card GoDoc Release

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))
	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

License

Contributing

Stars

Watchers

Forks

Packages

Contributors

Languages

AltStyle によって変換されたページ (->オリジナル) /