Engines sub-package
Dragonfly supports multiple speech recognition engines as its backend.
The engines sub-package implements the interface code for each
supported engine.
EngineBase class
The dragonfly.engines.engine_base.EngineBase class forms the base
class for this specific speech recognition engine classes. It defines
the stubs required and performs some of the logic necessary for
Dragonfly to be able to interact with a speech recognition engine.
-
class EngineBase
Base class for engine-specific back-ends.
-
is_available
- Check whether this engine is available.
-
language
- Current user language of the SR engine.
-
mimic(words)
- Mimic a recognition of the given words.
-
name
- The human-readable name of this engine.
-
speak(text)
- Speak the given text using text-to-speech.
System Message: WARNING/2 (C:\data\projects\Dragonfly\work dragonfly\documentation\engines.txt, line 22)
error while formatting signature for dragonfly.engines.engine_natlink.NatlinkEngine.DictationContainer: arg is not a Python function
Natlink and DNS engine class
-
class NatlinkEngine
Speech recognition engine back-end for Natlink and DNS.
-
DictationContainer()
- Container class for dictated words as recognized by the
Dictation element for the Natlink and DNS engine.
-
is_available
- Check whether Natlink is available.
-
load_grammar(grammar)
- Load the given grammar into natlink.
-
load_natlink_grammar(grammar, all_results=False, hypothesis=False)
- Load the given grammar into natlink.
-
mimic(words)
- Mimic a recognition of the given words.
-
speak(text)
- Speak the given text using text-to-speech.
-
unload_grammar(grammar)
- Unload the given grammar from natlink.
SAPI 5 engine class
-
class Sapi5Engine
Speech recognition engine back-end for SAPI 5.
-
activate_grammar(grammar)
- Activate the given grammar.
-
activate_rule(rule, grammar)
- Activate the given rule.
-
deactivate_grammar(grammar)
- Deactivate the given grammar.
-
deactivate_rule(rule, grammar)
- Deactivate the given rule.
-
is_available
- Check whether this engine is available.
-
load_grammar(grammar)
- Load the given grammar.
-
mimic(words)
- Mimic a recognition of the given words.
-
speak(text)
- Speak the given text using text-to-speech.
Dictation container classes
Dictation container base class
This class is used to store the recognized results of dictation elements
within voice-commands. It offers access to both the raw spoken-form words
and be formatted written-form text.
The formatted text can be retrieved using format() or simply by
calling str(...) on a dictation container object. A tuple of the raw
spoken words can be retrieved using words().
-
class DictationContainerBase(words)
Container class for dictated words as recognized by the
Dictation element.
This base class implements the general functionality of dictation
container classes. Each supported engine should have a derived
dictation container class which performs the actual engine-
specific formatting of dictated text.
-
format()
- Format and return this dictation.
-
words
- Sequence of the words forming this dictation.
Dictation container class for Natlink
This class is derived from DictationContainerBase and implements
dictation formatting for the Natlink and Dragon NaturallySpeaking engine.
-
class NatlinkDictationContainer(words)
Container class for dictated words as recognized by the
Dictation element for the Natlink and DNS engine.
-
format()
- Format and return this dictation.