A script for parsing Rusty Quill scripts to determine the amount of profanity. The code will separate the script into the following groups, and provide results for each individual section as well as overall:
| Group Type | Description |
|---|---|
| episode_info | The text describing the episode / cast / editors |
| content_warnings | The text describing the content warnings |
| scenes | The text describing the current scene |
| actions | The text describing actions / non-dialogue sounds |
| CHARACTER | One field for each character. Contains all of their dialogue for the episode. |
Currently, the code only words for The Magnus Archives and Inexplicables scripts. Stella Firma scripts are in an entirely different format, so unfortunately the code cannot parse those.
In addition, the code relies on the script format shown in the more recent episodes, so may fail for older script files.
After cloning the reposity locally, there are two ways of installing the dependencies:
- If you have not installed poetry before, following the instructions here.
- In the git folder, run
poetry install
pip3 install -r requirements.txt
- Download script .docx file from Rusty Quill's Patreon.
- Run the script using the following command:
python3 swear_counter.py --script /path/to/script/docx
By default, the code will output the profanity results to the command line.
| Argument | Description |
|---|---|
--script |
Path to the script .docx file taken from Rusty Quill's Patreon |
| Argument | Description |
|---|---|
--parse_all |
Parses episode information, scene, and action text in addition to dialogue |
| Argument | Description |
|---|---|
--working_dir |
Working directory for saving results; default current directory |
--save_profanity_results |
Saves .txt file containing profanity results, both overall and separated by text type (e.g. dialogue for each character, episode information, etc.) |
--save_parsed_dict |
Saves dictionary of parsed script data; separates text by dialogue for each character, episode information, content warnings, scene descriptions, and action/sound tags |
--save_profanity_dict |
Saves dictionary of profanity data; separates text by dialogue for each character, episode information, content warnings, scene descriptions, and action/sound tags |