dmc

package
v0.0.0-...-5787e7a Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Compress

func Compress(fileContents []byte) []byte

func Decompress

func Decompress(fileContents []byte) []byte

func FindValueUpStack

func FindValueUpStack(lookFor byte, stack []MarkovChain) int

FindValueUpStack returns how far up the stack it should go to find the byte, len(stack) for not found

func GetBitsFromChain

func GetBitsFromChain(node *MarkovChain, input []byte, stack *[]MarkovChain) []int

func GetIndexOfNodeWithMoveUp

func GetIndexOfNodeWithMoveUp(moveUp int, nodes []MarkovChain) int

func GetIndexOfNodeWithValue

func GetIndexOfNodeWithValue(lookFor byte, nodes []MarkovChain) int

func GetOutputFromBits

func GetOutputFromBits(bits []int, node *MarkovChain, previousStack *[]MarkovChain) []byte

func NewReader

func NewReader(r io.Reader) io.Reader

func NewWriter

func NewWriter(w io.Writer) io.WriteCloser

func PrintMarkovChain

func PrintMarkovChain(chain *MarkovChain, indentation int)

func SortNodesByOccurrences

func SortNodesByOccurrences(chain *MarkovChain)

func UpwardTravels

func UpwardTravels(chain *MarkovChain) int

Types

type MarkovChain

type MarkovChain struct {
	Value       byte
	Nodes       *[]MarkovChain
	Occurrences int
	MoveUp      int
}

type Reader

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

func (*Reader) Close

func (r *Reader) Close() error

func (*Reader) Read

func (r *Reader) Read(content []byte) (n int, err error)

type Writer

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

func (*Writer) Close

func (writer *Writer) Close() error

func (*Writer) Write

func (writer *Writer) Write(data []byte) (n int, err error)

Jump to

Keyboard shortcuts

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