What is Markov Content?
Some people don’t understand what “markov” content is. Basically it’s text that’s randomly regenerated to look like normal text, but since it’s automatically generated, it probably won’t make sense to a normal human. It is a method for defeating bayesian filters, and it’s a method for generating lots of “random” content.
Markov content is a quick way to turn this:
SONNET 116 Let me not to the marriage of true minds Admit impediments. Love is not love Which alters when it alteration finds, Or bends with the remover to remove: O no! it is an ever-fixed mark That looks on tempests and is never shaken; It is the star to every wandering bark, Whose worth's unknown, although his height be taken. Love's not Time's fool, though rosy lips and cheeks Within his bending sickle's compass come: Love alters not with his brief hours and weeks, But bears it out even to the edge of doom. If this be error and upon me proved, I never writ, nor no man ever loved.
Into this:
Love is not with his height be error and weeks, But bears it alteration finds, Or bends with his height be taken. Love's not to the star to the remover to remove: O no! it alteration finds, Or bends with his brief hours and weeks, But bears it is the star to the marriage of doom. If this be taken. Love's not to every wandering bark, Whose worth's unknown, although his bending sickle's compass come: Love alters not Time's fool, though rosy lips and upon me not Time's fool, though rosy lips and upon me not love Which alters not Time's fool, though rosy lips and upon me not Time's fool, though rosy lips and weeks, But bears it alteration finds, Or bends with the star to the star to the remover to the marriage of doom. If this be error and is not to.
Here’s an example of a markov function written in php, taken from a popular automatic site-building tool.
function markov($source) {
$min = 100;
$max = 350;
$words = explode(" ", $source);
$nonword = $words[count($words)-1];
$w1 = $nonword;
foreach($words as $word) {
$wordpairs[$w1][] = $word;
if (strpos($w1, ".") === strlen($w1)-1) $capitals[] = $w1;
$w1 = $word;
}
$nw=rand($min,$max);
$tt = array_rand($capitals);
$nonword = $capitals[$tt];
$w1 = $nonword;
$output="";
for($i = 0; $i <$nw; $i++) {
$suf = $wordpairs[$w1];
$t = array_rand($suf);
$ttt = $suf[$t];
if(rand(1,5)==3) $ttt = preg_replace("/\./", ".\n\n", $ttt);
$output .= $ttt." ";
$w1 = $suf[$t];
}
$output = trim($output) . ".";
return $output;
}
