MSCI Filter

July 23, 2016

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 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.

A trace of the grammar trying to match an input sentence.

It will then try to make the sentence more ambiguous by:


The parsing is done using Perl 6 Grammars and the web server runs on the Web::App::Ballet module.