Documentation ¶
Index ¶
- Constants
- type Chain
- func (c *Chain) Add(msg string) error
- func (c *Chain) AddLink(start, end string, count int) error
- func (c *Chain) Close()
- func (c *Chain) Load(filename string) error
- func (c *Chain) Optimize() error
- func (c *Chain) Predict(prompt string) (string, bool)
- func (c *Chain) Reset() error
- func (c *Chain) Write(entry LinkEntry) error
- type LinkEntry
- type Probability
Constants ¶
View Source
const ( Starter = "SOS" // StartOfSentence Ender = "EOS" // EndOfSentence )
View Source
const MaxLoops = 50
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Chain ¶
type Chain struct { Links map[string]*Probability // map[word]possible words // contains filtered or unexported fields }
type Probability ¶
func NewProbability ¶
func NewProbability() *Probability
func (*Probability) AddWord ¶
func (p *Probability) AddWord(word string, count int)
func (*Probability) Predict ¶
func (p *Probability) Predict() string
Click to show internal directories.
Click to hide internal directories.