Documentation ¶
Index ¶
- type Ngram
- func (n *Ngram) Bytes() [32]byte
- func (n *Ngram) CalculateGrams()
- func (n *Ngram) Campbell4Hash() [32]byte
- func (n *Ngram) Campbell5Hash() [32]byte
- func (n *Ngram) NSpacedRareGrams(spacing, i int) []string
- func (n *Ngram) NthFrequentGram(i int) string
- func (n *Ngram) NthRareGram(i int) string
- func (n *Ngram) Sentence() string
- func (n *Ngram) String() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Ngram ¶
type Ngram struct {
// contains filtered or unexported fields
}
Ngram is a struct for holding an ngram defined by the New() function below
func (*Ngram) CalculateGrams ¶
func (n *Ngram) CalculateGrams()
CalculateGrams will count and order the ngrams if they haven't been ordered yet, filling in the appropriate fields in the Ngram struct
func (*Ngram) Campbell4Hash ¶
func (*Ngram) Campbell5Hash ¶
func (*Ngram) NSpacedRareGrams ¶
NSpacedRareGrams will return the i rarest ngrams that are at least spacing edit distance apart from each other
func (*Ngram) NthFrequentGram ¶
NthFrequentGram will return the ith most frequent ngram. For instance if the most frequent ngrams were ['asdf', 'sdfg', 'dfgh', ...] then NthFrequentGram(0) == 'asdf'
func (*Ngram) NthRareGram ¶
NthFrequentGram will return the ith least frequent ngram. For instance if the most frequent ngrams were [..., 'asdf', 'sdfg', 'dfgh'] then NthRareGram(0) == 'dfgh'