fix bug with cat slur filter
parent
e1cf421133
commit
0cbcc6ba3f
|
@ -57,12 +57,12 @@ snappy_url_regex = re.compile('<a href="(https?:\/\/.+?)".*?>(.+?)<\/a>', flags=
|
|||
email_regex = re.compile('[A-Za-z0-9._%+-]{1,64}@[A-Za-z0-9.-]{2,63}\.[A-Za-z]{2,63}', flags=re.A)
|
||||
|
||||
slur_single_words = "|".join([slur.lower() for slur in SLURS.keys()])
|
||||
slur_single_words_title = slur_single_words.title().replace('!\W','!\w')
|
||||
slur_single_words_upper = slur_single_words.upper().replace('!\W','!\w')
|
||||
slur_single_words_title = slur_single_words.title().replace('\W','\w')
|
||||
slur_single_words_upper = slur_single_words.upper().replace('\W','\w')
|
||||
|
||||
profanity_single_words = "|".join([profanity.lower() for profanity in PROFANITIES.keys()])
|
||||
profanity_single_words_title = profanity_single_words.title().replace('!\W','!\w')
|
||||
profanity_single_words_upper = profanity_single_words.upper().replace('!\W','!\w')
|
||||
profanity_single_words_title = profanity_single_words.title().replace('\W','\w')
|
||||
profanity_single_words_upper = profanity_single_words.upper().replace('\W','\w')
|
||||
|
||||
slur_regex = re.compile(f"<[^>]*>|{slur_single_words}", flags=re.I|re.A)
|
||||
slur_regex_title = re.compile(f"<[^>]*>|{slur_single_words_title}", flags=re.A)
|
||||
|
|
Loading…
Reference in New Issue