summaryrefslogtreecommitdiff
path: root/profanity_filter.py
diff options
context:
space:
mode:
authorScott Gasch <[email protected]>2021-09-28 23:27:51 -0700
committerScott Gasch <[email protected]>2021-09-28 23:27:51 -0700
commit986d5f7ada15e56019518db43d07b76f94468e1a (patch)
treeac3460a13667ac3dc8aa1e84c6b4fc8cfee648dc /profanity_filter.py
parent0bc6e4312cad0f997751739e750954ac39dfa6cc (diff)
Various changes
Diffstat (limited to 'profanity_filter.py')
-rwxr-xr-xprofanity_filter.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/profanity_filter.py b/profanity_filter.py
index e1b4743..f238e7d 100755
--- a/profanity_filter.py
+++ b/profanity_filter.py
@@ -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