A simple Markov Chain text generator. Only the Python standard library is used, so all data structures and algorithms are implemented from scratch. To extend this project, you could take into account the previous two words (or n words) to learn associations between longer sequences of words (the amount of data needed is exponenial to n).
Example:
Romeo
So thrive my grief: To-morrow will murder thee.
Romeo
Alack, there lies more strange, i must confess, but that hand, that i send me speak at thy company.
Romeo
And i'll no longer be a winged messenger of thee take all this yielding to myself, because it be morrow.
Exit above
Romeo
Sleep dwell upon thine eyes, peace in night so stumblest on my soul that vast shore wash'd with grief