Functions | |
| def | load_regex (basedir, bus, skill_id) |
| def | load_regex_from_file (path, bus, skill_id) |
| def | load_vocab_from_file (path, vocab_type, bus) |
| def | load_vocabulary (basedir, bus, skill_id) |
| def | munge_intent_parser (intent_parser, name, skill_id) |
| def | munge_regex (regex, skill_id) |
| def | read_vocab_file (path) |
| def | to_alnum (skill_id) |
| def mycroft.skills.skill_data.load_regex | ( | basedir, | |
| bus, | |||
| skill_id | |||
| ) |
Load regex from all files in the specified directory.
Args:
basedir (str): path of directory to load from
bus (messagebus emitter): messagebus instance used to send the vocab to
the intent service
skill_id (str): skill identifier
Definition at line 107 of file skill_data.py.
| def mycroft.skills.skill_data.load_regex_from_file | ( | path, | |
| bus, | |||
| skill_id | |||
| ) |
Load regex from file
The regex is sent to the intent handler using the message bus
Args:
path: path to vocabulary file (*.voc)
bus: Mycroft messagebus connection
Definition at line 72 of file skill_data.py.
| def mycroft.skills.skill_data.load_vocab_from_file | ( | path, | |
| vocab_type, | |||
| bus | |||
| ) |
Load Mycroft vocabulary from file
The vocab is sent to the intent handler using the message bus
Args:
path: path to vocabulary file (*.voc)
vocab_type: keyword name
bus: Mycroft messagebus connection
skill_id(str): skill id
Definition at line 50 of file skill_data.py.
| def mycroft.skills.skill_data.load_vocabulary | ( | basedir, | |
| bus, | |||
| skill_id | |||
| ) |
Load vocabulary from all files in the specified directory.
Args:
basedir (str): path of directory to load from (will recurse)
bus (messagebus emitter): messagebus instance used to send the vocab to
the intent service
skill_id: skill the data belongs to
Definition at line 91 of file skill_data.py.
| def mycroft.skills.skill_data.munge_intent_parser | ( | intent_parser, | |
| name, | |||
| skill_id | |||
| ) |
Rename intent keywords to make them skill exclusive
This gives the intent parser an exclusive name in the
format <skill_id>:<name>. The keywords are given unique
names in the format <Skill id as letters><Intent name>.
The function will not munge instances that's already been
munged
Args:
intent_parser: (IntentParser) object to update
name: (str) Skill name
skill_id: (int) skill identifier
Definition at line 148 of file skill_data.py.
| def mycroft.skills.skill_data.munge_regex | ( | regex, | |
| skill_id | |||
| ) |
Insert skill id as letters into match groups.
Args:
regex (str): regex string
skill_id (str): skill identifier
Returns:
(str) munged regex
Definition at line 135 of file skill_data.py.
| def mycroft.skills.skill_data.read_vocab_file | ( | path | ) |
Read voc file.
This reads a .voc file, stripping out empty lines comments and expand
parentheses. It retruns each line as a list of all expanded
alternatives.
Arguments:
path (str): path to vocab file.
Returns:
List of Lists of strings.
Definition at line 28 of file skill_data.py.
| def mycroft.skills.skill_data.to_alnum | ( | skill_id | ) |
Convert a skill id to only alphanumeric characters
Non alpha-numeric characters are converted to "_"
Args:
skill_id (str): identifier to be converted
Returns:
(str) String of letters
Definition at line 122 of file skill_data.py.