diff --git a/mycroft/skills/mycroft_skill/mycroft_skill.py b/mycroft/skills/mycroft_skill/mycroft_skill.py index 67bfac529f8a..4f331e27b6a5 100644 --- a/mycroft/skills/mycroft_skill/mycroft_skill.py +++ b/mycroft/skills/mycroft_skill/mycroft_skill.py @@ -1168,9 +1168,8 @@ def register_vocabulary(self, entity, entity_type): entity: word to register entity_type: Intent handler entity to tie the word to """ - self.bus.emit(Message('register_vocab', { - 'start': entity, 'end': to_alnum(self.skill_id) + entity_type - })) + keyword_type = to_alnum(self.skill_id) + entity_type + self.intent_service.register_adapt_keyword(keyword_type, entity) def register_regex(self, regex_str): """Register a new regex. diff --git a/test/unittests/skills/test_mycroft_skill.py b/test/unittests/skills/test_mycroft_skill.py index 0af99abf2899..bc60ca5c90a7 100644 --- a/test/unittests/skills/test_mycroft_skill.py +++ b/test/unittests/skills/test_mycroft_skill.py @@ -303,7 +303,14 @@ def test_register_vocab(self): # Normal vocaubulary self.emitter.reset() - expected = [{'start': 'hello', 'end': 'AHelloKeyword'}] + expected = [ + { + 'start': 'hello', + 'end': 'AHelloKeyword', + 'entity_value': 'hello', + 'entity_type': 'AHelloKeyword' + } + ] s.register_vocabulary('hello', 'HelloKeyword') self.check_register_vocabulary(expected) # Regex