Friday, October 3, 2014

New Harry Potter Books!

Oh my gosh I have to share this with the world immediately!  I was just looking at the website for Robert Clouth, the musician who created the soundtrack for the Boots and Cats video, which is enough awesome to last for many years by itself.  He has created a Harry Potter Book Generator so that whenever you want, you can have your own brand new Harry Potter book to read!  Here's what he has to say about its creation: 
"Immediately after hearing that JK wasn’t going to write any more Harry Potter books I vomited with disappointment, then shortly after started working on a Harry Potter book generator. I toyed with a couple of ways of doing this (like using a natural language sentence parser to swap out the sentence subjects) but as usual, the simpler methods tend to be the best (if only because they’re quicker to implement and so I can finish them before getting bored and moving on the something else) and ended up using Markov chains. The basic technique is to scan the source texts and for every three word triplet build up a list of the words that follow it every time that triplet pops up. To generate text you start with a seed triplet picked at random, then randomly select a word from the list of following words that you built earlier. This new word becomes part of the next triplet and the cycle continues. There were a couple of minor challenges I had to overcome – for example I had to analyse conversation separately to avoid it slipping into non-conversation mid sentence – but generally the technique works alright. There are some quirks with the method, like how it only has 3 word continuity so sometimes forgets who or what it’s talking about…but that just adds to the LOLs I reckon. The great thing about it is you can throw any collection of books into the pot and it’ll factor them all in. One crackin’ combo is Harry Potter and Mein Kampf (Hermione occasionally goes on a half-page anti-Semitic rant before slipping seamlessly back into blabbering about the Triwizard tournament) . The next one I want to try is the Bible and 50 Shades of Grey for obvious reasons."
Isn't technology wonderful?

No comments: