<?php $isip_window_title = "ISIP Homepage"; ?>
<?php include("/data/isip/www/templates/documentation/header/header.html"); ?>

<!--#set var="isip_page_title" value="LexicalTree" -->
<?php include("/data/isip/www/templates/documentation/body/index_class.html"); ?>
<?php include("/data/isip/www/templates/documentation/body/bar.html"); ?>

<a name="name">
<b>
name:
<a href="/perl/ifc_document.pl?file=$isip/class/search/LexicalTree/LexicalTree.h">class LexicalTree : public DiGraph&lt;SearchNode>&gt</a>
</b>

<br><br>

<a name="synopsis">
<b>synopsis:</b>

<blockquote>
<pre>
g++ [flags ...] file ... -l /isip/tools/lib/$ISIP_BINARY/lib_search.a

#include &lt;LexicalTree.h&gt;

LexicalTree();
LexicalTree(const LexicalTree& copy_tree);

static boolean expandLexicalTree(DiGraph&lt;LexicalNode&gt;& word_graph_a, 
			       const Vector&lt;DiGraph&lt;LexicalNode&gt; &gt;& pron_vec_a,
			       long level_a);

static boolean expandLexicalTree(GVLexicalNode*& root_node_a, 
			    const Vector&lt;DiGraph&lt;LexicalNode&gt; &gt;& pron_vec_a,
			    long level_a);

</pre>
</blockquote>

<a name="quick_start">
<b>quick start:</b>

<blockquote>
<pre>
#include &lt;LexicalTree.h&gt;

// a test file
//
String model_fn;
Sof model_sof;

// testing expand lexical tree
//
SearchLevel word_level_3;
SearchLevel phone_level_3;
model_fn.assign(L"$ISIP_DEVEL/doc/examples/data/models/lex_02_lm_model.sof");
model_sof.open(model_fn, File::READ_ONLY, File::TEXT);

// load word level -- level 0
//
word_level_3.loadSymbols(model_sof,0);
word_level_3.loadSubGraphs(model_sof,0);
word_level_3.setLevelIndex(0);

// load the phone level -- level 1
//
phone_level_3.loadSymbols(model_sof,1);
phone_level_3.loadSubGraphs(model_sof,1);
phone_level_3.setLevelIndex(1);

// close the file
//
model_sof.close();

// expand the top level graph to a lexical tree
//
LexicalTree::expandLexicalTree(word_level_3.getSubGraph((long)0),
				 phone_level_3.getSubGraphs(),
				 0);
</pre>
</blockquote>

<a name="description"> 
<b>description:</b>
<br><br>

LexicalTree class is designed to transform a graph-based search space to a tree-based search space. When expanding a lexical tree at level i, the symbols of level i will be expanded to their corresponding sub-graphs at level i+1 and the common prefix of these symbols will be shared, resulting in a tree-structured search. <br><br>

<a name="dependencies">
<b>dependencies:</b>
<br><br>

<ul>
  <li> <a href="../../dstr/GraphVertex/index.html">GraphVertex</a>
  <li> <a href="../../dstr/DiGraph/index.html">DiGraph</a>
  <li> <a href="../../search/SearchNode/index.html">SearchNode</a>
  <li> <a href="../../system/MemoryManager/index.html">MemoryManager</a>
</ul>

<a name="constants">
<b>public constants:</b>
<br><br>

<ul>
  <li> define the class name:

       <pre><a href="/perl/ifc_document.pl?file=$isip/class/search/LexicalTree/lex_00.cc&constant=CLASS_NAME">static const String CLASS_NAME = L"LexicalTree";</a></pre>

  <li> define the default value(s) of the class data:
       
       <pre>static const long DEF_LENGTH = 1;</pre>
       <pre>static const long DEF_CENTRAL_INDEX = 1;</pre>
</ul>
	 
<a name="error">       
<b>error codes:</b>
<br><br>

<ul>
  <li> error codes:
       
       <pre><a href="/perl/ifc_document.pl?err=00090600">static const long ERR = 90600;</a></pre>
</ul>

<a name="protected">
<b>protected data:</b>
<br><br>

<ul>

  <li> define class typedefs

       <pre>typedef SearchNode LexicalNode;</pre>
       
       <pre>typedef typedef SearchSymbol LexSymbol;</pre>
       
       <pre>typedef GraphVertex&lt;LexicalNode&gt; GVLexicalNode;</pre>

       <pre>typedef DiGraph&lt;LexicalNode&gt; Pronunciation;</pre>

       <pre>typedef GraphArc&lt;LexicalNode&gt; GALexicalNode;</pre>
       
  <li> debug level:
       
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/search/LexicalTree/lex_00.cc&static=debug_level_d">static Integral::DEBUG debug_level_d;</a></pre>

  <li> memory manager:
       
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/search/LexicalTree/lex_00.cc&static=mgr_d">static MemoryManager mgr_d;</a></pre>
       

</ul>

<a name="public">
<b>required public methods:</b>
<br><br>

<ul>
  <li> static methods:  

       <pre><a href="/perl/ifc_document.pl?file=$isip/class/search/LexicalTree/LexicalTree.h&method=name">static const String& name();</a></pre>
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/search/LexicalTree/lex_02.cc&method=diagnose">static boolean diagnose(Integral::DEBUG debug_level);</a></pre>

  <li> debug methods:

       <pre><a href="/perl/ifc_document.pl?file=$isip/class/search/LexicalTree/LexicalTree.h&method=debug">boolean debug(const unichar* message_a);</a></pre>
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/search/LexicalTree/LexicalTree.h&method=setDebug">static boolean setDebug(Integral::DEBUG debug_level);</a></pre>

       
  <li> destructor/constructor(s):
       
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/search/LexicalTree/LexicalTree.h&method=destructor">~LexicalTree();</a></pre>
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/search/LexicalTree/lex_00.cc&method=default+constructor&instance=0">LexicalTree();</a></pre>
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/search/LexicalTree/lex_00.cc&method=copy+constructor&instance=0">LexicalTree(const LexicalTree& copy_tree);</a></pre>

  <li> assign methods:

       <pre><a href="/perl/ifc_document.pl?file=$isip/class/search/LexicalTree/LexicalTree.h&method=assign">boolean assign(const LexicalTree& copy_tree_a)</a></pre>

  <li> i/o methods:
       
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/search/LexicalTree/LexicalTree.h&method=sofSize">long sofSize() const;</a></pre>
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/search/LexicalTree/LexicalTree.h&method=read">boolean read(Sof& sof, long tag, const String& name = CLASS_NAME);</a></pre>
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/search/LexicalTree/LexicalTree.h&method=readData">boolean readData(Sof& sof, const String& pname = DEF_PARAM,long size = SofParser::FULL_OBJECT, boolean param = true,boolean nested = false)</a></pre>
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/search/LexicalTree/LexicalTree.h&method=write">boolean write(Sof& sof, long tag, const String& name = CLASS_NAME) const;</a></pre>
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/search/LexicalTree/LexicalTree.h&method=writeData">boolean writeData(Sof& sof, const String& pname = DEF_PARAM) const;</a></pre>

  <li> equality methods:

       <pre><a href="/perl/ifc_document.pl?file=$isip/class/search/LexicalTree/lex_00.cc&method=eq&instance=0">boolean eq(const LexicalTree& compare_tree_a)</a></pre>

  <li> memory management methods:

       <pre><a href="/perl/ifc_document.pl?file=$isip/class/search/LexicalTree/LexicalTree.h&method=new">static void* operator new(size_t size);</a></pre>
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/search/LexicalTree/LexicalTree.h&method=new[]">static void* operator new[](size_t size);</a></pre>
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/search/LexicalTree/LexicalTree.h&method=delete">static void operator delete(void* ptr);</a></pre>
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/search/LexicalTree/LexicalTree.h&method=delete[]">static void operator delete[](void* ptr);</a></pre>  
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/search/LexicalTree/LexicalTree.h&method=setGrowSize">static boolean setGrowSize(long grow_size);</a></pre>
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/search/LexicalTree/lex_00.cc&method=clear">boolean clear(Integral::CMODE ctype = Integral::DEF_CMODE);</a></pre>
       
</ul>

<a name="specific">
<b>class-specific public methods:</b>
<br><br>

<ul>
  <li> expand subgraphs into the lexical trees
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/search/LexicalTree/lex_06.cc&method=expandLexicalTree">static boolean expandLexicalTree(DiGraph&lt;LexicalNode&gt;& word_graph_a, const Vector&lt;DiGraph&lt;LexicalNode&gt; >& pron_vec_a,long level_a);</a></pre>

       <pre><a href="/perl/ifc_document.pl?file=$isip/class/search/LexicalTree/lex_06.cc&method=expandLexicalTree">static boolean expandLexicalTree(GVLexicalNode*& root_node_a, const Vector&lt;DiGraph&lt;LexicalNode&gt; >& pron_vec_a,long level_a);</a></pre>
</ul>

<a name="private">
<b>private methods:</b>
<br><br>

<ul>
  <li> none
</ul>

<a name="notes">
<b>notes:</b>
<br><br>

<ul>
  <li> none
</ul>

<!--#include virtual="/hse/ies/templates/documentation/footer/footer.html" -->

