Inspiration

I wanted to add a little bit of fun to coding, and emphasize the importance of good manners!

What it does

PoliteThon analyzes the program to be run and compares the number of kind words and phrases (eg please, thank you) to mean words and phrases (eg f*k, s*t). This ratio, which is then compared to the total length of the code, determines how the program will be run -- if at all! PoliteThon will refuse to run rude code, run kind code normally, and will slow down code that is not explicitly mean but also not kind enough.

How I built it

PoliteThon is written entirely in Python. As a proof of concept, the first prototype of PoliteThon used a polite/rude word detection method that I created from scratch. After this was implemented, I was able to transition to using an open source Python profanity detector that allows for more nuanced and accurate analysis of the code.

Challenges I ran into

Coming in with little knowledge the structure of programming languages, and even less about the operation of interpreters, I had to do a lot of learning on the spot! Integrating the profanity detector also came with some challenges, especially dealing with Python 2/3 compatibility troubles.

Accomplishments that I'm proud of

I am proud of the fact that I was able to finish a prototype of my idea while working by myself, and while having multiple other commitments throughout the day that I had to stop coding to attend.

What I learned

I learned a lot about natural language processing and the difficulties that it brings with it!

What's next for PoliteThon

I would like to completely restructure PoliteThon such that it is an entire reworking of Python builtin functions and keywords requiring kind words, rather than an interpreter that runs vanilla Python based on certain conditions. This is the idea that I originally came in wanting to do, but due to my time constraint and inexperience working in Python's source code I decided that the interpreter approach was a more realistic goal.

Built With

Share this project:

Updates