Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Textillating (output: Extremely Great Expectations) #96
Ever wished the novel you were reading was way more exciting? Try Textillating it!
The user inputs a .txt file (like a novel), and my script outputs a modified version of the file wherein most adjectives have been replaced by their most extreme synonyms. In other words, the affect has been amped up.
This project uses the VADER sentiment analysis tools and WordNet from NLTK (Natural Language Tool Kit). The SentimentIntensityAnalyzer quantifies how affective a word is. Then the script checks for any synonyms from WordNet that have more extreme scores. So large might be replaced by great, and terrible might be replaced by abhorrent. If there are no viable synonyms, an intensifying adverb is added to modify the adjective.
I chose a book I never finished, Great Expectations, as my example. Is the output readable? Kind of! Does it have more extreme language and way more exclamation points? Definitely!!!!!!!!!
See my repo for the code and longer explanation with examples.
(Caveat for literary types who are offended that some might consider Dickens and the like boring: I'm a librarian who's made peace with her own reading preferences and feels very relieved not to have to read all 1000 classic novels in the Western canon. Unless they've been Textillated, of course.)