trie

package
v0.16.7 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2024 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Entry

type Entry struct {
	Id   uint
	Word string
}

type Trie

type Trie struct {
	// contains filtered or unexported fields
}

func New

func New() Trie

func (*Trie) Insert

func (t *Trie) Insert(entries ...Entry)

func (*Trie) InsertWords

func (t *Trie) InsertWords(entries ...Entry)

InsertWords will split "Foo i Bar" into two entries - "Foo i Bar" - "Bar"

func (*Trie) SearchExact

func (t *Trie) SearchExact(term string) []uint

Search will return nil if not results were found

func (*Trie) SearchInDistance

func (t *Trie) SearchInDistance(term string, distance int) []uint

func (*Trie) SearchWithinDistance

func (t *Trie) SearchWithinDistance(term string, maxDistance int) []uint

Jump to

Keyboard shortcuts

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