The text is highlighted in the *EmacsListen* buffer. It is not highlighted in the current buffer, since in general interspersed commands have no representation and that makes it impossible to consistently highlight the spoken utterances in the current buffer.
Moreover, select-and-say works only for the text that is actually visible (as NaturallySpeaking sees it); this text is the visible contents of the *EmacsListen* buffer. This means that you cannot use the Dragon mechanism in general to select words in the current buffer, but you can still use it for correction of recent commands and text. The ShortTalk command to select a piece of text is choose sorch... (in the forward direction) or choose rorch... (in the backward direction). Of course, all the usual variations apply: choose twoon for choosing the last two words before the cursor, choose inner tair for choosing the inside of a parenthesized expression under the mouse pointer, etc.
So, remember NaturallySpeaking select-and-say works on the *EmacsListen* buffer.
word oon | -> | wor-DOON |
lat ane | -> | la-TANE |
laip ane | -> | lai-PANE |
The format is a BNF notation. Nonterminals are of the form <X>, where is X is a name. Terminals are just names. All rules defined in terms of '=' are expanded in all possible ways according to the definitions of nonterminals. Therefore, the grammar may not contain recursion (cycles). Terminals should be names whose pronunciation can be inferred by the underlying speech engine.
The ground (all-terminal) expansions of a sentential form alpha are associated with semantic actions. Three ways of defining these associations yield commands that take no argument:
alpha : function-name; | where interactive function function-name is called. |
alpha : (...); | where s-exp (...) is a list that can be evalulated. |
alpha : [...]; | where [...] is a keyboard macro. |
The ShortTalk grammar is defined in the file grammar.elg. The command M-x listen-load-grammar compiles the grammar into two formats: one is grammar.lcm, a file of lists describing the totality of all commands derived from the grammar, and the other is grammar.txt, which contains a subset of commands, each represented as a pair of the form spoken form/written form. It is assumed that the subset contains enough bigrams to cover all the commands (which are usually bigrams or trigram, although 4-grams also are common) (Currently, even the grammar.txt contains around 20,000 commands. This could probably safely be pruned.) The file grammar.lcm is loaded into a hash table when listen-mode is activated. This is again a solution that is much more space intensive than really needed. However, the resulting parser is fast, since it checks each prefix of possible command words through a single hash table lookup.