Documentation ¶
Index ¶
- Variables
- func CosineComparator(vec1, vec2 []float64) float64
- func Tokenize(s string) []string
- type Comparator
- type Document
- type Filter
- type Option
- type StopWords
- type TfIdf
- func (i TfIdf) AddDocument(document string)
- func (i TfIdf) Compare(document1, document2 string) (float64, error)
- func (i TfIdf) GetDocument(document string) *Document
- func (i TfIdf) InverseDocumentFrequency(term string) float64
- func (i TfIdf) TermFrequencyInverseDocumentFrequencyForDocument(document string) []float64
- func (i TfIdf) TermFrequencyInverseDocumentFrequencyForTerm(term string, document string) float64
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultList = map[string]bool{}/* 175 elements not displayed */
Functions ¶
func CosineComparator ¶
Types ¶
type Comparator ¶
type Document ¶
func (Document) TermFrequency ¶
type Option ¶
type Option func(idf *TfIdf)
func WithComparator ¶
func WithComparator(comparator Comparator) Option
func WithDefaultStopWords ¶
func WithDefaultStopWords() Option
func WithDocuments ¶
func WithStopWords ¶
type StopWords ¶
func NewEmptyStopWords ¶
func NewEmptyStopWords() *StopWords
func (*StopWords) AddIgnoreFilter ¶
type TfIdf ¶
type TfIdf struct { Documents map[string]Document StopWords *StopWords // contains filtered or unexported fields }
func DefaultOptions ¶
func DefaultOptions() *TfIdf
func (TfIdf) AddDocument ¶
func (TfIdf) GetDocument ¶
func (TfIdf) InverseDocumentFrequency ¶
func (TfIdf) TermFrequencyInverseDocumentFrequencyForDocument ¶
Click to show internal directories.
Click to hide internal directories.