Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BaseDocument ¶
type BaseDocument struct { Name DocumentID `json:"id"` Content string `json:"text"` }
func NewBaseDocument ¶
func NewBaseDocument(id DocumentID, text string) BaseDocument
func (BaseDocument) ID ¶
func (d BaseDocument) ID() string
func (BaseDocument) Text ¶
func (d BaseDocument) Text() string
type Document ¶
type Document interface { ID() DocumentID Text() string }
type DocumentData ¶
type DocumentData struct { Doc Document TermsCount float64 Frequencies TermFrequency }
type DocumentID ¶
type DocumentID = string
type DocumentScore ¶
func (DocumentScore) String ¶
func (ds DocumentScore) String() string
type FloatHeap ¶
type FloatHeap []FloatHeapItem
type FloatHeapItem ¶
type FloatHeapItem struct { Key interface{} Value float64 }
type TermFrequency ¶
TermFrequency stores relative or absolute term frequencies
func NewTermFrequency ¶
func NewTermFrequency(terms []string) TermFrequency
func (TermFrequency) Top ¶
func (tf TermFrequency) Top(n int) []FloatHeapItem
Click to show internal directories.
Click to hide internal directories.