Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I've picked up the discussion from #504 and #361 with the implementation from
#134. Here's a first implementation intented for discussion.
Rationale
Jasper currently leaves it to the speechhandling plugins how they are extracting the intent from the phrase or keywords. Most plugins just use simple keyword searching. To improve Jasper this should be more sophisticated or at least be able to improve later one. Currently this is blocked because each plugins implements its own way and thus it can only be improved by improving the plugins.
I created a new plugin class named TTI (text-to-intent)-Mapping. The idea is to return from a given text what the user wanted to do. Thus making the "speechhandling plugins" to "action_plugins" implementing various actions linked to an intent definition. And the TTI as a translator between the transcribed text and the action.
This decouples the recognition of what the user wanted from the plugins, making this more generic and giving the possibility to improve this later on.
Changes
So far, basically I integrated the Phrasematcher from #134 into a plugin and made it available for the speechhandler plugins.
I created a new plugin class with intent that there might be other kinds of matching implementations later on and (with a config system for plugins) that plugin may choose which TTI they use.
I needed to divide the initialization of STT-Plugins into two steps to be able to pass mic and TTI to the speechhandling plugins during instance creation.
Example
Its the sample from #134: Have a look at test_phrasematcher.py.
Is this a way Jasper wants to go? I'm open for ideas, suggestions and discussion.