Chinese proverb/Monty Python insult generator

I thought that the code required to construct a very static output message just with a few random words was a little easy, so I interpreted it a little more generally. I wanted to try and construct something more random than this, but I did run into problems. I’d say that the project took about four hours, but I spent a fair amount of time trying to track down lists of words. My project can be found here: https://github.com/tomharrison920/Random_message_generator

I edited a list of Chinese Proverbs to prep them to receive random words in place of some verbs, nouns, adjectives, numbers and time-periods (months, years etc) and I also put together a few insults in the style of my favourites from Monty Python. I also tried to access premade lists of verbs, nouns and adjectives to try and make the program more generalised.

I think generally it has worked ok, but I did run into some grammatical problems due to the different way tenses etc are handled in English. Generally the messages that are output make sense (and are often very funny), but if the wrong combination of words and sentence is put together, it comes out a bit like gobbledygook.

I would be interested to hear if anyone has any suggestions about: how I could have included a bigger dictionary of words; and a tidier way to deal with some of the grammatical exceptions I ran into.

Cheers

1 Like

Loved your project!!

I guess you’ve heard about NLTK! Might help you a ton with your dictionary and grammatical issues! Maybe you could generate some various forms of each word. Language really is a complicated thing. I’ve never heard of Chinese proverbs and how they structure, I think that the nature of Chinese lack of inflection is something to think about. I’m thinking of actually working on your code and trying to generate Chinese proverbs with Hanzi (Chinese characters) then translating it with some API, maybe DeepL.
Fetching a batch of words every time you run the code could also be something limiting but could also add some randomness and deal with the grammatical exceptions you ran into.