Skip to content
This repository has been archived by the owner on Sep 8, 2024. It is now read-only.

Commit

Permalink
Use IntentServiceInterface in MycroftSkill.register_vocabulary()
Browse files Browse the repository at this point in the history
This moves the message logic for adapt keyword registration into a single location.
  • Loading branch information
forslund committed Aug 2, 2021
1 parent a1f9bd5 commit e4b13de
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions mycroft/skills/mycroft_skill/mycroft_skill.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit e4b13de

Please sign in to comment.