pruningradixtrie

package module
v0.0.0-...-bae9be0 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2023 License: MIT Imports: 4 Imported by: 0

README

PruningRadixTrie
MIT License

pruningradixtrie

A go implementation of a Pruning Radix Trie.

Original implementation found on https://github.com/wolfgarbe/PruningRadixTrie

Installation

Run go get -v github.com/elielamora/pruningradixtrie in your project.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewBSResultSet

func NewBSResultSet() *bsResults

func NewBSResultSetFromSlice

func NewBSResultSetFromSlice(results []Result) *bsResults

NewBSResultSetFromSlice initializes a binary search result set with the contents of a result. This should only be used for testing and therefore it is the responibility of the caller to ensure that the results are sorted.

func NewPruningRadixTrie

func NewPruningRadixTrie() *pruningRadixTrie

func NewSortedResults

func NewSortedResults() *sortedResults

Types

type PruningRadixTrie

type PruningRadixTrie interface {
	AddTerm(term string, count uint64)
	TopKForPrefix(prefix string, k int) []Result
}

type Result

type Result struct {
	Term string
	Freq uint64
}

func (Result) String

func (r Result) String() string

type ResultSet

type ResultSet interface {
	Results() []Result
	PushResult(Result)
	PopResult() Result
	PeekMinResult() Result
	Len() int
}

func NewResultHeap

func NewResultHeap() ResultSet

Jump to

Keyboard shortcuts

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