Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GenerateOption ¶
type GenerateOption func(*generateOptions)
GenerateOption is used to configure a Markov chain's generation settings.
func WithFilter ¶
func WithFilter(fn func(*Result) bool) GenerateOption
WithFilter sets the filter used for generation.
func WithMaxTries ¶
func WithMaxTries(mt int) GenerateOption
WithMaxTries sets the allotted number of attempts for a generation.
func WithPRNG ¶
func WithPRNG(fn func() int) GenerateOption
WithPRNG sets the pseudo-random number generator used for generation.
type Markov ¶
type Markov struct {
// contains filtered or unexported fields
}
Markov represents a Markov chain which can be trained and used to generate sentences.
type Option ¶
type Option func(*Markov)
Option is used to configure a Markov chain.
func WithStateSize ¶
WithStateSize sets the size of a Markov chain's state.
type Store ¶
type Store interface {
StartWords(context.Context) []*Fragment
SetStartWords(context.Context, []*Fragment)
EndWords(context.Context) []*Fragment
SetEndWords(context.Context, []*Fragment)
Corpus(context.Context) Corpus
SetCorpus(context.Context, Corpus)
Import(context.Context, *Structure)
Export(context.Context) *Structure
}
Click to show internal directories.
Click to hide internal directories.