One of the most fascinating ideas I came across in my intro CS class at Berkeley was the variety of ways that the tree data structure can be used. One of them is in Natural Language Processing. This is a small project that takes in all of shakespeare’s text, categorizes each word into a type (like noun, verb, article, etc.), and creates random haiku poetry or sentences.

You can check out the project here

The real magic, in my opinion, however, is the phrase data abstraction. It was really cool to me how a every language, even English, can be broken down into syntax trees, following a certain logic.

You can check out the code here

Enjoy!