index

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TermIndex

type TermIndex struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

TermIndex provides a term frequency index

func NewTermIndex

func NewTermIndex(capacity int) *TermIndex

NewTermIndex initializes an empty term frequency index

func (*TermIndex) Add

func (i *TermIndex) Add(t string) int

Add a term to the index

func (*TermIndex) Count

func (i *TermIndex) Count() int

Count returns the number of terms within the index

func (*TermIndex) Frequency

func (i *TermIndex) Frequency(term string) float64

Frequency returns the term frequency within the index

func (*TermIndex) IndexOf

func (i *TermIndex) IndexOf(term string) int

IndexOf returns the index of the provided term, or -1 if not found

func (*TermIndex) String

func (i *TermIndex) String() string

Jump to

Keyboard shortcuts

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