Workaround likely client bug in letter_compress. Update tests in bst.
[python_utils.git] / profanity_filter.py
index e1b474323fb67823a0c1607e69df08ec41b5398d..f238e7dbda085486f41483ca73ebdbe2b99569b3 100755 (executable)
@@ -484,12 +484,14 @@ class ProfanityFilter(object):
 
         if len(words) > 1:
             for bigram in string_utils.ngrams_presplit(words, 2):
+                bigram = ' '.join(bigram)
                 if self.is_bad_word(bigram):
                     logger.debug('"{bigram}" is profanity')
                     return True
 
         if len(words) > 2:
             for trigram in string_utils.ngrams_presplit(words, 3):
+                trigram = ' '.join(trigram)
                 if self.is_bad_word(trigram):
                     logger.debug('"{trigram}" is profanity')
                     return True