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

<!--#set var="isip_page_title" value="LanguageModelIHD" -->
<?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/pr/LanguageModelIHD.h">LanguageModelIHD</a></b>

<br><br>

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

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

#include &lt;LanguageModelIHD.h&gt;

boolean read(Sof& sof, long tag, const String& cname = CLASS_NAME);
HierarchicalDigraph& getHDigraph();
</pre>
</blockquote>

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

<blockquote>
<pre>
Sof sof;
sof.open("lm_ihd_obj.sof", File::READ_ONLY);

LanguageModelIHD lmihd;
lmihd.read(sof, 0);

HierarchicalDigraph hg;
hg.assign(lmihd.getHDigraph());
</pre>
</blockquote>

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

The LanguageModelIHD class is a container class for the ISIP Hierarchical Digraph.  Unlike the other LanguageModel classes, LanguageModelIHD does not perform network conversion to IHD (as it is unnecessary).  The this class is to place IHD at an equal level of abstraction as XML and JSGF and provide an easy interface to all model formats through LanguageModelBase.

<br><br>

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

<ul>
  <li><a href="../../system/Console/index.html">Console</a>
  <li><a href="../../dstr/DiGraph/index.html">DiGraph</a> 
  <li><a href="../../shell/Filename/index.html">Filename</a>
  <li><a href="../../pr/LanguageModel/index.html">LanguageModelBase</a>
  <li><a href="../../shell/Sdb/index.html">Sdb</a>
  <li><a href="../../io/Sof/index.html">Sof</a>
  <li><a href="">typeinfo</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/pr/LanguageModelIHD/lmihd_00.cc&constant=CLASS_NAME">static const String LanguageModelIHD::CLASS_NAME = L"LanguageModelIHD";</a></pre>

  <li> i/o related constants:

       <pre><a href="/perl/ifc_document.pl?file=$isip/class/pr/LanguageModelIHD/lmihd_00.cc&constant=DEF_PARAM">static const String LanguageModelIHD::DEF_PARAM = L"";</a></pre>

       <pre><a href="/perl/ifc_document.pl?file=$isip/class/pr/LanguageModelIHD/lmihd_00.cc&constant=PARAM_IHD">static const String LanguageModelIHD::PARAM_IHD = L"h_digraph";</a></pre>

</ul>

<a name="error">
<b>error codes:</b>
<br><br>
<ul>
  <li> error code indicating LanguageModelIHD class general error:
       <pre><a href="/perl/ifc_document.pl?err=100101">static const long ERR = 100102;</a></pre>

</ul>

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

<ul> <!-- list of categories -->


  <li> memory manager
    <pre>static MemoryManager mgr_d;</pre>
  
  <li> hierarchical digraph 
    <pre>HierarchicalDigraph hg_d;</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/pr/LanguageModelIHD/LanguageModelIHD.h&method=name">static const String& name();</a></pre>
       
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/pr/LanguageModelIHD/lmihd_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/pr/LanguageModelIHD/lmihd_01.cc&method=debug">boolean debug(const unichar* msg) const;</a></pre>
       
  <li> destructor/constructor(s):
       
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/pr/LanguageModelIHD/LanguageModelIHD.h&method=destructor">~LanguageModelIHD();</a></pre>
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/pr/LanguageModelIHD/LanguageModelIHD.h&method=default+constructor">LanguageModelIHD();</a></pre>

                          
  <li> i/o methods:
       
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/pr/LanguageModelIHD/lmihd_03.cc&method=read">boolean read(Sof& sof, long tag, const String& cname = CLASS_NAME);</a></pre>

       <pre><a href="/perl/ifc_document.pl?file=$isip/class/pr/LanguageModelIHD/lmihd_03.cc&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/pr/LanguageModelIHD/lmihd_03.cc&method=write">boolean write(Sof& sof, long tag, const String& cname = CLASS_NAME) const;</a></pre>
       
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/pr/LanguageModelIHD/lmihd_03.cc&method=writeData">boolean writeData(Sof& sof, const String& pname = DEF_PARAM) const;</a></pre>

       <pre><a href="/perl/ifc_document.pl?file=$isip/class/pr/LanguageModelIHD/LanguageModelIHD.h&method=sofSize">long sofSize() const;</a></pre>

  <li> assign methods:
       
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/pr/LanguageModelIHD/lmihd_01.cc&method=assign&instance=0">boolean assign(const LanguageModelIHD& arg);</a></pre>
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/pr/LanguageModelIHD/lmihd_05.cc&method=assign">boolean assign(const LanguageModelBase& arg);</a></pre>

  <li> equality methods:

       <pre><a href="/perl/ifc_document.pl?file=$isip/class/pr/LanguageModelIHD/lmihd_01.cc.h&method=eq&instance=0">boolean eq(const LanguageModelIHD& arg) const;</a></pre>
       
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/pr/LanguageModelIHD/lmihd_01.cc.h&method=eq&instance=1">boolean eq(const LanguageModelBase& arg) const;</a></pre>

  <li> clear methods:

       <pre><a href="/perl/ifc_document.pl?file=$isip/class/pr/LanguageModelIHD/lmihd_01.cc&method=clear">boolean clear(Integral::CMODE ctype);</a></pre>


