Closed abelsonlive closed 11 years ago
Ah, I see what the problem is here. You don't seem to have write access to wherever MarkovChain.py is sitting. This results in the database generated from the given string not being saved to disk.
When you're trying to generate a string from this, it's thus forced to use an empty database, which (obviously) doesn't yield any strings. I'll adjust the example so it works. For now, try giving the MarkovChain
another parameter specifying a path to where it should store its database file (to a place where you have the necessary privileges). Like this:
from pymarkovchain import MarkovChain
mc = MarkovChain("./markov")
mc.generateDatabase("This is another string of Text. It's automatically separated at question marks, periods, newlines and exclamation marks. This can be changed by giving generateDatabase an optional sentenceSep parameter")
mc.generateString()
When I run your example code:
I get the following error: