Rhymatron – Markov Chain Update (4/09/2010)

After learning about word counting, ngrams, and markov chains, I’ve made some tweaks to the rhymatron script to produce a better output.

Now each word pairing is of two words that appear next to each other in natural language (and I increased the dictionary’s scope by expanding the source texts to include Alice in Wonderland and Moby Dick, in addition to Huckleberry Finn).  Still there is room for additional improvement, but the output is definitely one step closer to passing a Turing test.

Here is a link to the updated code.

And here is one example of the improved output:

guile thronged, overtaking, dipped bores, this twists,
prints paw, legs fills, pangs slicked, path sin,
edge ann, blanche lip, sophia amidst,
correspondents begin, indignity by.
spliced bors, figurative, mince froth, slit wilks,
hit ward, trim fins, stirred twists, blanc lip,
mouths mat, calf whips, worshippers cashier,
disagreement exist, circulation i.
pikes pours, gentlemanly, lids yore, lives inn,
tricked loft, grit lear, sleeps crib, dat chill,
purge van, crab slipped, whoever sincere,
discouraging wherein, malefactors stile.
time more, insensible, clipped hauled, jim string,
licked tore, holes stings, foiled chips, wrap list,
that wrapped, act sings, perception begins,
dedication until, futility child.

guile thronged, overtaking, dipped bores, this twists,

prints paw, legs fills, pangs slicked, path sin,

edge ann, blanche lip, sophia amidst,

correspondents begin, indignity by.


spliced bors, figurative, mince froth, slit wilks,

hit ward, trim fins, stirred twists, blanc lip,

mouths mat, calf whips, worshippers cashier,

disagreement exist, circulation i.


pikes pours, gentlemanly, lids yore, lives inn,

tricked loft, grit lear, sleeps crib, dat chill,

purge van, crab slipped, whoever sincere,

discouraging wherein, malefactors stile.


time more, insensible, clipped hauled, jim string,

licked tore, holes stings, foiled chips, wrap list,

that wrapped, act sings, perception begins,

dedication until, futility child.