Skip to content

TehMillhouse/PyMarkovChain

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

48 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PyMarkovChain

PyMarkovChain supplies an easy-to-use implementation of a markov chain text generator.
To use it, you can simply do

from pymarkovchain import MarkovChain
# Create an instance of the markov chain, tell it where to load / save its database
mc = MarkovChain("./markov")
# generate the markov chain's language model
mc.generateDatabase("This is a string of Text. It won't generate an interesting database though.")
mc.generateString()

To store its data, PyMarkovChain simply uses pickle to dump all of its data to disk. This entails that you have to use the same version of python to store the data and to restore the data, as pickle is one of those things that have changed from python2 to python3.

See also code on github and PyPI page. To install, pip install PyMarkovChain

About

Simple markov chain implementation in python

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages