3 ms·
This reminds me of a Google exercise within their Python course, wherein it read in a text file and built dictionaries of every word and the words that followed
by AdmiralAsshat 11y ago
This reminds me of a Google exercise within their Python course, wherein it read in a text file and built dictionaries of every word and the words that followed said word in the text in order to create a prosaic style that mimed the author of the original text. It was quite interesting to run and throw a text file at it to see what it produced.
EDIT: I have a cached version of the exercise if anyone feels like looking at it:
https://github.com/AdmiralAsshat/learn_python/blob/master/google_code_university/basic/mimic.py https://github.com/AdmiralAsshat/learn_python/blob/master/go...
There should be an "alice.txt" in the same directory as a sample file to throw at it.
- deleted 11y ago[deleted]
- comex 11y agoSee also https://en.wikipedia.org/wiki/Markov_chain#Markov_text_generators https://en.wikipedia.org/wiki/Markov_chain#Markov_text_gener...