An open API service indexing awesome lists of open source software.

https://github.com/tehcyx/gomarkov

Markov Chain in Go
https://github.com/tehcyx/gomarkov

go golang markov markov-chain

Last synced: 6 months ago
JSON representation

Markov Chain in Go

Awesome Lists containing this project

README

          

# Markov Chain
library for using Markov Chain in Go

# Usage
Create a dictionary:
```
dict := markov.TrainFromFolder("training", 10000000)
```

Adjust factors on the dictionary via builtin fitness function or roll your own:
```
dict = markov.BulkAdjustFactors(dict, 10000, []markov.FitnessFunc{markov.FitnessFunction})
```

Generate 20 words from dictionary (startword empty):
```
message := markov.Generate(dict, 20, "")
```