you have the following:this is an interesting text because this is what could be a more interesting text for us
When generating a text, given the pair of "last written words", you go into your table and select one of the successors; in most cases (at least in the example) you are forced to a get the single word in the list, but in others you can choose from more alternatives (2 in our case, in particular for the couples "this is" and "interesting text").this is => an, what (note: "this is" occurs two times) is an => interesting an interesting => text interesting text => because, for text because => this because this => is ("this is" has already been included above) is what => could ...
If you want to apply this mechanism to the letters, you can "simply" substitute "letter" to "word" in the program. This means hacking on the split in the foreach while taking into proper account newlines in the text (in the program, the newline is considered a "terminator", see $NONWORD). The implementation is left as an exercise, as it would not fit in the border of this reply :)
Flavio
perl -ple'$_=reverse' <<<ti.xittelop@oivalf
In reply to Re^5: How do I use this Markov generator?
by polettix
in thread How do I use this Markov generator?
by Philmac
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |