Dynamically Switch Wordlists

By default, the Proofreader class runs load_wordlist() when initialized. However, this method is also accessible out of the class. This method loads the wordlist from the specified path. This might help you a lot if you want to switch wordlists without having to initialize a new Proofreader, or even worse, having to restart your program.

from lesp import Proofreader

# Initialize a Proofreader
proofreader = Proofreader() # Loads the wordlist it has by default

# Change the wordlist file
proofreader.wordlist_path = "wordlist4.txt"

# Load a wordlist
proofreader.load_wordlist()

The function will not return anything, but it will raise an error if the wordlist file is not found or if the wordlist file is not in the correct format.

Last updated