Looks like it doesn't handle the Scunthorpe Problem - http://tvtropes.org/pmwiki/pmwiki.php/Main/ScunthorpeProblem .
This approach is at least 20 years old. Others have worked on it. Try investigating one or more of https://github.com/topics/profanity .