forked from edooley7/dsp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmarkov.py
executable file
·15 lines (9 loc) · 940 Bytes
/
markov.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/usr/bin/env python
# Write a Markov text generator, [markov.py](python/markov.py). Your program should be called from the command line with two arguments: the name of a file containing text to read, and the number of words to generate. For example, if `chains.txt` contains the short story by Frigyes Karinthy, we could run:
# ```bash
# ./markov.py chains.txt 40
# ```
# A possible output would be:
# > show himself once more than the universe and what I often catch myself playing our well-connected game went on. Our friend was absolutely correct: nobody from the group needed this way. We never been as the Earth has the network of eternity.
# There are design choices to make; feel free to experiment and shape the program as you see fit. Jeff Atwood's [Markov and You](http://blog.codinghorror.com/markov-and-you/) is a fun place to get started learning about what you're trying to make.
> REPLACE THIS TEXT WITH YOUR PROGRAM