Markov Chaining at 3 AM

You know those nights when you get an idea just as you’re going to bed, and it’s a fight to decide whether to try and sleep or to get up and see if you can get it working?  Tonight I had one of those ideas.  Specifically, I was thinking about creating a Markov Chain text generator where the corpus was all the emails I’d written since 1996.  Then you’d be able to load that page and see something pop out that would be somehow, kind-of, maybe like an email I would write.

Well, it turns out getting just the text you’ve typed in email is really hard, because it’s mixed in with all kinds of replies and cut and paste and signatures… suffice to say, it wasn’t going to work without some heavy manual editing.  Thankfully, it turns out I have a pretty good source of prose in the posts I made to The WELL since joining in 1997.  A few extract commands later, some python magic from shabada, and voila:

Markov Kramer

Leave a Reply