⬅ Back to Home

Tweet Generator

In the fall of 2019, I took a class called CS 1.2 Intro to Data Structures. The final project was to construct a sentence generator of sorts, utilizing a Markov chain to generate tweets based on the existing corpus of a particular person’s speech. I wrote the program in Python, utilizing the different data structure manipulation techniques I learned such as hashtables, linked lists and binary search methods. The program takes adjustable parameters including corpuses of any length, as well as the amount of characters/words/sentences needed to be generated.

Below is a snippet of the code that implements the concepts of a Markov chain. The full code can be found on my repo here.