Documentation ¶
Index ¶
Constants ¶
View Source
const BOLT_BUCKET = "markov"
Variables ¶
View Source
var ErrTableNotFound = errors.New("table not found")
Functions ¶
This section is empty.
Types ¶
type Accumulator ¶
func NewAccumulator ¶
func NewAccumulator(m *Model, order uint) *Accumulator
func (*Accumulator) Add ¶
func (acc *Accumulator) Add(symbol string) (err error)
type BoltTableStore ¶
func NewBoltTableStore ¶
func NewBoltTableStore(filePath string) (*BoltTableStore, error)
func (*BoltTableStore) Close ¶
func (ts *BoltTableStore) Close() error
func (*BoltTableStore) Get ¶
func (ts *BoltTableStore) Get(k SequenceKey, dest *Table) error
func (*BoltTableStore) Put ¶
func (ts *BoltTableStore) Put(k SequenceKey, table *Table) error
type Generator ¶
type Generator struct { Model *Model CurrentSequence Sequence SampleSource SampleSource }
func NewGenerator ¶
func NewGenerator(m *Model, order uint, s SampleSource) *Generator
type InMemoryTableStore ¶
type InMemoryTableStore struct {
TablesBySequence map[SequenceKey]*Table
}
func NewInMemoryTableStore ¶
func NewInMemoryTableStore() *InMemoryTableStore
func (*InMemoryTableStore) Get ¶
func (ts *InMemoryTableStore) Get(key SequenceKey, dest *Table) error
func (*InMemoryTableStore) Put ¶
func (ts *InMemoryTableStore) Put(key SequenceKey, table *Table) error
type Model ¶
type Model struct {
Tables TableStore
}
func NewModel ¶
func NewModel(store TableStore) *Model
type SampleSource ¶
type SampleSource interface {
Float64() float64
}
type Sequence ¶
type Sequence struct {
Symbols []string
}
func EmptySequence ¶
func SequenceWith ¶
func (Sequence) Key ¶
func (s Sequence) Key() SequenceKey
type SequenceKey ¶
type SequenceKey string
type Table ¶
type Table struct { TotalSymbols uint64 Entries []TableEntry EntryIndices map[string]int }
func EmptyTable ¶
func EmptyTable() Table
type TableEntry ¶
type TableStore ¶
type TableStore interface { Get(key SequenceKey, dest *Table) error Put(key SequenceKey, table *Table) error }
Click to show internal directories.
Click to hide internal directories.