Core Concepts
/

Commands

Common Needs

Enabling all commands

```

Commands.enableAll()

``

Changing the spoken name of a command

```

Commands.changeSpoken 'package:command-id', 'new spoken'

``

Add misspellings

Useful if the speech recognition often spells a command word incorrectly, such as `cursor:down` @[email protected] being misrecognized as @[email protected]

```

Commands.addMisspellings 'cursor:down', ['dune']

``

Command properties

`spoken`

String.

Vocal trigger

`bypassHistory`

Boolean.

Bypasses history window and repetition commands i.e creek

`enabled`

Boolean. Default: `false`

Should command be enabled or disabled out-of-the-box.

`grammarType`

`String`

Default: `"individual"`

The `grammarType` parameter tells the parser how this command should fit in a phrase, and what types of arguments it should receive.

The available grammar types are:

  • `integerCapture`: will capture any number spoken immediately after the command name and provide it to the command as an argument.
  • `numberRange`: captures two numbers separated by the word "dot". So to get the range 10-12 you would say "ten dot twelve"
  • `numberOrRange`: TODO
  • `textCapture`: will capture any free-text spoken after the command up until another command keyword is spoken or the phrase ends, and provide it to the command as an argument (a JavaScript array of strings)
  • `individual`: does not capture any arguments, it just operates on its own. This is the default grammar type if no option is specified.
  • `oneArgument`: Will capture the next word, number, or symbol and provide it as an argument to the command as a string or number
  • `singleSearch`: When followed by a command with `findable` property set, will will pass that value as an argument. Otherwise acts as textCapture.
  • `custom`: Define a custom grammar pattern for this command to accept as arguments. Especially useful for capturing items from lists or when there are multiple optional segments. Very good recognition. See custom grammars

`scope`

String

Default: `"global"` or defined by package

Scope for this command.

`continuous`

Boolean

Default: true

Non-continuous commands only trigger when in the beginning of an utterance.

`misspellings`

String.

Alternative to spoken. Misspellings are treated the same as spoken except they are not added to dragon's vocabulary or commands. This is because we don't want to reinforce recognition of the misspelled version.

`spaceBefore`

Boolean

Default: `false`

Set this to true if given command will often be preceded by symbols:space 🔉skoosh🔉. This will generate additional terms for common vocabulary sequences, boosting recognition accuracy.

`repeatable`

Boolean. Default: `false`

Set to true if you expect this command to often be followed by repetition commands.

`needsCommand`

Boolean

Default: `true`

Should this command be added to dragon's commands. If the vocal trigger is very easily recognizable by Dragon, set this to false to preserve RAM.

`vocabulary`

Boolean. Default: true

Should this command be added to dragon's vocabulary

`autoSpacing`

see auto spacing

`multiPhraseAutoSpacing`

see auto spacing

`findable`

String.

If preceded by a grammarType: 'singleSearch' command, what should be searched for. See symbols and selection packages

`description`

String

Description of given command.

`tags`

Array of strings.

UI search parameter.

`needsParsing`

Boolean

Default: `true`

Special case (internal) commands which aren't meant to to be triggered by voice, thus not needing a `spoken` attribute and should be bypassed by the parser.

Custom grammars

TODO

`rule`

`variables`