LVParseTree_CreateTerminalIteratorBegin and LVParseTree_CreateTerminalIteratorEnd provide access to the "terminals" of the tree. Terminals are the words and phrases in your grammar, so a TerminalIterator gives you access the the exact words the speech engine heard a speaker say to match a grammar, in the order that the Speech Engine heard those words.
- H_PARSE_TREE_TERMINAL_ITR LVParseTree_CreateTerminalIteratorBegin(H_PARSE_TREE Tree)
H_PARSE_TREE_TERMINAL_ITR LVParseTree_CreateTerminalIteratorEnd(H_PARSE_TREE Tree)
Handle to a parse tree.
The following code prints out the sentence Speech Engine heard, with a word-level confidence score attached to each word.
Itr = LVParseTree_CreateTerminalIteratorBegin(Tree);
End = LVParseTree_CreateTerminalIteratorEnd(Tree);
Node = LVParseTree_TerminalIterator_GetNode(Itr);
// Note: Node handles don't get released; They are part of the tree,
// and the tree releases them when it gets released
So if the grammar being used was the top level navigation example grammar, and the Speech Engine recognized "go back", then the output of the above code might look like: