Documentation ¶
Index ¶
- Constants
- type Corpus
- func (c *Corpus) AddDoc(str string) *Document
- func (c *Corpus) Containing(gram string) prefix.Nodes
- func (c *Corpus) Find(word string) *lset.Set[DocID]
- func (c *Corpus) GetDoc(id DocID) *Document
- func (c *Corpus) GetDocs(ids []DocID) Documents
- func (c *Corpus) IDToVariant(vID VariantID) document.Variant
- func (c *Corpus) IDToWord(rID RootID) string
- func (c *Corpus) Prefix(gram string) prefix.Node
- func (c *Corpus) VariantToID(v document.Variant) VariantID
- func (c *Corpus) WordToID(rStr string) RootID
- type DocID
- type DocIDer
- type Document
- type Documents
- type RootID
- type VariantID
Constants ¶
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Corpus ¶
type Corpus struct { Splitter func(string) (string, []string) RootVariant func(str string) (string, document.Variant) Root func(str string) string // contains filtered or unexported fields }
Corpus holds a collection of documents for text indexing. It fulfills document.Encoder and document.Decoder.
func (*Corpus) Containing ¶
Containing returns a prefix.Nodes for all nodes containing the given gram.
func (*Corpus) IDToVariant ¶
IDToVariant converts a VariantID to a document.Variant, fulfilling document.Decoder.
func (*Corpus) VariantToID ¶
VariantToID converts a root word to a VariantID, fulfilling document.Encoder.
type DocIDer ¶
type DocIDer interface {
ID() DocID
}
DocIDer allows anything that can reference a DocID to be used to retreive a document.
type Document ¶
type Document struct { DocID *document.Document[RootID, VariantID] // contains filtered or unexported fields }
Document uses a Corpus to fulfill Encoder and Decoder for document.Document.
Click to show internal directories.
Click to hide internal directories.