fix last commit

pull/157/head
Aevann 2023-06-24 18:01:22 +03:00
parent 7f17b2eaa8
commit e2629bc523
2 changed files with 8 additions and 1 deletions

View File

@ -417,6 +417,13 @@ PROFANITIES = {
'peacock': 'peapeepee',
}
PROFANITIES_FOR_REPLACING = {}
for k, val in PROFANITIES.items():
newkey = k.split('(?!')[0]
if ')' in newkey:
newkey = newkey.split(')')[1]
PROFANITIES_FOR_REPLACING[newkey] = val
slur_single_words = "|".join([slur.lower() for slur in SLURS.keys()])
profanity_single_words = "|".join([profanity.lower() for profanity in PROFANITIES.keys()])

View File

@ -152,7 +152,7 @@ def sub_matcher_slurs_upper(match):
return sub_matcher_slurs(match, upper=True)
def sub_matcher_profanities(match, upper=False):
return sub_matcher(match, upper, replace_with=PROFANITIES)
return sub_matcher(match, upper, replace_with=PROFANITIES_FOR_REPLACING)
def sub_matcher_profanities_upper(match):
return sub_matcher_profanities(match, upper=True)