View Source on GitHub
Are your assignment questions too comprehensible? Run them through this filter and you can rest assured that no one will know what you're talking about anymore!
Made for TerribleHack 4, inspired by the only course to print a few formulas on a formula sheet mirrored and others not.
How it works
The program loads in a parts-of-speech dictionary from http://wordlist.aspell.net. It parses the text file and creates separate lists for each type of word. Then, sentences are split on spaces and the type of each word is identified (including multiple types for words that could be nouns, verbs, etc based on context.)
The tokenized sentence is run through a context-free grammar I made for a subset of English to create a syntax tree of the parts of speech.
It will then try to make the sentence more ambiguous by:
- removing the object of a verb phrase sometimes
- turning nouns into various people's names
- deciding the subject of a sentence can probably be replaced by "thing"
- switching the subject and object and hoping for the best
- Mirroring the text visually
- Referencing "Figure n" instead of an actual value
The parsing is done using Perl 6 Grammars and the web server runs on the Web::App::Ballet module.