1 Your text
Try:
2 Settings
How many words to look back
3 Generate
How does it work?
- Split the text into words.
- Build the dictionary. For every word, write down the word that comes right after it. Repeats stay in, so a word that often comes next is more likely to be picked.
- Generate. Start with a word, look it up in the dictionary, pick a random word from its list, and repeat with the new word.
Looking back 1 word is a 1st-order Markov chain (a bigram model). Looking back 2 or 3 words makes the text sound more like the original, but it gets less creative.