Documentation ¶
Index ¶
- Constants
- type Chain
- func (chain *Chain) Add(input []string)
- func (chain *Chain) Generate(current NGram) (string, error)
- func (chain *Chain) GenerateDeterministic(current NGram, prng PRNG) (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 PRNG
- 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) GenerateDeterministic ¶
GenerateDeterministic generates new text deterministically, based on an initial seed of words and using a specified PRNG. Use it for reproducibly pseudo-random results (i.e. pass the same PRNG and same state every time).
func (*Chain) TransitionProbability ¶
TransitionProbability returns the transition probability between two states
Click to show internal directories.
Click to hide internal directories.