Skip to content

Instantly share code, notes, and snippets.

View abachman's full-sized avatar
🙌
good times

Adam Bachman abachman

🙌
good times
View GitHub Profile
@Eckankar
Eckankar / MarkovWord.py
Created April 8, 2010 15:56 — forked from agiliq/gist:131679
Generate random words based on markov chains rather than random sentences.
#!/usr/bin/env python
import random
class Markov:
def __init__(self, file, size):
self.size = size
self.starts = []
self.cache = {}
self.file_to_words(file)
self.parse_words()