fix last commit
parent
7f17b2eaa8
commit
e2629bc523
|
@ -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()])
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue