this and this and this

pull/154/head
Chuck Sneed 2023-06-17 17:44:20 -05:00
parent ab0aa83ed2
commit a7930b80d4
2 changed files with 4 additions and 4 deletions

View File

@ -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)

View File

@ -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