Remove Special Characters

Sometimes, words may contain unwanted special characters, which aren't specifically listed in the wordlist. In such cases, you can use the remove_special method to remove special characters from a word. This is useful when you don't want to specify a check yourself and replace every single special character, since you can do that with just one line of code.

This method covers most of the special characters out there, but not all of them. If you ever run into a situation where some special characters are not removed, please submit an issue on our GitHub repository and we'll make sure to add it to the list as soon as possible.

from lesp import Proofreader

proofreader = Proofreader()

word = "hello!"
word = proofreader.remove_special(word)

print(word)

Last updated