markov

package
v1.23.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 11, 2024 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StartToken = "^"
	EndToken   = "$"
)

Variables

This section is empty.

Functions

func Factory

Factory create a mask from a yaml config

Types

type Chain

type Chain struct {
	// contains filtered or unexported fields
}

func NewChain

func NewChain(orderValue int, randValue *rand.Rand, separatorValue string) Chain

func (*Chain) Add

func (chain *Chain) Add(input []string)

func (*Chain) Generate

func (chain *Chain) Generate(current NGram) (string, error)

type FrequencyMap

type FrequencyMap map[string]int
type Link struct {
	CurrentState NGram
	NextState    string
}

type MaskEngine

type MaskEngine struct {
	// contains filtered or unexported fields
}

func NewMask

func NewMask(seed int64, seeder model.Seeder, name, separator string, maxSize, order int) (MaskEngine, error)

NewMask create a MaskEngine with a seed

func (MaskEngine) Mask

func (mm MaskEngine) Mask(e model.Entry, context ...model.Dictionary) (model.Entry, error)

type NGram

type NGram []string

func (NGram) String

func (n NGram) String(separator string) string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL