Fix bug that censor was not censoring a slur if it was followed by '.' or ','
This commit is contained in:
parent
7ece47cba3
commit
6a350e8242
2 changed files with 5 additions and 4 deletions
|
@ -43,7 +43,7 @@ def create_slur_regex() -> Pattern[str]:
|
|||
"""Creates the regex that will find the slurs"""
|
||||
single_words = "|".join([slur.strip().lower() for slur in SLURS.keys()])
|
||||
|
||||
return re.compile(rf"(?i)(?<=\s|>)({single_words})(?=\s|<)")
|
||||
return re.compile(rf"(?i)(?<=\s|>)({single_words})(?=[\s<,.])")
|
||||
|
||||
|
||||
def create_replace_map() -> Dict[str, str]:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue