Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MarkovChain ¶
type MarkovChain struct {
// contains filtered or unexported fields
}
MarkovChain stores the markov chain and is the main interface into the package.
func NewMarkovChain ¶
func NewMarkovChain(minWords int) *MarkovChain
NewMarkovChain returns a new MarkovChain that ignores any sentence passed to it with less than <minWords> words
func (*MarkovChain) Generate ¶
func (m *MarkovChain) Generate() string
Generate returns a generated sentence from the Markov chain
func (*MarkovChain) Train ¶
func (m *MarkovChain) Train(trainingText []string)
Train consumes the trainingText and updates the Markov chain accordingly
Click to show internal directories.
Click to hide internal directories.