def perform(self): out = [] for con in CONTACT_NUMBERS.keys(): number_entity = { "grammar_entry": con } out.append(number_entity) return out
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