diff --git a/files/helpers/regex.py b/files/helpers/regex.py index 1a3871716..1f82ef06c 100644 --- a/files/helpers/regex.py +++ b/files/helpers/regex.py @@ -69,7 +69,7 @@ torture_regex = re.compile('(^|\s)(i|me)($|\s)', flags=re.I|re.A) torture_regex2 = re.compile("(^|\s)(i'm)($|\s)", flags=re.I|re.A) torture_regex3 = re.compile("(^|\s)(my|mine)($|\s)", flags=re.I|re.A) -sentence_ending_regex = re.compile('(\.|\?|\!)', flags=re.I|re.A) +sentence_ending_regex = re.compile('(\.)', flags=re.I|re.A) normal_punctuation_regex = re.compile('(\"|\')', flags=re.I|re.A) more_than_one_comma_regex = re.compile('\,\,+', flags=re.I|re.A) diff --git a/files/helpers/sanitize.py b/files/helpers/sanitize.py index 358290e79..a42149e81 100644 --- a/files/helpers/sanitize.py +++ b/files/helpers/sanitize.py @@ -689,11 +689,11 @@ def torture_ap(string, username): def torture_misogynist(string, key): if not string: return string string = string.lower() - string = sentence_ending_regex.sub(",", string) + string = sentence_ending_regex.sub(", and", string) string = normal_punctuation_regex.sub("", string) string = more_than_one_comma_regex.sub(",", string) - if string[-1] == ',': - string = string[0:-1] + if string[-5:] == ', and': + string = string[:-5] girl_phrase = GIRL_PHRASES[key%len(GIRL_PHRASES)] string = girl_phrase.replace("$", string) return string