Speech Parse Tree C++ API

 

typedef void* H_SPT

class LVParseTree
 

Handle to a speech parse tree.  Handles can be obtained from the speech port through LV_SRE_GetParseTreeHandle or LVSpeechPort::GetParseTree

 

 

H_PARSE_TREE_ITR
SPT_GetIteratorBegin(H_SPT Tree)

LVParseTree::Iterator
LVParseTree::Begin()

Traverses the trees elements, with parents proceeding children, from left to right.  

H_PARSE_TREE_CONCEPT_ITR
SPT_GetChildrenItr(H_SPT Tree)

LVParseTree::ChildrenIterator
LVParseTree::ChildrenItr()

Returns an iterator that points to the first child of the root of the tree.

void
SPT_Release(H_SPT Tree)

Releases the memory pointed to by the H_SPT handle.

The C++ object destroys itself.

int
SPT_GetNumberOfTagsInHeader(H_SPT Tree)

int
LVParseTree::NumberOfTagsInHeader()

Returns the number of tags defined in the header of the grammar that built this tree.

const char*
SPT_GetHeaderTag(H_SPT Tree, int i)

const char*
LVParseTree::HeaderTag(int i)
 

Returns the ith tag in the list of the trees header tags.

const char*
SPT_GetGrammarLabel(H_SPT Tree)

const char*
LVParseTree::GrammarLabel()
 

Returns the name of the grammar that matched this tree.

const char*
SPT_GetTagFormat(H_SPT Tree)

const char*
LVParseTree::TagFormat()

Returns the name of the tag format, e.g "lumenvox/1.0".

const char*
SPT_GetMode(H_SPT Tree)

const char*
LVParseTree::Mode()

Returns the mode of the grammar, "dtmf" or "voice"

typedef void* H_SPT_PRE_ORDER_ITR

class LVParseTree::PreOrderIterator

Handle to a pre-order iterator over a speech parse tree.  Use it to access information out of a tree or subtree.

int
SPT_PreOrderItr_IsRule(H_SPT_PRE_ORDER_ITR Itr)

bool
LVParseTree::PreOrderIterator::IsRule()

returns true if the node being pointed to represents an grammar rule.

int
SPT_PreOrderItr_IsSpeech(H_SPT_PRE_ORDER_ITR Itr)

bool
LVParseTree::PreOrderIterator::IsSpeech()

returns true if the node being pointed to  represents decoded spoken input.

int
SPT_PreOrderItr_IsTag(H_SPT_PRE_ORDER_ITR Itr)

bool LVParseTree::PreOrderIterator::IsTag()

returns true if the node being pointed to  represents a tag (semantic information).

int
SPT_PreOrderItr_GetScore(H_SPT_PRE_ORDER_ITR Itr)

int
LVParseTree::PreOrderIterator::Score()

Returns a confidence score, if the node represents speech.

int
SPT_PreOrderItr_GetBeginFrame(H_SPT_PRE_ORDER_ITR Itr)

int
LVParseTree::PreOrderIterator::BeginFrame()

Returns  the begin frame marker for speech data.

int
SPT_PreOrderItr_GetEndFrame(H_SPT_PRE_ORDER_ITR Itr)

int
LVParseTree::PreOrderIterator::BeginFrame()

Returns the end frame marker for speech data.

const char*
SPT_PreOrderItr_GetPhonemes(H_SPT_PRE_ORDER_ITR Itr)

const char*
LVParseTree::PreOrderIterator::Phonemes()

Returns the phoneme string, if the node represents speech.

const char*
SPT_PreOrderItr_GetLabel(H_SPT_PRE_ORDER_ITR Itr)

const char*
LVParseTree::PreOrderIterator::Label()

Returns the name of this node.  If it is a rule, this is the rule name.  If it is a tag, this is the tag data. If it is speech, this is the word or phrase that was spoken.

H_SPT_PRE_ORDER_ITR
SPT_PreOrderItr_GetPreOrderItr(H_SPT_PRE_ORDER_ITR Itr)

LVParseTree::PreOrderIterator
LVParseTree::PreOrderIterator::PreOrderItr()

Returns an iterator that will traverse the sub tree that is rooted at this node.

H_SPT_CHILDREN_ITR
SPT_PreOrderItr_GetChildrenItr(H_SPT_PRE_ORDER_ITR Itr)

LVParseTree::ChildrenIterator
LVParseTree::PreOrderIterator::ChildrenItr()

Returns an iterator that points to the first child of this node, that traverses all the children of this node.

int
SPT_PreOrderItr_IsPastEnd(H_SPT_PRE_ORDER_ITR Itr)

bool
LVParseTree::PreOrderIterator::IsPastEnd()

Returns true if the iterator has visited all nodes in the tree or subtree already.

int
SPT_PreOrderItr_Advance(H_SPT_PRE_ORDER_ITR Itr)

void
LVParseTree::PreOrderIterator::Advance()

Advances the iterators position in the tree or subtree

int
SPT_PreOrderItr_GetLevel(H_SPT_PRE_ORDER_ITR Itr)

int
LVParseTree::PreOrderIterator::Level()

Gets the level of the node that this iterator is pointing to. The root node is level 0, the roots children are level 1, and so on.

void
SPT_PreOrderItr_Release(H_SPT_PRE_ORDER_ITR Itr)

Releases the memory used by the handle.

The PreOrderIterator class destroys itself

typedef void* H_SPT_CHILDREN_ITR

class LVParseTree::ChildrenIterator

Same API as H_SPT_PRE_ORDER_ITR, but a children iterator only accesses the children of the node where it was created.

 

 


Complete Help Topic List | Speech Engine Product Information