Skip to content

Commit

Permalink
prevent duplicate entries in bad words list (#40)
Browse files Browse the repository at this point in the history
* fix minor bug

* update safetext version
  • Loading branch information
SeeknnDestroy committed Dec 21, 2023
1 parent e35f105 commit e0c2ffc
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions safetext/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

from safetext.utils import detect_language_from_srt, detect_language_from_text

__version__ = "0.0.6"
__version__ = "0.0.7"


class SafeText:
Expand Down Expand Up @@ -273,7 +273,8 @@ def get_bad_words(self, text: str = None, profanity_results: Optional[List[Dict]

bad_words = []
for profanity in profanity_results:
bad_words.append(profanity["word"])
if profanity["word"] not in bad_words:
bad_words.append(profanity["word"])

return bad_words

Expand Down

0 comments on commit e0c2ffc

Please sign in to comment.