A simple Markov chain modeller and generator aimed for word and sentence generation.
Project description
Originally a proof of concept, I’ve used this in enough projects that I’ve decided to publish it tomake it easier to import. #Basic Use
Instantiate with m = markoff.Markov(seeds) where seeds is an iterable of sub-iterables. Each sub-iterable being a chain in the set of chains you want to model.
You can supply it with just one chain or many.
Then use m.generate(max_length=100) to produce a single chain limited to max_length automatically terminating at any character of .!?. You can also supply a terminators argument to make the chain
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pymarkoff-0.1.0.tar.gz
(3.2 kB
view hashes)