</ul>

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

<ul>       

  <li> class-specific public methods required by LanguageModelBase interface contract
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/pr/LanguageModel/LanguageModelBase.h&method=className"const String& className() const;</pre></a>

       <pre><a href="/perl/ifc_document.pl?file=$isip/class/pr/LanguageModel/LanguageModelBase.h&method=getRuleModel"RuleModel getRuleModel();></pre></a>

       <pre><a href="/perl/ifc_document.pl?file=$isip/class/pr/LanguageModel/LanguageModelBase.h&method=setRuleModel">boolean setRuleModel(const RuleModel& hg);</pre></a>


</ul>

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

<ul>       

  <li> other methods
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/pr/LanguageModelIHD/LanguageModelIHD.h&method=className">const String& className() const;</pre></a>

       <pre><a href="/perl/ifc_document.pl?file=$isip/class/pr/LanguageModelIHD/lmihd_07.cc&method=getRuleModel">RuleModel getRuleModel();</pre></a>

       <pre><a href="/perl/ifc_document.pl?file=$isip/class/pr/LanguageModelIHD/lmihd_07.cc&method=setRuleModel">boolean setRuleModel(const RuleModel& rm);</pre></a>

       <pre><a href="/perl/ifc_document.pl?file=$isip/class/pr/LanguageModelIHD/LanguageModelIHD.h&method=getIHD">HierarchicalDigraph& getIHD();</pre></a>

       <pre><a href="/perl/ifc_document.pl?file=$isip/class/pr/LanguageModelIHD/LanguageModelIHD.h&method=setIHD">boolean setIHD(const HierarchicalDigraph& hg);</pre></a>

</ul>

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

<ul>       

  <li> 
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/pr/LanguageModelIHD/lmihd_07.cc&method=isEpsilon">boolean isEpsilon(Vector<ProductionRule> rules, String rule_name);</pre></a>

       <pre><a href="/perl/ifc_document.pl?file=$isip/class/pr/LanguageModelIHD/lmihd_07.cc&method=findTerminals">Vector&lt;Pair&lt;String, SearchSymbol&gt;&gt; findTerminals(Vector&lt;ProductionRule&gt; rules, String rule_name);</pre></a>

   
</ul>



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

<ul>
  <li> This example shows how to use a LanguageModelIHD object to read
       a LanguageModelIHD object from a file, and retrieve the IHD.
   
<pre>

// declare an sof object to parse the file
//
Sof sof;

// open the file for reading
//
sof.open("lm_ihd_obj.sof", File::READ_ONLY);

// declare a LMIHD object to read the grammars
//
LanguageModelIHD lmihd;

// read the grammars
//
lmihd.read(sof, 0);

// declare an HierarchicalDigraph object to store the grammars in DiGraph form
//
HierarchicalDigraph hg;

// retrieve the grammars from the LMIHD object, and store them in the HD object
//
hg.assign(lmihd.getHDigraph());

</pre>
</ul>


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