Generate random texts based on a collection of tweets, using Markov Chains. This example uses tweets from Donald Trump (@realdonaldtrump), which were downloaded from here. Just a little fun ;)
Files need to be stored in the 'tweets' subfolder.
Run generate_dict.py to generate the dictionary of word pairs
Run random_text.py using the following parameters:
-wp or --wordpair, a pair of words to using as the starting point for the text. Example: -wp The President
-l or --length, the max number of words that should be generated
-d or --dict, the dictionary file to use. Defaults to dict.json
Input: python random_text.py -wp President Obama -l 25
Result: President Obama & Democrat leaders did a nasty cartoon attacking @tedcruz kids Bad