I have the following code, which takes in a string and returns the individual words of the string minus any punctuation:
def word_split(quote):
return re.findall(r'\w+', quote.lower())
output: ['to', 'me', 'there', 'has', 'never', 'been', 'a', 'higher', 'source', 'of', 'earthly', 'honor', 'or', 'distinction', 'than', 'that', 'connected', 'with', 'advances', 'in', 'science', 'isaac', 'newton']
However, in certain instances, there are author names like J.K. Rowling where the code would split her name at the J and K. Is there a way I can re-write this code that wouldn't split those abbreviated names?