mirror of
https://github.com/wassname/Clover-Edition.git
synced 2026-09-12 12:04:39 +08:00
update
This commit is contained in:
@@ -157,8 +157,7 @@ class CTRLGenerator():
|
||||
if options is None:
|
||||
options = {}
|
||||
|
||||
if prompt[-2:] == ".I":
|
||||
prompt = prompt[:-1] + " I"
|
||||
prompt = prompt.replace(".I", ". I")
|
||||
|
||||
if prompt[-1] != " ":
|
||||
prompt = prompt + " "
|
||||
|
||||
+3
-3
@@ -6,7 +6,6 @@ YAML_FILE = "story/story_data.yaml"
|
||||
from profanityfilter import ProfanityFilter
|
||||
pf = ProfanityFilter()
|
||||
|
||||
|
||||
def get_story_start(key):
|
||||
with open(YAML_FILE, 'r') as stream:
|
||||
data_loaded = yaml.safe_load(stream)
|
||||
@@ -20,10 +19,11 @@ def get_action_verbs(key):
|
||||
|
||||
return data_loaded["action_verbs"][key]
|
||||
|
||||
# TODO add capital words to remove words
|
||||
|
||||
def remove_profanity(text):
|
||||
return pf.censor(text)
|
||||
|
||||
|
||||
def cut_trailing_quotes(text):
|
||||
num_quotes = text.count('"')
|
||||
if num_quotes % 2 is 0:
|
||||
@@ -36,7 +36,6 @@ def cut_trailing_quotes(text):
|
||||
def all_replace(text):
|
||||
text = first_to_second_person(text)
|
||||
text = text.replace("#","")
|
||||
|
||||
text = remove_profanity(text)
|
||||
|
||||
return text
|
||||
@@ -120,6 +119,7 @@ def capitalize_helper(string):
|
||||
|
||||
|
||||
def capitalize_first_letters(text):
|
||||
print("Text to capitalize is ", text)
|
||||
first_letters_regex = re.compile(r'((?<=[\.\?!]\s)(\w+)|(^\w+))')
|
||||
|
||||
def cap(match):
|
||||
|
||||
Reference in New Issue
Block a user