radix

package
v0.0.0-...-7b6f070 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2018 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package radix implements a radix tree for storing a collection of strings processing

Index

Constants

This section is empty.

Variables

View Source
var ErrCannotCreateNode = errors.New("radix: no node created")

ErrCannotCreateNode is an error we get when insert somehow fails

View Source
var ErrInvalidCategoryCount = errors.New("radix: invalid category count")

ErrInvalidCategoryCount is an error for when the number of categories this tree should count is invalid

View Source
var ErrOutOfBoundsCategory = errors.New("radix: out of bounds category")

ErrOutOfBoundsCategory is an errror for when the category we want to increment is out of bounds

Functions

This section is empty.

Types

type Tree

type Tree interface {
	Insert(needle string, category int) error
	Find(needle string) ([]int, bool)
	GetTotals() []int
	CategoryCount() int
	UniqueWords() int
}

Tree represents how we can interface with our specialized radix tree

func New

func New(numCategories int) (Tree, error)

New creates a new instance of a radix tree

Jump to

Keyboard shortcuts

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