This commit is contained in:
Nick
2019-10-31 03:03:07 -06:00
parent c4598e5b45
commit 074f34f4dd
2 changed files with 14 additions and 3 deletions
+1 -1
View File
@@ -213,7 +213,7 @@ class CTRLStoryManager(ConstrainedStoryManager):
for phrase in self.action_phrases:
result = self.generate_action_result(self.story_context(), phrase, options=options)
action_verb = result[0].split()[1]
print("blacklisted verb is ", action_verb)
options["word_blacklist"][0].append(action_verb)
results.append(result)
return results
+13 -2
View File
@@ -188,5 +188,16 @@ def second_to_first_person(text):
return capitalize_first_letters(text[1:])
if __name__ == '__main__':
text = 'You wake up in an old rundown hospital with no memory of how you got there. You look around and see a nurse standing over me. "Hey buddy, you okay?" she asks. She looks at me like I\'m crazy. '
print(first_to_second_person(text))
result = 'The only thing they can tell you is, "We have nowhere else to…"'
result = result.replace('."', '".')
result = result.replace("#", "")
result = result.replace("*", "")
result = first_to_second_person(result)
result = remove_profanity(result)
while ("\n \n \n " in result):
result = result.replace("\n \n \n ", "\n \n ")
print(result)