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
- Host: GitHub
- URL: https://github.com/tehcyx/gomarkov
- Owner: tehcyx
- License: apache-2.0
- Created: 2018-07-16T23:08:36.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2018-07-17T00:06:49.000Z (about 8 years ago)
- Last Synced: 2024-09-23T09:10:07.919Z (almost 2 years ago)
- Topics: go, golang, markov, markov-chain
- Language: Go
- Size: 20.5 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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, "")
```