示例#1
0
 def respond_from_waiting(self, message, tags):
     if emotion_word_found(message):
         # print(str(emotion_word_found(message)) + "\nfunction stuff: "+detect_emotion_phrase(message))
         self.emotion_response = detect_emotion_phrase(message)
         return self.go_to_state('emotion_detection')
     elif 'hi' in tags:
         if len(message) < 20:
             return self.go_to_state('hi')
         else:
             if emotion_word_found(message):
                 self.emotion_response = detect_emotion_phrase(message)
                 return self.go_to_state('emotion_detection')
     elif 'bye' in tags:
         return self.finish('success')
     else:
         return self.finish_confused()
示例#2
0
 def respond_from_emotion_detection(self, message, tags):
     if 'idk' in tags:
         return self.go_to_state('anecdote')
     elif emotion_word_found(message):
         # print(str(emotion_word_found(message)) + "\nfunction stuff: "+detect_emotion_phrase(message))
         self.emotion_response = detect_emotion_phrase(message)
         return self.go_to_state('emotion_detection')
     else:
         return self.go_to_state('tell_me_more')
示例#3
0
 def respond_from_suggestion(self, message, tags):
     if 'adv' in tags:
         return self.go_to_state('advice')
     elif emotion_word_found(message):
         self.emotion_response = detect_emotion_phrase(message)
         return self.go_to_state('emotion_detection')
     elif 'thanks' in tags:
         return self.finish('thanks')
     else:
         return self.go_to_state('feel_better_question')
示例#4
0
 def respond_from_tell_me_more(self, message, tags):
     if 'idk' in tags:
         return self.go_to_state('anecdote')
     elif 'adv' in tags:
         return self.go_to_state('advice')
     elif emotion_word_found(message):
         self.emotion_response = detect_emotion_phrase(message)
         return self.go_to_state('emotion_detection')
     else:
         return self.go_to_state('tell_me_more')