Documentation ¶
Index ¶
- Constants
- type Chain
- func (chain *Chain) Add(input []string)
- func (chain *Chain) Generate(current NGram) (string, error)
- func (chain *Chain) GenerateAll() ([]string, error)
- func (chain Chain) MarshalJSON() ([]byte, error)
- func (chain *Chain) TransitionProbability(next string, current NGram) (float64, error)
- func (chain *Chain) UnmarshalJSON(b []byte) error
- type NGram
- type Pair
Constants ¶
View Source
const ( StartToken = "$" EndToken = "^" )
Tokens are wrapped around a sequence of words to maintain the start and end transition counts
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Chain ¶
type Chain struct { Order int // contains filtered or unexported fields }
Chain is a markov chain instance
func (*Chain) GenerateAll ¶
GenerateAll generates whole chain of text from scratch.
func (*Chain) TransitionProbability ¶
TransitionProbability returns the transition probability between two states
Click to show internal directories.
Click to hide internal directories.