示例#1
0
 def recognize_entity(self, string):
     result = []
     words = string.lower().split()
     for contact in CONTACT_NUMBERS.keys():
         if contact.lower() in words:
             recognized_entity = {
                 "sort": "contact",
                 "grammar_entry": contact
             }
             result.append(recognized_entity)
     return result
示例#2
0
 def is_valid(self, selected_contact):
     number = CONTACT_NUMBERS.get(selected_contact)
     if number:
         return True
     return False
示例#3
0
 def perform(self, selected_contact):
     number = CONTACT_NUMBERS.get(selected_contact)
     number_entity = {
         "grammar_entry": number
     }
     return [number_entity]
示例#4
0
 def perform(self, selected_contact):
     number = CONTACT_NUMBERS.get(selected_contact)
     # TODO: Implement calling
     success = True
     return success