I am looking for the best way to correct potential misspells for words in a string, without taking the punctuation into account. I do not want to strip it before doing that evaluation as this would alter the final edited string. My current approach uses py-enchant (.check() method) after having splitted the string on whitespaces, but this will not ignore punctuation.
misspelled_string = 'This is a (tesl strung.'
Desired output :
corrected_string = 'This is a (test string.'
Try splitting by anything that is not a letter, with
re:Output: