greentext

pull/156/head
Chuck Sneed 2023-06-21 20:52:48 -05:00
parent 33cc2004ab
commit 23c8d5d578
2 changed files with 5 additions and 0 deletions

View File

@ -82,6 +82,7 @@ like_before_regex = re.compile('(?<=^|(?<=\s))(?<!like )(just|only)(?=$|\n|\s|[.
like_after_regex = re.compile('(?<=^|(?<=\s))(i mean)(?! like)(?=$|\n|\s|[.?!,])', flags=re.I|re.A)
#match ! or ? but only if it isn't touching another ! or ?, or is in front of a letter
single_repeatable_punctuation = re.compile('(?<!!|\?)(!|\?)(?!!|\?)(?=\s|$)', flags=re.I|re.A)
initial_part_regex = re.compile('(?<=^)(>+)', flags=re.I|re.A)
image_check_regex = re.compile(f'!\[\]\(((?!(https:\/\/({hosts})\/|\/)).*?)\)', flags=re.A)

View File

@ -688,7 +688,10 @@ def torture_ap(string, username):
def torture_queen(string, key):
if not string: return string
result = initial_part_regex.search(string)
initial = result.group(1) if result else ""
string = string.lower()
string = initial_part_regex.sub("", string)
string = sentence_ending_regex.sub(", and", string)
string = superlative_regex.sub(r"literally \g<1>", string)
string = totally_regex.sub(r"totally \g<1>", string)
@ -702,6 +705,7 @@ def torture_queen(string, key):
string = string[:-5]
girl_phrase = GIRL_PHRASES[key%len(GIRL_PHRASES)]
string = girl_phrase.replace("$", string)
string = initial + string
return string
def torture_object(obj, torture_method):