Repeat Phrase Counter

This script lets you count literal repetition of words in a text.

Usage

  1. Copy this code to a python editor or pull this repo from GitHub

  2. Copy your text into Notepad (or similar) and save as a *.txt file

  3. In the first few lines input the correct parameters for:

    • filename: the name of the *.txt file (or the full path if the file is in a different folder than this script)
    • phrase_length: the number of words in a row to check for
    • threshold_count: the minimum number of times that the phrase has to occur to be part of the output
  4. Run the code

  5. Open the resulting *.csv file in Excel (or similar) and sort by column B