Sophie

Sophie

distrib > Mageia > 5 > x86_64 > media > core-release > by-pkgid > b56c9eed3fa0f00740b6f09a2460a97f > files > 362

lib64sphinxbase-devel-0.8-7.mga5.x86_64.rpm

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.8"/>
<title>SphinxBase: include/sphinxbase/ngram_model.h File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">SphinxBase
   &#160;<span id="projectnumber">0.6</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.8 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>Globals</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('ngram__model_8h.html','');});
</script>
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#define-members">Macros</a> &#124;
<a href="#typedef-members">Typedefs</a> &#124;
<a href="#enum-members">Enumerations</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">ngram_model.h File Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>N-Gram language models.  
<a href="#details">More...</a></p>
<div class="textblock"><code>#include &lt;stdarg.h&gt;</code><br />
<code>#include &lt;sphinxbase/sphinxbase_export.h&gt;</code><br />
<code>#include &lt;<a class="el" href="prim__type_8h_source.html">sphinxbase/prim_type.h</a>&gt;</code><br />
<code>#include &lt;<a class="el" href="cmd__ln_8h_source.html">sphinxbase/cmd_ln.h</a>&gt;</code><br />
<code>#include &lt;<a class="el" href="logmath_8h_source.html">sphinxbase/logmath.h</a>&gt;</code><br />
<code>#include &lt;<a class="el" href="mmio_8h_source.html">sphinxbase/mmio.h</a>&gt;</code><br />
</div>
<p><a href="ngram__model_8h_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
Macros</h2></td></tr>
<tr class="memitem:a3d4b3dddd0ff67e13d30c9bf053d01ab"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a3d4b3dddd0ff67e13d30c9bf053d01ab"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="ngram__model_8h.html#a3d4b3dddd0ff67e13d30c9bf053d01ab">NGRAM_INVALID_WID</a>&#160;&#160;&#160;-1</td></tr>
<tr class="memdesc:a3d4b3dddd0ff67e13d30c9bf053d01ab"><td class="mdescLeft">&#160;</td><td class="mdescRight">Impossible word ID. <br /></td></tr>
<tr class="separator:a3d4b3dddd0ff67e13d30c9bf053d01ab"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="typedef-members"></a>
Typedefs</h2></td></tr>
<tr class="memitem:afaaf0c00e20056d97efcd97e4cae4ea7"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="afaaf0c00e20056d97efcd97e4cae4ea7"></a>
typedef struct <a class="el" href="structngram__model__s.html">ngram_model_s</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="ngram__model_8h.html#afaaf0c00e20056d97efcd97e4cae4ea7">ngram_model_t</a></td></tr>
<tr class="memdesc:afaaf0c00e20056d97efcd97e4cae4ea7"><td class="mdescLeft">&#160;</td><td class="mdescRight">Abstract type representing an N-Gram based language model. <br /></td></tr>
<tr class="separator:afaaf0c00e20056d97efcd97e4cae4ea7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae36b2f037b2ea751dff23f082379c264"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ae36b2f037b2ea751dff23f082379c264"></a>
typedef struct <a class="el" href="structngram__class__s.html">ngram_class_s</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="ngram__model_8h.html#ae36b2f037b2ea751dff23f082379c264">ngram_class_t</a></td></tr>
<tr class="memdesc:ae36b2f037b2ea751dff23f082379c264"><td class="mdescLeft">&#160;</td><td class="mdescRight">Abstract type representing a word class in an N-Gram model. <br /></td></tr>
<tr class="separator:ae36b2f037b2ea751dff23f082379c264"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0e7d02703c48237b2afea436392dcb82"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a0e7d02703c48237b2afea436392dcb82"></a>
typedef enum <a class="el" href="ngram__model_8h.html#a406c0d64c15a9d1749d07c8ab6e0ae74">ngram_file_type_e</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="ngram__model_8h.html#a0e7d02703c48237b2afea436392dcb82">ngram_file_type_t</a></td></tr>
<tr class="memdesc:a0e7d02703c48237b2afea436392dcb82"><td class="mdescLeft">&#160;</td><td class="mdescRight">File types for N-Gram files. <br /></td></tr>
<tr class="separator:a0e7d02703c48237b2afea436392dcb82"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab9b3023d92b99927d1e851108ac3bdad"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ab9b3023d92b99927d1e851108ac3bdad"></a>
typedef enum <a class="el" href="ngram__model_8h.html#aad16a0a1edf29ba8c0df43959c0c4771">ngram_case_e</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="ngram__model_8h.html#ab9b3023d92b99927d1e851108ac3bdad">ngram_case_t</a></td></tr>
<tr class="memdesc:ab9b3023d92b99927d1e851108ac3bdad"><td class="mdescLeft">&#160;</td><td class="mdescRight">Constants for case folding. <br /></td></tr>
<tr class="separator:ab9b3023d92b99927d1e851108ac3bdad"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac7de090a02fa12a8bba84abb4d5236aa"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ac7de090a02fa12a8bba84abb4d5236aa"></a>
typedef struct <a class="el" href="structngram__iter__s.html">ngram_iter_s</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="ngram__model_8h.html#ac7de090a02fa12a8bba84abb4d5236aa">ngram_iter_t</a></td></tr>
<tr class="memdesc:ac7de090a02fa12a8bba84abb4d5236aa"><td class="mdescLeft">&#160;</td><td class="mdescRight">M-gram iterator object. <br /></td></tr>
<tr class="separator:ac7de090a02fa12a8bba84abb4d5236aa"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:afffd75c5bde8dd84107449468be48547"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="afffd75c5bde8dd84107449468be48547"></a>
typedef struct <br class="typebreak" />
<a class="el" href="structngram__model__set__iter__s.html">ngram_model_set_iter_s</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="ngram__model_8h.html#afffd75c5bde8dd84107449468be48547">ngram_model_set_iter_t</a></td></tr>
<tr class="memdesc:afffd75c5bde8dd84107449468be48547"><td class="mdescLeft">&#160;</td><td class="mdescRight">Iterator over language models in a set. <br /></td></tr>
<tr class="separator:afffd75c5bde8dd84107449468be48547"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="enum-members"></a>
Enumerations</h2></td></tr>
<tr class="memitem:a406c0d64c15a9d1749d07c8ab6e0ae74"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="ngram__model_8h.html#a406c0d64c15a9d1749d07c8ab6e0ae74">ngram_file_type_e</a> { <br />
&#160;&#160;<a class="el" href="ngram__model_8h.html#a406c0d64c15a9d1749d07c8ab6e0ae74a2cf596c8b0c63a3a0ba1fe33326cc796">NGRAM_INVALID</a> = -1, 
<a class="el" href="ngram__model_8h.html#a406c0d64c15a9d1749d07c8ab6e0ae74a441701bf8ae0a2b79716feb31b5f257a">NGRAM_AUTO</a>, 
<a class="el" href="ngram__model_8h.html#a406c0d64c15a9d1749d07c8ab6e0ae74a77ef2341d826b3cc8b836e3af1efba99">NGRAM_ARPA</a>, 
<a class="el" href="ngram__model_8h.html#a406c0d64c15a9d1749d07c8ab6e0ae74addfc3620d0fbc6f05f7f8e455245dd92">NGRAM_DMP</a>, 
<br />
&#160;&#160;<a class="el" href="ngram__model_8h.html#a406c0d64c15a9d1749d07c8ab6e0ae74ab8fe83d2dec88c1c8cb4d82a8a528bb8">NGRAM_DMP32</a>
<br />
 }</td></tr>
<tr class="memdesc:a406c0d64c15a9d1749d07c8ab6e0ae74"><td class="mdescLeft">&#160;</td><td class="mdescRight">File types for N-Gram files.  <a href="ngram__model_8h.html#a406c0d64c15a9d1749d07c8ab6e0ae74">More...</a><br /></td></tr>
<tr class="separator:a406c0d64c15a9d1749d07c8ab6e0ae74"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aad16a0a1edf29ba8c0df43959c0c4771"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aad16a0a1edf29ba8c0df43959c0c4771"></a>enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="ngram__model_8h.html#aad16a0a1edf29ba8c0df43959c0c4771">ngram_case_e</a> { <b>NGRAM_UPPER</b>, 
<b>NGRAM_LOWER</b>
 }</td></tr>
<tr class="memdesc:aad16a0a1edf29ba8c0df43959c0c4771"><td class="mdescLeft">&#160;</td><td class="mdescRight">Constants for case folding. <br /></td></tr>
<tr class="separator:aad16a0a1edf29ba8c0df43959c0c4771"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ab0c840f2bdfc38cea08bb70054f76624"><td class="memItemLeft" align="right" valign="top">SPHINXBASE_EXPORT <a class="el" href="ngram__model_8h.html#afaaf0c00e20056d97efcd97e4cae4ea7">ngram_model_t</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="ngram__model_8h.html#ab0c840f2bdfc38cea08bb70054f76624">ngram_model_read</a> (<a class="el" href="structcmd__ln__t.html">cmd_ln_t</a> *config, const char *file_name, <a class="el" href="ngram__model_8h.html#a0e7d02703c48237b2afea436392dcb82">ngram_file_type_t</a> file_type, <a class="el" href="logmath_8h.html#ae613aa7db1dd40ff56a80a7dadb22cc8">logmath_t</a> *lmath)</td></tr>
<tr class="memdesc:ab0c840f2bdfc38cea08bb70054f76624"><td class="mdescLeft">&#160;</td><td class="mdescRight">Read an N-Gram model from a file on disk.  <a href="#ab0c840f2bdfc38cea08bb70054f76624">More...</a><br /></td></tr>
<tr class="separator:ab0c840f2bdfc38cea08bb70054f76624"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac8ff04e1bccbef23bde9e81fb61c57fe"><td class="memItemLeft" align="right" valign="top">SPHINXBASE_EXPORT int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="ngram__model_8h.html#ac8ff04e1bccbef23bde9e81fb61c57fe">ngram_model_write</a> (<a class="el" href="ngram__model_8h.html#afaaf0c00e20056d97efcd97e4cae4ea7">ngram_model_t</a> *model, const char *file_name, <a class="el" href="ngram__model_8h.html#a0e7d02703c48237b2afea436392dcb82">ngram_file_type_t</a> format)</td></tr>
<tr class="memdesc:ac8ff04e1bccbef23bde9e81fb61c57fe"><td class="mdescLeft">&#160;</td><td class="mdescRight">Write an N-Gram model to disk.  <a href="#ac8ff04e1bccbef23bde9e81fb61c57fe">More...</a><br /></td></tr>
<tr class="separator:ac8ff04e1bccbef23bde9e81fb61c57fe"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad758d3f491d501bdec2ada8088e9b656"><td class="memItemLeft" align="right" valign="top">SPHINXBASE_EXPORT <a class="el" href="ngram__model_8h.html#a0e7d02703c48237b2afea436392dcb82">ngram_file_type_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="ngram__model_8h.html#ad758d3f491d501bdec2ada8088e9b656">ngram_file_name_to_type</a> (const char *file_name)</td></tr>
<tr class="memdesc:ad758d3f491d501bdec2ada8088e9b656"><td class="mdescLeft">&#160;</td><td class="mdescRight">Guess the file type for an N-Gram model from the filename.  <a href="#ad758d3f491d501bdec2ada8088e9b656">More...</a><br /></td></tr>
<tr class="separator:ad758d3f491d501bdec2ada8088e9b656"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:affb3d938049e58c191e72858a7191e9c"><td class="memItemLeft" align="right" valign="top">SPHINXBASE_EXPORT <a class="el" href="ngram__model_8h.html#a0e7d02703c48237b2afea436392dcb82">ngram_file_type_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="ngram__model_8h.html#affb3d938049e58c191e72858a7191e9c">ngram_str_to_type</a> (const char *str_name)</td></tr>
<tr class="memdesc:affb3d938049e58c191e72858a7191e9c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the N-Gram file type from a string.  <a href="#affb3d938049e58c191e72858a7191e9c">More...</a><br /></td></tr>
<tr class="separator:affb3d938049e58c191e72858a7191e9c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a992b8a8d7f623e2662ae94991f6aec55"><td class="memItemLeft" align="right" valign="top">SPHINXBASE_EXPORT char const *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="ngram__model_8h.html#a992b8a8d7f623e2662ae94991f6aec55">ngram_type_to_str</a> (int type)</td></tr>
<tr class="memdesc:a992b8a8d7f623e2662ae94991f6aec55"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the canonical name for an N-Gram file type.  <a href="#a992b8a8d7f623e2662ae94991f6aec55">More...</a><br /></td></tr>
<tr class="separator:a992b8a8d7f623e2662ae94991f6aec55"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a046e6ff8cd8787e412400534a9649a81"><td class="memItemLeft" align="right" valign="top">SPHINXBASE_EXPORT <a class="el" href="ngram__model_8h.html#afaaf0c00e20056d97efcd97e4cae4ea7">ngram_model_t</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="ngram__model_8h.html#a046e6ff8cd8787e412400534a9649a81">ngram_model_retain</a> (<a class="el" href="ngram__model_8h.html#afaaf0c00e20056d97efcd97e4cae4ea7">ngram_model_t</a> *model)</td></tr>
<tr class="memdesc:a046e6ff8cd8787e412400534a9649a81"><td class="mdescLeft">&#160;</td><td class="mdescRight">Retain ownership of an N-Gram model.  <a href="#a046e6ff8cd8787e412400534a9649a81">More...</a><br /></td></tr>
<tr class="separator:a046e6ff8cd8787e412400534a9649a81"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aec73d28e7285e539a0b44a7ac0cbe489"><td class="memItemLeft" align="right" valign="top">SPHINXBASE_EXPORT int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="ngram__model_8h.html#aec73d28e7285e539a0b44a7ac0cbe489">ngram_model_free</a> (<a class="el" href="ngram__model_8h.html#afaaf0c00e20056d97efcd97e4cae4ea7">ngram_model_t</a> *model)</td></tr>
<tr class="memdesc:aec73d28e7285e539a0b44a7ac0cbe489"><td class="mdescLeft">&#160;</td><td class="mdescRight">Release memory associated with an N-Gram model.  <a href="#aec73d28e7285e539a0b44a7ac0cbe489">More...</a><br /></td></tr>
<tr class="separator:aec73d28e7285e539a0b44a7ac0cbe489"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aac2b3fd054597c2fdfbb59db97d72ec0"><td class="memItemLeft" align="right" valign="top">SPHINXBASE_EXPORT int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="ngram__model_8h.html#aac2b3fd054597c2fdfbb59db97d72ec0">ngram_model_recode</a> (<a class="el" href="ngram__model_8h.html#afaaf0c00e20056d97efcd97e4cae4ea7">ngram_model_t</a> *model, const char *from, const char *to)</td></tr>
<tr class="memdesc:aac2b3fd054597c2fdfbb59db97d72ec0"><td class="mdescLeft">&#160;</td><td class="mdescRight">Re-encode word strings in an N-Gram model.  <a href="#aac2b3fd054597c2fdfbb59db97d72ec0">More...</a><br /></td></tr>
<tr class="separator:aac2b3fd054597c2fdfbb59db97d72ec0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a41b938a2c4b129dc0df37b2312d65506"><td class="memItemLeft" align="right" valign="top">SPHINXBASE_EXPORT int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="ngram__model_8h.html#a41b938a2c4b129dc0df37b2312d65506">ngram_model_casefold</a> (<a class="el" href="ngram__model_8h.html#afaaf0c00e20056d97efcd97e4cae4ea7">ngram_model_t</a> *model, int kase)</td></tr>
<tr class="memdesc:a41b938a2c4b129dc0df37b2312d65506"><td class="mdescLeft">&#160;</td><td class="mdescRight">Case-fold word strings in an N-Gram model.  <a href="#a41b938a2c4b129dc0df37b2312d65506">More...</a><br /></td></tr>
<tr class="separator:a41b938a2c4b129dc0df37b2312d65506"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa4b8d7c1f3d873b8458c0cfee13af4da"><td class="memItemLeft" align="right" valign="top">SPHINXBASE_EXPORT int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="ngram__model_8h.html#aa4b8d7c1f3d873b8458c0cfee13af4da">ngram_model_apply_weights</a> (<a class="el" href="ngram__model_8h.html#afaaf0c00e20056d97efcd97e4cae4ea7">ngram_model_t</a> *model, float32 lw, float32 wip, float32 uw)</td></tr>
<tr class="memdesc:aa4b8d7c1f3d873b8458c0cfee13af4da"><td class="mdescLeft">&#160;</td><td class="mdescRight">Apply a language weight, insertion penalty, and unigram weight to a language model.  <a href="#aa4b8d7c1f3d873b8458c0cfee13af4da">More...</a><br /></td></tr>
<tr class="separator:aa4b8d7c1f3d873b8458c0cfee13af4da"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a30170c1307e065e1f7159a04f75df304"><td class="memItemLeft" align="right" valign="top">SPHINXBASE_EXPORT float32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="ngram__model_8h.html#a30170c1307e065e1f7159a04f75df304">ngram_model_get_weights</a> (<a class="el" href="ngram__model_8h.html#afaaf0c00e20056d97efcd97e4cae4ea7">ngram_model_t</a> *model, int32 *out_log_wip, int32 *out_log_uw)</td></tr>
<tr class="memdesc:a30170c1307e065e1f7159a04f75df304"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the current weights from a language model.  <a href="#a30170c1307e065e1f7159a04f75df304">More...</a><br /></td></tr>
<tr class="separator:a30170c1307e065e1f7159a04f75df304"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9c23d79885af400e17ac2a1b7169660d"><td class="memItemLeft" align="right" valign="top">SPHINXBASE_EXPORT int32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="ngram__model_8h.html#a9c23d79885af400e17ac2a1b7169660d">ngram_score</a> (<a class="el" href="ngram__model_8h.html#afaaf0c00e20056d97efcd97e4cae4ea7">ngram_model_t</a> *model, const char *word,...)</td></tr>
<tr class="memdesc:a9c23d79885af400e17ac2a1b7169660d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the score (scaled, interpolated log-probability) for a general N-Gram.  <a href="#a9c23d79885af400e17ac2a1b7169660d">More...</a><br /></td></tr>
<tr class="separator:a9c23d79885af400e17ac2a1b7169660d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0f8ad53c1a7cab528113b74aad00f15a"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a0f8ad53c1a7cab528113b74aad00f15a"></a>
SPHINXBASE_EXPORT int32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="ngram__model_8h.html#a0f8ad53c1a7cab528113b74aad00f15a">ngram_tg_score</a> (<a class="el" href="ngram__model_8h.html#afaaf0c00e20056d97efcd97e4cae4ea7">ngram_model_t</a> *model, int32 w3, int32 w2, int32 w1, int32 *n_used)</td></tr>
<tr class="memdesc:a0f8ad53c1a7cab528113b74aad00f15a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Quick trigram score lookup. <br /></td></tr>
<tr class="separator:a0f8ad53c1a7cab528113b74aad00f15a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8c06698fbcb0ef82420088ace045ae81"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a8c06698fbcb0ef82420088ace045ae81"></a>
SPHINXBASE_EXPORT int32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="ngram__model_8h.html#a8c06698fbcb0ef82420088ace045ae81">ngram_bg_score</a> (<a class="el" href="ngram__model_8h.html#afaaf0c00e20056d97efcd97e4cae4ea7">ngram_model_t</a> *model, int32 w2, int32 w1, int32 *n_used)</td></tr>
<tr class="memdesc:a8c06698fbcb0ef82420088ace045ae81"><td class="mdescLeft">&#160;</td><td class="mdescRight">Quick bigram score lookup. <br /></td></tr>
<tr class="separator:a8c06698fbcb0ef82420088ace045ae81"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6ac5799e78ea4ad82a11e2439016471e"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a6ac5799e78ea4ad82a11e2439016471e"></a>
SPHINXBASE_EXPORT int32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="ngram__model_8h.html#a6ac5799e78ea4ad82a11e2439016471e">ngram_ng_score</a> (<a class="el" href="ngram__model_8h.html#afaaf0c00e20056d97efcd97e4cae4ea7">ngram_model_t</a> *model, int32 wid, int32 *history, int32 n_hist, int32 *n_used)</td></tr>
<tr class="memdesc:a6ac5799e78ea4ad82a11e2439016471e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Quick general N-Gram score lookup. <br /></td></tr>
<tr class="separator:a6ac5799e78ea4ad82a11e2439016471e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a68cfda3f503e1a4a87f08aa5a3a5ea88"><td class="memItemLeft" align="right" valign="top">SPHINXBASE_EXPORT int32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="ngram__model_8h.html#a68cfda3f503e1a4a87f08aa5a3a5ea88">ngram_prob</a> (<a class="el" href="ngram__model_8h.html#afaaf0c00e20056d97efcd97e4cae4ea7">ngram_model_t</a> *model, const char *word,...)</td></tr>
<tr class="memdesc:a68cfda3f503e1a4a87f08aa5a3a5ea88"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the "raw" log-probability for a general N-Gram.  <a href="#a68cfda3f503e1a4a87f08aa5a3a5ea88">More...</a><br /></td></tr>
<tr class="separator:a68cfda3f503e1a4a87f08aa5a3a5ea88"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a218d8d140b93d3d8008f8933f9e04ec6"><td class="memItemLeft" align="right" valign="top">SPHINXBASE_EXPORT int32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="ngram__model_8h.html#a218d8d140b93d3d8008f8933f9e04ec6">ngram_ng_prob</a> (<a class="el" href="ngram__model_8h.html#afaaf0c00e20056d97efcd97e4cae4ea7">ngram_model_t</a> *model, int32 wid, int32 *history, int32 n_hist, int32 *n_used)</td></tr>
<tr class="memdesc:a218d8d140b93d3d8008f8933f9e04ec6"><td class="mdescLeft">&#160;</td><td class="mdescRight">Quick "raw" probability lookup for a general N-Gram.  <a href="#a218d8d140b93d3d8008f8933f9e04ec6">More...</a><br /></td></tr>
<tr class="separator:a218d8d140b93d3d8008f8933f9e04ec6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae0cf3a94128927e2be6422d2de34f49b"><td class="memItemLeft" align="right" valign="top">SPHINXBASE_EXPORT int32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="ngram__model_8h.html#ae0cf3a94128927e2be6422d2de34f49b">ngram_score_to_prob</a> (<a class="el" href="ngram__model_8h.html#afaaf0c00e20056d97efcd97e4cae4ea7">ngram_model_t</a> *model, int32 score)</td></tr>
<tr class="memdesc:ae0cf3a94128927e2be6422d2de34f49b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Convert score to "raw" log-probability.  <a href="#ae0cf3a94128927e2be6422d2de34f49b">More...</a><br /></td></tr>
<tr class="separator:ae0cf3a94128927e2be6422d2de34f49b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad03d4355d4ea659815dc25bce8d83880"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ad03d4355d4ea659815dc25bce8d83880"></a>
SPHINXBASE_EXPORT int32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="ngram__model_8h.html#ad03d4355d4ea659815dc25bce8d83880">ngram_wid</a> (<a class="el" href="ngram__model_8h.html#afaaf0c00e20056d97efcd97e4cae4ea7">ngram_model_t</a> *model, const char *word)</td></tr>
<tr class="memdesc:ad03d4355d4ea659815dc25bce8d83880"><td class="mdescLeft">&#160;</td><td class="mdescRight">Look up numerical word ID. <br /></td></tr>
<tr class="separator:ad03d4355d4ea659815dc25bce8d83880"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a96e36290a005c03464ea6c637ccde2f5"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a96e36290a005c03464ea6c637ccde2f5"></a>
SPHINXBASE_EXPORT const char *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="ngram__model_8h.html#a96e36290a005c03464ea6c637ccde2f5">ngram_word</a> (<a class="el" href="ngram__model_8h.html#afaaf0c00e20056d97efcd97e4cae4ea7">ngram_model_t</a> *model, int32 wid)</td></tr>
<tr class="memdesc:a96e36290a005c03464ea6c637ccde2f5"><td class="mdescLeft">&#160;</td><td class="mdescRight">Look up word string for numerical word ID. <br /></td></tr>
<tr class="separator:a96e36290a005c03464ea6c637ccde2f5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1469e9e1c8516a77c9ac1e248a61ef4e"><td class="memItemLeft" align="right" valign="top">SPHINXBASE_EXPORT int32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="ngram__model_8h.html#a1469e9e1c8516a77c9ac1e248a61ef4e">ngram_unknown_wid</a> (<a class="el" href="ngram__model_8h.html#afaaf0c00e20056d97efcd97e4cae4ea7">ngram_model_t</a> *model)</td></tr>
<tr class="memdesc:a1469e9e1c8516a77c9ac1e248a61ef4e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the unknown word ID for a language model.  <a href="#a1469e9e1c8516a77c9ac1e248a61ef4e">More...</a><br /></td></tr>
<tr class="separator:a1469e9e1c8516a77c9ac1e248a61ef4e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae401a87ad55ae64f286dcd83170f7100"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ae401a87ad55ae64f286dcd83170f7100"></a>
SPHINXBASE_EXPORT int32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="ngram__model_8h.html#ae401a87ad55ae64f286dcd83170f7100">ngram_zero</a> (<a class="el" href="ngram__model_8h.html#afaaf0c00e20056d97efcd97e4cae4ea7">ngram_model_t</a> *model)</td></tr>
<tr class="memdesc:ae401a87ad55ae64f286dcd83170f7100"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the "zero" log-probability value for a language model. <br /></td></tr>
<tr class="separator:ae401a87ad55ae64f286dcd83170f7100"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a462d374099a4fe8b3c3195b5e2013545"><td class="memItemLeft" align="right" valign="top">SPHINXBASE_EXPORT int32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="ngram__model_8h.html#a462d374099a4fe8b3c3195b5e2013545">ngram_model_get_size</a> (<a class="el" href="ngram__model_8h.html#afaaf0c00e20056d97efcd97e4cae4ea7">ngram_model_t</a> *model)</td></tr>
<tr class="memdesc:a462d374099a4fe8b3c3195b5e2013545"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the order of the N-gram model (i.e.  <a href="#a462d374099a4fe8b3c3195b5e2013545">More...</a><br /></td></tr>
<tr class="separator:a462d374099a4fe8b3c3195b5e2013545"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a187531aafc1f11214c9d061f75eae194"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a187531aafc1f11214c9d061f75eae194"></a>
SPHINXBASE_EXPORT int32 const *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="ngram__model_8h.html#a187531aafc1f11214c9d061f75eae194">ngram_model_get_counts</a> (<a class="el" href="ngram__model_8h.html#afaaf0c00e20056d97efcd97e4cae4ea7">ngram_model_t</a> *model)</td></tr>
<tr class="memdesc:a187531aafc1f11214c9d061f75eae194"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the counts of the various N-grams in the model. <br /></td></tr>
<tr class="separator:a187531aafc1f11214c9d061f75eae194"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a12683dda2253dc45680102f02fbdb1e2"><td class="memItemLeft" align="right" valign="top">SPHINXBASE_EXPORT <a class="el" href="ngram__model_8h.html#ac7de090a02fa12a8bba84abb4d5236aa">ngram_iter_t</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="ngram__model_8h.html#a12683dda2253dc45680102f02fbdb1e2">ngram_model_mgrams</a> (<a class="el" href="ngram__model_8h.html#afaaf0c00e20056d97efcd97e4cae4ea7">ngram_model_t</a> *model, int m)</td></tr>
<tr class="memdesc:a12683dda2253dc45680102f02fbdb1e2"><td class="mdescLeft">&#160;</td><td class="mdescRight">Iterate over all M-grams.  <a href="#a12683dda2253dc45680102f02fbdb1e2">More...</a><br /></td></tr>
<tr class="separator:a12683dda2253dc45680102f02fbdb1e2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad988e0f41447ee404050caf7c7bb7b63"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ad988e0f41447ee404050caf7c7bb7b63"></a>
SPHINXBASE_EXPORT <a class="el" href="ngram__model_8h.html#ac7de090a02fa12a8bba84abb4d5236aa">ngram_iter_t</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="ngram__model_8h.html#ad988e0f41447ee404050caf7c7bb7b63">ngram_iter</a> (<a class="el" href="ngram__model_8h.html#afaaf0c00e20056d97efcd97e4cae4ea7">ngram_model_t</a> *model, const char *word,...)</td></tr>
<tr class="memdesc:ad988e0f41447ee404050caf7c7bb7b63"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get an iterator over M-grams pointing to the specified M-gram. <br /></td></tr>
<tr class="separator:ad988e0f41447ee404050caf7c7bb7b63"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a461c6e5914ce463422dfeaeee377e024"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a461c6e5914ce463422dfeaeee377e024"></a>
SPHINXBASE_EXPORT <a class="el" href="ngram__model_8h.html#ac7de090a02fa12a8bba84abb4d5236aa">ngram_iter_t</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="ngram__model_8h.html#a461c6e5914ce463422dfeaeee377e024">ngram_ng_iter</a> (<a class="el" href="ngram__model_8h.html#afaaf0c00e20056d97efcd97e4cae4ea7">ngram_model_t</a> *model, int32 wid, int32 *history, int32 n_hist)</td></tr>
<tr class="memdesc:a461c6e5914ce463422dfeaeee377e024"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get an iterator over M-grams pointing to the specified M-gram. <br /></td></tr>
<tr class="separator:a461c6e5914ce463422dfeaeee377e024"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a240c738781daa226a2fc13395dbdb514"><td class="memItemLeft" align="right" valign="top">SPHINXBASE_EXPORT int32 const *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="ngram__model_8h.html#a240c738781daa226a2fc13395dbdb514">ngram_iter_get</a> (<a class="el" href="ngram__model_8h.html#ac7de090a02fa12a8bba84abb4d5236aa">ngram_iter_t</a> *itor, int32 *out_score, int32 *out_bowt)</td></tr>
<tr class="memdesc:a240c738781daa226a2fc13395dbdb514"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get information from the current M-gram in an iterator.  <a href="#a240c738781daa226a2fc13395dbdb514">More...</a><br /></td></tr>
<tr class="separator:a240c738781daa226a2fc13395dbdb514"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae85f41e2defc5b65b12026d29cd4fdaa"><td class="memItemLeft" align="right" valign="top">SPHINXBASE_EXPORT <a class="el" href="ngram__model_8h.html#ac7de090a02fa12a8bba84abb4d5236aa">ngram_iter_t</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="ngram__model_8h.html#ae85f41e2defc5b65b12026d29cd4fdaa">ngram_iter_successors</a> (<a class="el" href="ngram__model_8h.html#ac7de090a02fa12a8bba84abb4d5236aa">ngram_iter_t</a> *itor)</td></tr>
<tr class="memdesc:ae85f41e2defc5b65b12026d29cd4fdaa"><td class="mdescLeft">&#160;</td><td class="mdescRight">Iterate over all M-gram successors of an M-1-gram.  <a href="#ae85f41e2defc5b65b12026d29cd4fdaa">More...</a><br /></td></tr>
<tr class="separator:ae85f41e2defc5b65b12026d29cd4fdaa"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3a2b285c01393b3ebddaec1fefed11a4"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a3a2b285c01393b3ebddaec1fefed11a4"></a>
SPHINXBASE_EXPORT <a class="el" href="ngram__model_8h.html#ac7de090a02fa12a8bba84abb4d5236aa">ngram_iter_t</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="ngram__model_8h.html#a3a2b285c01393b3ebddaec1fefed11a4">ngram_iter_next</a> (<a class="el" href="ngram__model_8h.html#ac7de090a02fa12a8bba84abb4d5236aa">ngram_iter_t</a> *itor)</td></tr>
<tr class="memdesc:a3a2b285c01393b3ebddaec1fefed11a4"><td class="mdescLeft">&#160;</td><td class="mdescRight">Advance an M-gram iterator. <br /></td></tr>
<tr class="separator:a3a2b285c01393b3ebddaec1fefed11a4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac9f746c8a5db78ef8b2fb7c312be4a22"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ac9f746c8a5db78ef8b2fb7c312be4a22"></a>
SPHINXBASE_EXPORT void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="ngram__model_8h.html#ac9f746c8a5db78ef8b2fb7c312be4a22">ngram_iter_free</a> (<a class="el" href="ngram__model_8h.html#ac7de090a02fa12a8bba84abb4d5236aa">ngram_iter_t</a> *itor)</td></tr>
<tr class="memdesc:ac9f746c8a5db78ef8b2fb7c312be4a22"><td class="mdescLeft">&#160;</td><td class="mdescRight">Terminate an M-gram iterator. <br /></td></tr>
<tr class="separator:ac9f746c8a5db78ef8b2fb7c312be4a22"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a38e034d58ee0d6a4c0dd6f852cb71c3c"><td class="memItemLeft" align="right" valign="top">SPHINXBASE_EXPORT int32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="ngram__model_8h.html#a38e034d58ee0d6a4c0dd6f852cb71c3c">ngram_model_add_word</a> (<a class="el" href="ngram__model_8h.html#afaaf0c00e20056d97efcd97e4cae4ea7">ngram_model_t</a> *model, const char *word, float32 weight)</td></tr>
<tr class="memdesc:a38e034d58ee0d6a4c0dd6f852cb71c3c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Add a word (unigram) to the language model.  <a href="#a38e034d58ee0d6a4c0dd6f852cb71c3c">More...</a><br /></td></tr>
<tr class="separator:a38e034d58ee0d6a4c0dd6f852cb71c3c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9b2a86c23543158754373c5456fe890d"><td class="memItemLeft" align="right" valign="top">SPHINXBASE_EXPORT int32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="ngram__model_8h.html#a9b2a86c23543158754373c5456fe890d">ngram_model_read_classdef</a> (<a class="el" href="ngram__model_8h.html#afaaf0c00e20056d97efcd97e4cae4ea7">ngram_model_t</a> *model, const char *file_name)</td></tr>
<tr class="memdesc:a9b2a86c23543158754373c5456fe890d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Read a class definition file and add classes to a language model.  <a href="#a9b2a86c23543158754373c5456fe890d">More...</a><br /></td></tr>
<tr class="separator:a9b2a86c23543158754373c5456fe890d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0481b03a2bf03ef0a197da0a1f7d1caa"><td class="memItemLeft" align="right" valign="top">SPHINXBASE_EXPORT int32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="ngram__model_8h.html#a0481b03a2bf03ef0a197da0a1f7d1caa">ngram_model_add_class</a> (<a class="el" href="ngram__model_8h.html#afaaf0c00e20056d97efcd97e4cae4ea7">ngram_model_t</a> *model, const char *classname, float32 classweight, char **words, const float32 *weights, int32 n_words)</td></tr>
<tr class="memdesc:a0481b03a2bf03ef0a197da0a1f7d1caa"><td class="mdescLeft">&#160;</td><td class="mdescRight">Add a new class to a language model.  <a href="#a0481b03a2bf03ef0a197da0a1f7d1caa">More...</a><br /></td></tr>
<tr class="separator:a0481b03a2bf03ef0a197da0a1f7d1caa"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a39eabb4994cf99c4bc2116e12af0c9f1"><td class="memItemLeft" align="right" valign="top">SPHINXBASE_EXPORT int32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="ngram__model_8h.html#a39eabb4994cf99c4bc2116e12af0c9f1">ngram_model_add_class_word</a> (<a class="el" href="ngram__model_8h.html#afaaf0c00e20056d97efcd97e4cae4ea7">ngram_model_t</a> *model, const char *classname, const char *word, float32 weight)</td></tr>
<tr class="memdesc:a39eabb4994cf99c4bc2116e12af0c9f1"><td class="mdescLeft">&#160;</td><td class="mdescRight">Add a word to a class in a language model.  <a href="#a39eabb4994cf99c4bc2116e12af0c9f1">More...</a><br /></td></tr>
<tr class="separator:a39eabb4994cf99c4bc2116e12af0c9f1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a02310e01a48928e1d430aef0ea3c9a99"><td class="memItemLeft" align="right" valign="top">SPHINXBASE_EXPORT <a class="el" href="ngram__model_8h.html#afaaf0c00e20056d97efcd97e4cae4ea7">ngram_model_t</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="ngram__model_8h.html#a02310e01a48928e1d430aef0ea3c9a99">ngram_model_set_init</a> (<a class="el" href="structcmd__ln__t.html">cmd_ln_t</a> *config, <a class="el" href="ngram__model_8h.html#afaaf0c00e20056d97efcd97e4cae4ea7">ngram_model_t</a> **models, char **names, const float32 *weights, int32 n_models)</td></tr>
<tr class="memdesc:a02310e01a48928e1d430aef0ea3c9a99"><td class="mdescLeft">&#160;</td><td class="mdescRight">Create a set of language models sharing a common space of word IDs.  <a href="#a02310e01a48928e1d430aef0ea3c9a99">More...</a><br /></td></tr>
<tr class="separator:a02310e01a48928e1d430aef0ea3c9a99"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:afb7b13dbb4a3149b2fa9f7b15dbe35e8"><td class="memItemLeft" align="right" valign="top">SPHINXBASE_EXPORT <a class="el" href="ngram__model_8h.html#afaaf0c00e20056d97efcd97e4cae4ea7">ngram_model_t</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="ngram__model_8h.html#afb7b13dbb4a3149b2fa9f7b15dbe35e8">ngram_model_set_read</a> (<a class="el" href="structcmd__ln__t.html">cmd_ln_t</a> *config, const char *lmctlfile, <a class="el" href="logmath_8h.html#ae613aa7db1dd40ff56a80a7dadb22cc8">logmath_t</a> *lmath)</td></tr>
<tr class="memdesc:afb7b13dbb4a3149b2fa9f7b15dbe35e8"><td class="mdescLeft">&#160;</td><td class="mdescRight">Read a set of language models from a control file.  <a href="#afb7b13dbb4a3149b2fa9f7b15dbe35e8">More...</a><br /></td></tr>
<tr class="separator:afb7b13dbb4a3149b2fa9f7b15dbe35e8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a22b8f5f49231b4aef3d5a166ea7155b6"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a22b8f5f49231b4aef3d5a166ea7155b6"></a>
SPHINXBASE_EXPORT int32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="ngram__model_8h.html#a22b8f5f49231b4aef3d5a166ea7155b6">ngram_model_set_count</a> (<a class="el" href="ngram__model_8h.html#afaaf0c00e20056d97efcd97e4cae4ea7">ngram_model_t</a> *set)</td></tr>
<tr class="memdesc:a22b8f5f49231b4aef3d5a166ea7155b6"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the number of language models in a set. <br /></td></tr>
<tr class="separator:a22b8f5f49231b4aef3d5a166ea7155b6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a880c7768b082a124e1b6f6f1a764b1e3"><td class="memItemLeft" align="right" valign="top">SPHINXBASE_EXPORT <br class="typebreak" />
<a class="el" href="ngram__model_8h.html#afffd75c5bde8dd84107449468be48547">ngram_model_set_iter_t</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="ngram__model_8h.html#a880c7768b082a124e1b6f6f1a764b1e3">ngram_model_set_iter</a> (<a class="el" href="ngram__model_8h.html#afaaf0c00e20056d97efcd97e4cae4ea7">ngram_model_t</a> *set)</td></tr>
<tr class="memdesc:a880c7768b082a124e1b6f6f1a764b1e3"><td class="mdescLeft">&#160;</td><td class="mdescRight">Begin iterating over language models in a set.  <a href="#a880c7768b082a124e1b6f6f1a764b1e3">More...</a><br /></td></tr>
<tr class="separator:a880c7768b082a124e1b6f6f1a764b1e3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a038a174f17632703cffce02611149265"><td class="memItemLeft" align="right" valign="top">SPHINXBASE_EXPORT <br class="typebreak" />
<a class="el" href="ngram__model_8h.html#afffd75c5bde8dd84107449468be48547">ngram_model_set_iter_t</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="ngram__model_8h.html#a038a174f17632703cffce02611149265">ngram_model_set_iter_next</a> (<a class="el" href="ngram__model_8h.html#afffd75c5bde8dd84107449468be48547">ngram_model_set_iter_t</a> *itor)</td></tr>
<tr class="memdesc:a038a174f17632703cffce02611149265"><td class="mdescLeft">&#160;</td><td class="mdescRight">Move to the next language model in a set.  <a href="#a038a174f17632703cffce02611149265">More...</a><br /></td></tr>
<tr class="separator:a038a174f17632703cffce02611149265"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae5b58f360ab6432528ffaead1d2b2a2d"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ae5b58f360ab6432528ffaead1d2b2a2d"></a>
SPHINXBASE_EXPORT void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="ngram__model_8h.html#ae5b58f360ab6432528ffaead1d2b2a2d">ngram_model_set_iter_free</a> (<a class="el" href="ngram__model_8h.html#afffd75c5bde8dd84107449468be48547">ngram_model_set_iter_t</a> *itor)</td></tr>
<tr class="memdesc:ae5b58f360ab6432528ffaead1d2b2a2d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Finish iteration over a langauge model set. <br /></td></tr>
<tr class="separator:ae5b58f360ab6432528ffaead1d2b2a2d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a438592444037281175150e3cf1543052"><td class="memItemLeft" align="right" valign="top">SPHINXBASE_EXPORT <a class="el" href="ngram__model_8h.html#afaaf0c00e20056d97efcd97e4cae4ea7">ngram_model_t</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="ngram__model_8h.html#a438592444037281175150e3cf1543052">ngram_model_set_iter_model</a> (<a class="el" href="ngram__model_8h.html#afffd75c5bde8dd84107449468be48547">ngram_model_set_iter_t</a> *itor, char const **lmname)</td></tr>
<tr class="memdesc:a438592444037281175150e3cf1543052"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get language model and associated name from an iterator.  <a href="#a438592444037281175150e3cf1543052">More...</a><br /></td></tr>
<tr class="separator:a438592444037281175150e3cf1543052"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5e7a3fd20d32783ce07b760781f658f8"><td class="memItemLeft" align="right" valign="top">SPHINXBASE_EXPORT <a class="el" href="ngram__model_8h.html#afaaf0c00e20056d97efcd97e4cae4ea7">ngram_model_t</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="ngram__model_8h.html#a5e7a3fd20d32783ce07b760781f658f8">ngram_model_set_select</a> (<a class="el" href="ngram__model_8h.html#afaaf0c00e20056d97efcd97e4cae4ea7">ngram_model_t</a> *set, const char *name)</td></tr>
<tr class="memdesc:a5e7a3fd20d32783ce07b760781f658f8"><td class="mdescLeft">&#160;</td><td class="mdescRight">Select a single language model from a set for scoring.  <a href="#a5e7a3fd20d32783ce07b760781f658f8">More...</a><br /></td></tr>
<tr class="separator:a5e7a3fd20d32783ce07b760781f658f8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1797a53b95a2a1ca2a6be732918d9fa0"><td class="memItemLeft" align="right" valign="top">SPHINXBASE_EXPORT <a class="el" href="ngram__model_8h.html#afaaf0c00e20056d97efcd97e4cae4ea7">ngram_model_t</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="ngram__model_8h.html#a1797a53b95a2a1ca2a6be732918d9fa0">ngram_model_set_lookup</a> (<a class="el" href="ngram__model_8h.html#afaaf0c00e20056d97efcd97e4cae4ea7">ngram_model_t</a> *set, const char *name)</td></tr>
<tr class="memdesc:a1797a53b95a2a1ca2a6be732918d9fa0"><td class="mdescLeft">&#160;</td><td class="mdescRight">Look up a language model by name from a set.  <a href="#a1797a53b95a2a1ca2a6be732918d9fa0">More...</a><br /></td></tr>
<tr class="separator:a1797a53b95a2a1ca2a6be732918d9fa0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a95a4da1562cb6d67a01a733bd0bbb436"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a95a4da1562cb6d67a01a733bd0bbb436"></a>
SPHINXBASE_EXPORT const char *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="ngram__model_8h.html#a95a4da1562cb6d67a01a733bd0bbb436">ngram_model_set_current</a> (<a class="el" href="ngram__model_8h.html#afaaf0c00e20056d97efcd97e4cae4ea7">ngram_model_t</a> *set)</td></tr>
<tr class="memdesc:a95a4da1562cb6d67a01a733bd0bbb436"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the current language model name, if any. <br /></td></tr>
<tr class="separator:a95a4da1562cb6d67a01a733bd0bbb436"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8a4c853e77c6b48face3a781480e77d6"><td class="memItemLeft" align="right" valign="top">SPHINXBASE_EXPORT <a class="el" href="ngram__model_8h.html#afaaf0c00e20056d97efcd97e4cae4ea7">ngram_model_t</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="ngram__model_8h.html#a8a4c853e77c6b48face3a781480e77d6">ngram_model_set_interp</a> (<a class="el" href="ngram__model_8h.html#afaaf0c00e20056d97efcd97e4cae4ea7">ngram_model_t</a> *set, const char **names, const float32 *weights)</td></tr>
<tr class="memdesc:a8a4c853e77c6b48face3a781480e77d6"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set interpolation weights for a set and enables interpolation.  <a href="#a8a4c853e77c6b48face3a781480e77d6">More...</a><br /></td></tr>
<tr class="separator:a8a4c853e77c6b48face3a781480e77d6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aab34758e97f75733330f3f4cff8a5311"><td class="memItemLeft" align="right" valign="top">SPHINXBASE_EXPORT <a class="el" href="ngram__model_8h.html#afaaf0c00e20056d97efcd97e4cae4ea7">ngram_model_t</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="ngram__model_8h.html#aab34758e97f75733330f3f4cff8a5311">ngram_model_set_add</a> (<a class="el" href="ngram__model_8h.html#afaaf0c00e20056d97efcd97e4cae4ea7">ngram_model_t</a> *set, <a class="el" href="ngram__model_8h.html#afaaf0c00e20056d97efcd97e4cae4ea7">ngram_model_t</a> *model, const char *name, float32 weight, int reuse_widmap)</td></tr>
<tr class="memdesc:aab34758e97f75733330f3f4cff8a5311"><td class="mdescLeft">&#160;</td><td class="mdescRight">Add a language model to a set.  <a href="#aab34758e97f75733330f3f4cff8a5311">More...</a><br /></td></tr>
<tr class="separator:aab34758e97f75733330f3f4cff8a5311"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af761011a07b87c209e6d174e07b34617"><td class="memItemLeft" align="right" valign="top">SPHINXBASE_EXPORT <a class="el" href="ngram__model_8h.html#afaaf0c00e20056d97efcd97e4cae4ea7">ngram_model_t</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="ngram__model_8h.html#af761011a07b87c209e6d174e07b34617">ngram_model_set_remove</a> (<a class="el" href="ngram__model_8h.html#afaaf0c00e20056d97efcd97e4cae4ea7">ngram_model_t</a> *set, const char *name, int reuse_widmap)</td></tr>
<tr class="memdesc:af761011a07b87c209e6d174e07b34617"><td class="mdescLeft">&#160;</td><td class="mdescRight">Remove a language model from a set.  <a href="#af761011a07b87c209e6d174e07b34617">More...</a><br /></td></tr>
<tr class="separator:af761011a07b87c209e6d174e07b34617"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3e8abe87ae12cfbe1b79fd99213abe2d"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a3e8abe87ae12cfbe1b79fd99213abe2d"></a>
SPHINXBASE_EXPORT void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="ngram__model_8h.html#a3e8abe87ae12cfbe1b79fd99213abe2d">ngram_model_set_map_words</a> (<a class="el" href="ngram__model_8h.html#afaaf0c00e20056d97efcd97e4cae4ea7">ngram_model_t</a> *set, const char **words, int32 n_words)</td></tr>
<tr class="memdesc:a3e8abe87ae12cfbe1b79fd99213abe2d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set the word-to-ID mapping for this model set. <br /></td></tr>
<tr class="separator:a3e8abe87ae12cfbe1b79fd99213abe2d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af783553aa7527b7544d093aaea74d97a"><td class="memItemLeft" align="right" valign="top">SPHINXBASE_EXPORT int32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="ngram__model_8h.html#af783553aa7527b7544d093aaea74d97a">ngram_model_set_current_wid</a> (<a class="el" href="ngram__model_8h.html#afaaf0c00e20056d97efcd97e4cae4ea7">ngram_model_t</a> *set, int32 set_wid)</td></tr>
<tr class="memdesc:af783553aa7527b7544d093aaea74d97a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Query the word-ID mapping for the current language model.  <a href="#af783553aa7527b7544d093aaea74d97a">More...</a><br /></td></tr>
<tr class="separator:af783553aa7527b7544d093aaea74d97a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad87975912cfe1ac5d0c3ebe12de79209"><td class="memItemLeft" align="right" valign="top">SPHINXBASE_EXPORT int32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="ngram__model_8h.html#ad87975912cfe1ac5d0c3ebe12de79209">ngram_model_set_known_wid</a> (<a class="el" href="ngram__model_8h.html#afaaf0c00e20056d97efcd97e4cae4ea7">ngram_model_t</a> *set, int32 set_wid)</td></tr>
<tr class="memdesc:ad87975912cfe1ac5d0c3ebe12de79209"><td class="mdescLeft">&#160;</td><td class="mdescRight">Test whether a word ID corresponds to a known word in the current state of the language model set.  <a href="#ad87975912cfe1ac5d0c3ebe12de79209">More...</a><br /></td></tr>
<tr class="separator:ad87975912cfe1ac5d0c3ebe12de79209"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8304f56d82278824b0a94c254d7235aa"><td class="memItemLeft" align="right" valign="top">SPHINXBASE_EXPORT void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="ngram__model_8h.html#a8304f56d82278824b0a94c254d7235aa">ngram_model_flush</a> (<a class="el" href="ngram__model_8h.html#afaaf0c00e20056d97efcd97e4cae4ea7">ngram_model_t</a> *lm)</td></tr>
<tr class="memdesc:a8304f56d82278824b0a94c254d7235aa"><td class="mdescLeft">&#160;</td><td class="mdescRight">Flush any cached N-Gram information.  <a href="#a8304f56d82278824b0a94c254d7235aa">More...</a><br /></td></tr>
<tr class="separator:a8304f56d82278824b0a94c254d7235aa"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>N-Gram language models. </p>
<dl class="section author"><dt>Author</dt><dd>David Huggins-Daines <a href="#" onclick="location.href='mai'+'lto:'+'dhu'+'gg'+'ins'+'@c'+'s.c'+'mu'+'.ed'+'u'; return false;">dhugg<span style="display: none;">.nosp@m.</span>ins@<span style="display: none;">.nosp@m.</span>cs.cm<span style="display: none;">.nosp@m.</span>u.ed<span style="display: none;">.nosp@m.</span>u</a> </dd></dl>

<p>Definition in file <a class="el" href="ngram__model_8h_source.html">ngram_model.h</a>.</p>
</div><h2 class="groupheader">Enumeration Type Documentation</h2>
<a class="anchor" id="a406c0d64c15a9d1749d07c8ab6e0ae74"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="ngram__model_8h.html#a406c0d64c15a9d1749d07c8ab6e0ae74">ngram_file_type_e</a></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>File types for N-Gram files. </p>
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a class="anchor" id="a406c0d64c15a9d1749d07c8ab6e0ae74a2cf596c8b0c63a3a0ba1fe33326cc796"></a>NGRAM_INVALID&#160;</td><td class="fielddoc">
<p>Not a valid file type. </p>
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="a406c0d64c15a9d1749d07c8ab6e0ae74a441701bf8ae0a2b79716feb31b5f257a"></a>NGRAM_AUTO&#160;</td><td class="fielddoc">
<p>Determine file type automatically. </p>
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="a406c0d64c15a9d1749d07c8ab6e0ae74a77ef2341d826b3cc8b836e3af1efba99"></a>NGRAM_ARPA&#160;</td><td class="fielddoc">
<p>ARPABO text format (the standard). </p>
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="a406c0d64c15a9d1749d07c8ab6e0ae74addfc3620d0fbc6f05f7f8e455245dd92"></a>NGRAM_DMP&#160;</td><td class="fielddoc">
<p>Sphinx .DMP format. </p>
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="a406c0d64c15a9d1749d07c8ab6e0ae74ab8fe83d2dec88c1c8cb4d82a8a528bb8"></a>NGRAM_DMP32&#160;</td><td class="fielddoc">
<p>Sphinx .DMP32 format (NOT SUPPORTED) </p>
</td></tr>
</table>

<p>Definition at line <a class="el" href="ngram__model_8h_source.html#l00076">76</a> of file <a class="el" href="ngram__model_8h_source.html">ngram_model.h</a>.</p>

</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a class="anchor" id="ad758d3f491d501bdec2ada8088e9b656"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">SPHINXBASE_EXPORT <a class="el" href="ngram__model_8h.html#a0e7d02703c48237b2afea436392dcb82">ngram_file_type_t</a> ngram_file_name_to_type </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>file_name</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Guess the file type for an N-Gram model from the filename. </p>
<dl class="section return"><dt>Returns</dt><dd>the guessed file type, or NGRAM_INVALID if none could be guessed. </dd></dl>

<p>Definition at line <a class="el" href="ngram__model_8c_source.html#l00064">64</a> of file <a class="el" href="ngram__model_8c_source.html">ngram_model.c</a>.</p>

<p>References <a class="el" href="ngram__model_8h_source.html#l00079">NGRAM_ARPA</a>, <a class="el" href="ngram__model_8h_source.html#l00080">NGRAM_DMP</a>, <a class="el" href="ngram__model_8h_source.html#l00077">NGRAM_INVALID</a>, <a class="el" href="case_8c_source.html#l00094">strcmp_nocase()</a>, and <a class="el" href="case_8c_source.html#l00119">strncmp_nocase()</a>.</p>

<p>Referenced by <a class="el" href="ngram__model_8c_source.html#l00167">ngram_model_write()</a>.</p>

</div>
</div>
<a class="anchor" id="a240c738781daa226a2fc13395dbdb514"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">SPHINXBASE_EXPORT int32 const* ngram_iter_get </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="ngram__model_8h.html#ac7de090a02fa12a8bba84abb4d5236aa">ngram_iter_t</a> *&#160;</td>
          <td class="paramname"><em>itor</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int32 *&#160;</td>
          <td class="paramname"><em>out_score</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int32 *&#160;</td>
          <td class="paramname"><em>out_bowt</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Get information from the current M-gram in an iterator. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">out_score</td><td>Output: Score for this M-gram (including any word penalty and language weight). </td></tr>
    <tr><td class="paramname">out_bowt</td><td>Output: Backoff weight for this M-gram. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>read-only array of word IDs. </dd></dl>

<p>Definition at line <a class="el" href="ngram__model_8c_source.html#l00750">750</a> of file <a class="el" href="ngram__model_8c_source.html">ngram_model.c</a>.</p>

<p>References <a class="el" href="ngram__model__internal_8h_source.html#l00077">ngram_model_s::funcs</a>, and <a class="el" href="ngram__model__internal_8h_source.html#l00175">ngram_funcs_s::iter_get</a>.</p>

</div>
</div>
<a class="anchor" id="ae85f41e2defc5b65b12026d29cd4fdaa"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">SPHINXBASE_EXPORT <a class="el" href="ngram__model_8h.html#ac7de090a02fa12a8bba84abb4d5236aa">ngram_iter_t</a>* ngram_iter_successors </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="ngram__model_8h.html#ac7de090a02fa12a8bba84abb4d5236aa">ngram_iter_t</a> *&#160;</td>
          <td class="paramname"><em>itor</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Iterate over all M-gram successors of an M-1-gram. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">itor</td><td>Iterator pointing to the M-1-gram to get successors of. </td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="ngram__model_8c_source.html#l00741">741</a> of file <a class="el" href="ngram__model_8c_source.html">ngram_model.c</a>.</p>

<p>References <a class="el" href="ngram__model__internal_8h_source.html#l00077">ngram_model_s::funcs</a>, <a class="el" href="ngram__model__internal_8h_source.html#l00196">ngram_iter_s::m</a>, <a class="el" href="ngram__model__internal_8h_source.html#l00061">ngram_model_s::n</a>, and <a class="el" href="ngram__model__internal_8h_source.html#l00170">ngram_funcs_s::successors</a>.</p>

</div>
</div>
<a class="anchor" id="a0481b03a2bf03ef0a197da0a1f7d1caa"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">SPHINXBASE_EXPORT int32 ngram_model_add_class </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="ngram__model_8h.html#afaaf0c00e20056d97efcd97e4cae4ea7">ngram_model_t</a> *&#160;</td>
          <td class="paramname"><em>model</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>classname</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">float32&#160;</td>
          <td class="paramname"><em>classweight</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">char **&#160;</td>
          <td class="paramname"><em>words</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const float32 *&#160;</td>
          <td class="paramname"><em>weights</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int32&#160;</td>
          <td class="paramname"><em>n_words</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Add a new class to a language model. </p>
<p>If <code>classname</code> already exists in the unigram set for <code>model</code>, then it will be converted to a class tag, and <code>classweight</code> will be ignored. Otherwise, a new unigram will be created as in <a class="el" href="ngram__model_8h.html#a38e034d58ee0d6a4c0dd6f852cb71c3c" title="Add a word (unigram) to the language model. ">ngram_model_add_word()</a>. </p>

<p>Definition at line <a class="el" href="ngram__model_8c_source.html#l01005">1005</a> of file <a class="el" href="ngram__model_8c_source.html">ngram_model.c</a>.</p>

<p>References <a class="el" href="ckd__alloc_8h_source.html#l00248">ckd_calloc</a>, <a class="el" href="ckd__alloc_8h_source.html#l00258">ckd_realloc</a>, <a class="el" href="ngram__model__internal_8h_source.html#l00076">ngram_model_s::classes</a>, <a class="el" href="err_8h_source.html#l00169">E_ERROR</a>, <a class="el" href="glist_8c_source.html#l00110">glist_add_float32()</a>, <a class="el" href="glist_8c_source.html#l00133">glist_free()</a>, <a class="el" href="glist_8c_source.html#l00169">glist_reverse()</a>, <a class="el" href="ngram__model__internal_8h_source.html#l00062">ngram_model_s::n_classes</a>, <a class="el" href="ngram__model_8h_source.html#l00084">NGRAM_INVALID_WID</a>, <a class="el" href="ngram__model_8c_source.html#l00832">ngram_model_add_word()</a>, <a class="el" href="ngram__model_8c_source.html#l00644">ngram_unknown_wid()</a>, and <a class="el" href="ngram__model_8c_source.html#l00771">ngram_wid()</a>.</p>

<p>Referenced by <a class="el" href="ngram__model_8c_source.html#l01199">ngram_model_read_classdef()</a>, and <a class="el" href="ngram__model__set_8c_source.html#l00182">ngram_model_set_read()</a>.</p>

</div>
</div>
<a class="anchor" id="a39eabb4994cf99c4bc2116e12af0c9f1"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">SPHINXBASE_EXPORT int32 ngram_model_add_class_word </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="ngram__model_8h.html#afaaf0c00e20056d97efcd97e4cae4ea7">ngram_model_t</a> *&#160;</td>
          <td class="paramname"><em>model</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>classname</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>word</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">float32&#160;</td>
          <td class="paramname"><em>weight</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Add a word to a class in a language model. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">model</td><td>The model to add a word to. </td></tr>
    <tr><td class="paramname">classname</td><td>Name of the class to add this word to. </td></tr>
    <tr><td class="paramname">word</td><td>Text of the word to add. </td></tr>
    <tr><td class="paramname">weight</td><td>Weight of this word relative to the within-class uniform distribution. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The word ID for the new word. </dd></dl>

<p>Definition at line <a class="el" href="ngram__model_8c_source.html#l00955">955</a> of file <a class="el" href="ngram__model_8c_source.html">ngram_model.c</a>.</p>

<p>References <a class="el" href="ngram__model__internal_8h_source.html#l00076">ngram_model_s::classes</a>, <a class="el" href="err_8h_source.html#l00169">E_ERROR</a>, <a class="el" href="ngram__model__internal_8h_source.html#l00066">ngram_model_s::lmath</a>, <a class="el" href="logmath_8c_source.html#l00447">logmath_log()</a>, <a class="el" href="ngram__model__internal_8h_source.html#l00062">ngram_model_s::n_classes</a>, <a class="el" href="ngram__model__internal_8h_source.html#l00096">ngram_class_s::n_hash</a>, <a class="el" href="ngram__model__internal_8h_source.html#l00097">ngram_class_s::n_hash_inuse</a>, <a class="el" href="ngram__model__internal_8h_source.html#l00086">ngram_class_s::n_words</a>, <a class="el" href="ngram__model_8h_source.html#l00084">NGRAM_INVALID_WID</a>, <a class="el" href="ngram__model_8c_source.html#l00771">ngram_wid()</a>, <a class="el" href="ngram__model__internal_8h_source.html#l00087">ngram_class_s::prob1</a>, <a class="el" href="ngram__model__internal_8h_source.html#l00093">ngram_class_s::ngram_hash_s::prob1</a>, <a class="el" href="ngram__model__internal_8h_source.html#l00084">ngram_class_s::tag_wid</a>, and <a class="el" href="ngram__model__internal_8h_source.html#l00092">ngram_class_s::ngram_hash_s::wid</a>.</p>

</div>
</div>
<a class="anchor" id="a38e034d58ee0d6a4c0dd6f852cb71c3c"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">SPHINXBASE_EXPORT int32 ngram_model_add_word </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="ngram__model_8h.html#afaaf0c00e20056d97efcd97e4cae4ea7">ngram_model_t</a> *&#160;</td>
          <td class="paramname"><em>model</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>word</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">float32&#160;</td>
          <td class="paramname"><em>weight</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Add a word (unigram) to the language model. </p>
<dl class="section note"><dt>Note</dt><dd>The semantics of this are not particularly well-defined for model sets, and may be subject to change. Currently this will add the word to all of the submodels</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">model</td><td>The model to add a word to. </td></tr>
    <tr><td class="paramname">word</td><td>Text of the word to add. </td></tr>
    <tr><td class="paramname">weight</td><td>Weight of this word relative to the uniform distribution. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The word ID for the new word. </dd></dl>

<p>Definition at line <a class="el" href="ngram__model_8c_source.html#l00832">832</a> of file <a class="el" href="ngram__model_8c_source.html">ngram_model.c</a>.</p>

<p>References <a class="el" href="ngram__model__internal_8h_source.html#l00150">ngram_funcs_s::add_ug</a>, <a class="el" href="err_8h_source.html#l00164">E_WARN</a>, <a class="el" href="ngram__model__internal_8h_source.html#l00077">ngram_model_s::funcs</a>, <a class="el" href="ngram__model__internal_8h_source.html#l00066">ngram_model_s::lmath</a>, <a class="el" href="ngram__model__internal_8h_source.html#l00072">ngram_model_s::log_zero</a>, <a class="el" href="logmath_8c_source.html#l00447">logmath_log()</a>, <a class="el" href="ngram__model_8h_source.html#l00084">NGRAM_INVALID_WID</a>, and <a class="el" href="ngram__model__internal_8h_source.html#l00063">ngram_model_s::writable</a>.</p>

<p>Referenced by <a class="el" href="ngram__model_8c_source.html#l01005">ngram_model_add_class()</a>.</p>

</div>
</div>
<a class="anchor" id="aa4b8d7c1f3d873b8458c0cfee13af4da"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">SPHINXBASE_EXPORT int ngram_model_apply_weights </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="ngram__model_8h.html#afaaf0c00e20056d97efcd97e4cae4ea7">ngram_model_t</a> *&#160;</td>
          <td class="paramname"><em>model</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">float32&#160;</td>
          <td class="paramname"><em>lw</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">float32&#160;</td>
          <td class="paramname"><em>wip</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">float32&#160;</td>
          <td class="paramname"><em>uw</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Apply a language weight, insertion penalty, and unigram weight to a language model. </p>
<p>This will change the values output by <a class="el" href="ngram__model_8h.html#a9c23d79885af400e17ac2a1b7169660d" title="Get the score (scaled, interpolated log-probability) for a general N-Gram. ">ngram_score()</a> and friends. This is done for efficiency since in decoding, these are the only values we actually need. Call <a class="el" href="ngram__model_8h.html#a68cfda3f503e1a4a87f08aa5a3a5ea88" title="Get the &quot;raw&quot; log-probability for a general N-Gram. ">ngram_prob()</a> if you want the "raw" N-Gram probability estimate.</p>
<p>To remove all weighting, call ngram_apply_weights(model, 1.0, 1.0, 1.0). </p>

<p>Definition at line <a class="el" href="ngram__model_8c_source.html#l00477">477</a> of file <a class="el" href="ngram__model_8c_source.html">ngram_model.c</a>.</p>

<p>References <a class="el" href="ngram__model__internal_8h_source.html#l00118">ngram_funcs_s::apply_weights</a>, and <a class="el" href="ngram__model__internal_8h_source.html#l00077">ngram_model_s::funcs</a>.</p>

<p>Referenced by <a class="el" href="ngram__model_8c_source.html#l00121">ngram_model_read()</a>.</p>

</div>
</div>
<a class="anchor" id="a41b938a2c4b129dc0df37b2312d65506"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">SPHINXBASE_EXPORT int ngram_model_casefold </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="ngram__model_8h.html#afaaf0c00e20056d97efcd97e4cae4ea7">ngram_model_t</a> *&#160;</td>
          <td class="paramname"><em>model</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>kase</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Case-fold word strings in an N-Gram model. </p>
<p>WARNING: This is not Unicode aware, so any non-ASCII characters will not be converted. </p>

<p>Definition at line <a class="el" href="ngram__model_8c_source.html#l00299">299</a> of file <a class="el" href="ngram__model_8c_source.html">ngram_model.c</a>.</p>

<p>References <a class="el" href="ckd__alloc_8h_source.html#l00264">ckd_salloc</a>, <a class="el" href="err_8h_source.html#l00164">E_WARN</a>, <a class="el" href="hash__table_8h_source.html#l00228">hash_table_enter_int32</a>, <a class="el" href="hash__table_8c_source.html#l00695">hash_table_free()</a>, <a class="el" href="hash__table_8c_source.html#l00158">hash_table_new()</a>, <a class="el" href="case_8h.html#ac0e30dac40f15762f39270f65bd8cdba">lcase()</a>, <a class="el" href="ngram__model__internal_8h_source.html#l00059">ngram_model_s::n_words</a>, <a class="el" href="case_8h.html#a79d99e36b7c2c36dcc6f7f0df746384e">ucase()</a>, <a class="el" href="ngram__model__internal_8h_source.html#l00074">ngram_model_s::wid</a>, <a class="el" href="ngram__model__internal_8h_source.html#l00073">ngram_model_s::word_str</a>, and <a class="el" href="ngram__model__internal_8h_source.html#l00063">ngram_model_s::writable</a>.</p>

</div>
</div>
<a class="anchor" id="a8304f56d82278824b0a94c254d7235aa"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">SPHINXBASE_EXPORT void ngram_model_flush </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="ngram__model_8h.html#afaaf0c00e20056d97efcd97e4cae4ea7">ngram_model_t</a> *&#160;</td>
          <td class="paramname"><em>lm</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Flush any cached N-Gram information. </p>
<p>Some types of models cache trigram or other N-Gram information to speed repeated access to N-Grams with shared histories. This function flushes the cache so as to avoid dynamic memory leaks. </p>

<p>Definition at line <a class="el" href="ngram__model_8c_source.html#l00247">247</a> of file <a class="el" href="ngram__model_8c_source.html">ngram_model.c</a>.</p>

<p>References <a class="el" href="ngram__model__internal_8h_source.html#l00155">ngram_funcs_s::flush</a>, and <a class="el" href="ngram__model__internal_8h_source.html#l00077">ngram_model_s::funcs</a>.</p>

</div>
</div>
<a class="anchor" id="aec73d28e7285e539a0b44a7ac0cbe489"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">SPHINXBASE_EXPORT int ngram_model_free </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="ngram__model_8h.html#afaaf0c00e20056d97efcd97e4cae4ea7">ngram_model_t</a> *&#160;</td>
          <td class="paramname"><em>model</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Release memory associated with an N-Gram model. </p>
<dl class="section return"><dt>Returns</dt><dd>new reference count (0 if freed completely) </dd></dl>

<p>Definition at line <a class="el" href="ngram__model_8c_source.html#l00254">254</a> of file <a class="el" href="ngram__model_8c_source.html">ngram_model.c</a>.</p>

<p>References <a class="el" href="ckd__alloc_8c_source.html#l00241">ckd_free()</a>, <a class="el" href="ngram__model__internal_8h_source.html#l00076">ngram_model_s::classes</a>, <a class="el" href="ngram__model__internal_8h_source.html#l00114">ngram_funcs_s::free</a>, <a class="el" href="ngram__model__internal_8h_source.html#l00077">ngram_model_s::funcs</a>, <a class="el" href="hash__table_8c_source.html#l00695">hash_table_free()</a>, <a class="el" href="ngram__model__internal_8h_source.html#l00062">ngram_model_s::n_classes</a>, <a class="el" href="ngram__model__internal_8h_source.html#l00057">ngram_model_s::n_counts</a>, <a class="el" href="ngram__model__internal_8h_source.html#l00096">ngram_class_s::n_hash</a>, <a class="el" href="ngram__model__internal_8h_source.html#l00059">ngram_model_s::n_words</a>, <a class="el" href="ngram__model__internal_8h_source.html#l00086">ngram_class_s::n_words</a>, <a class="el" href="ngram__model__internal_8h_source.html#l00056">ngram_model_s::refcount</a>, <a class="el" href="ngram__model__internal_8h_source.html#l00085">ngram_class_s::start_wid</a>, <a class="el" href="ngram__model__internal_8h_source.html#l00074">ngram_model_s::wid</a>, <a class="el" href="ngram__model__internal_8h_source.html#l00092">ngram_class_s::ngram_hash_s::wid</a>, <a class="el" href="ngram__model__internal_8h_source.html#l00073">ngram_model_s::word_str</a>, and <a class="el" href="ngram__model__internal_8h_source.html#l00063">ngram_model_s::writable</a>.</p>

<p>Referenced by <a class="el" href="ngram__model__set_8c_source.html#l00182">ngram_model_set_read()</a>.</p>

</div>
</div>
<a class="anchor" id="a462d374099a4fe8b3c3195b5e2013545"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">SPHINXBASE_EXPORT int32 ngram_model_get_size </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="ngram__model_8h.html#afaaf0c00e20056d97efcd97e4cae4ea7">ngram_model_t</a> *&#160;</td>
          <td class="paramname"><em>model</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Get the order of the N-gram model (i.e. </p>
<p>the "N" in "N-gram") </p>

<p>Definition at line <a class="el" href="ngram__model_8c_source.html#l00663">663</a> of file <a class="el" href="ngram__model_8c_source.html">ngram_model.c</a>.</p>

<p>References <a class="el" href="ngram__model__internal_8h_source.html#l00061">ngram_model_s::n</a>.</p>

</div>
</div>
<a class="anchor" id="a30170c1307e065e1f7159a04f75df304"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">SPHINXBASE_EXPORT float32 ngram_model_get_weights </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="ngram__model_8h.html#afaaf0c00e20056d97efcd97e4cae4ea7">ngram_model_t</a> *&#160;</td>
          <td class="paramname"><em>model</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int32 *&#160;</td>
          <td class="paramname"><em>out_log_wip</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int32 *&#160;</td>
          <td class="paramname"><em>out_log_uw</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Get the current weights from a language model. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">model</td><td>The model in question. </td></tr>
    <tr><td class="paramname">out_log_wip</td><td>Output: (optional) logarithm of word insertion penalty. </td></tr>
    <tr><td class="paramname">out_log_uw</td><td>Output: (optional) logarithm of unigram weight. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>language weight. </dd></dl>

<p>Definition at line <a class="el" href="ngram__model_8c_source.html#l00484">484</a> of file <a class="el" href="ngram__model_8c_source.html">ngram_model.c</a>.</p>

<p>References <a class="el" href="ngram__model__internal_8h_source.html#l00069">ngram_model_s::log_uw</a>, <a class="el" href="ngram__model__internal_8h_source.html#l00068">ngram_model_s::log_wip</a>, and <a class="el" href="ngram__model__internal_8h_source.html#l00067">ngram_model_s::lw</a>.</p>

</div>
</div>
<a class="anchor" id="a12683dda2253dc45680102f02fbdb1e2"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">SPHINXBASE_EXPORT <a class="el" href="ngram__model_8h.html#ac7de090a02fa12a8bba84abb4d5236aa">ngram_iter_t</a>* ngram_model_mgrams </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="ngram__model_8h.html#afaaf0c00e20056d97efcd97e4cae4ea7">ngram_model_t</a> *&#160;</td>
          <td class="paramname"><em>model</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>m</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Iterate over all M-grams. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">model</td><td>Language model to query. </td></tr>
    <tr><td class="paramname">m</td><td>Order of the M-Grams requested minus one (i.e. order of the history) </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>An iterator over the requested M, or NULL if no N-grams of order M+1 exist. </dd></dl>

<p>Definition at line <a class="el" href="ngram__model_8c_source.html#l00689">689</a> of file <a class="el" href="ngram__model_8c_source.html">ngram_model.c</a>.</p>

<p>References <a class="el" href="ngram__model__internal_8h_source.html#l00077">ngram_model_s::funcs</a>, <a class="el" href="ngram__model__internal_8h_source.html#l00165">ngram_funcs_s::mgrams</a>, and <a class="el" href="ngram__model__internal_8h_source.html#l00061">ngram_model_s::n</a>.</p>

</div>
</div>
<a class="anchor" id="ab0c840f2bdfc38cea08bb70054f76624"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">SPHINXBASE_EXPORT <a class="el" href="ngram__model_8h.html#afaaf0c00e20056d97efcd97e4cae4ea7">ngram_model_t</a>* ngram_model_read </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcmd__ln__t.html">cmd_ln_t</a> *&#160;</td>
          <td class="paramname"><em>config</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>file_name</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="ngram__model_8h.html#a0e7d02703c48237b2afea436392dcb82">ngram_file_type_t</a>&#160;</td>
          <td class="paramname"><em>file_type</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="logmath_8h.html#ae613aa7db1dd40ff56a80a7dadb22cc8">logmath_t</a> *&#160;</td>
          <td class="paramname"><em>lmath</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Read an N-Gram model from a file on disk. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">config</td><td>Optional pointer to a set of command-line arguments. Recognized arguments are:</td></tr>
  </table>
  </dd>
</dl>
<ul>
<li>-mmap (boolean) whether to use memory-mapped I/O</li>
<li>-lw (float32) language weight to apply to the model</li>
<li>-wip (float32) word insertion penalty to apply to the model</li>
<li>-uw (float32) unigram weight to apply to the model</li>
</ul>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">file_name</td><td>path to the file to read. </td></tr>
    <tr><td class="paramname">file_type</td><td>type of the file, or NGRAM_AUTO to determine automatically. </td></tr>
    <tr><td class="paramname">lmath</td><td>Log-math parameters to use for probability calculations. Ownership of this object is assumed by the newly created ngram_model_t, and you should not attempt to free it manually. If you wish to reuse it elsewhere, you must retain it with <a class="el" href="logmath_8h.html#a1c1b2ba3b137a39e9e835a8f3e27d381" title="Retain ownership of a log table. ">logmath_retain()</a>. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>newly created ngram_model_t. </dd></dl>

<p>Definition at line <a class="el" href="ngram__model_8c_source.html#l00121">121</a> of file <a class="el" href="ngram__model_8c_source.html">ngram_model.c</a>.</p>

<p>References <a class="el" href="cmd__ln_8c_source.html#l00929">cmd_ln_exists_r()</a>, <a class="el" href="err_8h_source.html#l00169">E_ERROR</a>, <a class="el" href="ngram__model_8h_source.html#l00079">NGRAM_ARPA</a>, <a class="el" href="ngram__model_8h_source.html#l00078">NGRAM_AUTO</a>, <a class="el" href="ngram__model_8h_source.html#l00080">NGRAM_DMP</a>, and <a class="el" href="ngram__model_8c_source.html#l00477">ngram_model_apply_weights()</a>.</p>

<p>Referenced by <a class="el" href="ngram__model__set_8c_source.html#l00182">ngram_model_set_read()</a>.</p>

</div>
</div>
<a class="anchor" id="a9b2a86c23543158754373c5456fe890d"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">SPHINXBASE_EXPORT int32 ngram_model_read_classdef </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="ngram__model_8h.html#afaaf0c00e20056d97efcd97e4cae4ea7">ngram_model_t</a> *&#160;</td>
          <td class="paramname"><em>model</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>file_name</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Read a class definition file and add classes to a language model. </p>
<p>This function assumes that the class tags have already been defined as unigrams in the language model. All words in the class definition will be added to the lexicon as special in-class words. For this reason is is necessary that they not have the same names as any words in the general unigram distribution. The convention is to suffix them with ":class_tag", where class_tag is the class tag minus the enclosing square brackets.</p>
<dl class="section return"><dt>Returns</dt><dd>0 for success, &lt;0 for error </dd></dl>

<p>Definition at line <a class="el" href="ngram__model_8c_source.html#l01199">1199</a> of file <a class="el" href="ngram__model_8c_source.html">ngram_model.c</a>.</p>

<p>References <a class="el" href="ckd__alloc_8c_source.html#l00241">ckd_free()</a>, <a class="el" href="glist_8c_source.html#l00133">glist_free()</a>, <a class="el" href="glist_8h_source.html#l00109">gnode_ptr</a>, <a class="el" href="hash__table_8c_source.html#l00695">hash_table_free()</a>, <a class="el" href="hash__table_8c_source.html#l00158">hash_table_new()</a>, <a class="el" href="hash__table_8c_source.html#l00623">hash_table_tolist()</a>, <a class="el" href="ngram__model_8c_source.html#l01005">ngram_model_add_class()</a>, and <a class="el" href="hash__table_8h_source.html#l00155">hash_entry_s::val</a>.</p>

</div>
</div>
<a class="anchor" id="aac2b3fd054597c2fdfbb59db97d72ec0"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">SPHINXBASE_EXPORT int ngram_model_recode </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="ngram__model_8h.html#afaaf0c00e20056d97efcd97e4cae4ea7">ngram_model_t</a> *&#160;</td>
          <td class="paramname"><em>model</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>from</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>to</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Re-encode word strings in an N-Gram model. </p>
<p>Character set names are the same as those passed to iconv(1). If your system does not have iconv, this function may fail. Also, because all file formats consist of 8-bit character streams, attempting to convert to or from UTF-16 (or any other encoding which contains null bytes) is a recipe for total desaster.</p>
<p>We have no interest in supporting UTF-16, so don't ask.</p>
<p>Note that this does not affect any pronunciation dictionary you might currently be using in conjunction with this N-Gram model, so the effect of calling this during decoding is undefined. That's a bug! </p>

<p>Definition at line <a class="el" href="ngram__model_8c_source.html#l00470">470</a> of file <a class="el" href="ngram__model_8c_source.html">ngram_model.c</a>.</p>

</div>
</div>
<a class="anchor" id="a046e6ff8cd8787e412400534a9649a81"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">SPHINXBASE_EXPORT <a class="el" href="ngram__model_8h.html#afaaf0c00e20056d97efcd97e4cae4ea7">ngram_model_t</a>* ngram_model_retain </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="ngram__model_8h.html#afaaf0c00e20056d97efcd97e4cae4ea7">ngram_model_t</a> *&#160;</td>
          <td class="paramname"><em>model</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Retain ownership of an N-Gram model. </p>
<dl class="section return"><dt>Returns</dt><dd>Pointer to retained model. </dd></dl>

<p>Definition at line <a class="el" href="ngram__model_8c_source.html#l00239">239</a> of file <a class="el" href="ngram__model_8c_source.html">ngram_model.c</a>.</p>

<p>References <a class="el" href="ngram__model__internal_8h_source.html#l00056">ngram_model_s::refcount</a>.</p>

</div>
</div>
<a class="anchor" id="aab34758e97f75733330f3f4cff8a5311"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">SPHINXBASE_EXPORT <a class="el" href="ngram__model_8h.html#afaaf0c00e20056d97efcd97e4cae4ea7">ngram_model_t</a>* ngram_model_set_add </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="ngram__model_8h.html#afaaf0c00e20056d97efcd97e4cae4ea7">ngram_model_t</a> *&#160;</td>
          <td class="paramname"><em>set</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="ngram__model_8h.html#afaaf0c00e20056d97efcd97e4cae4ea7">ngram_model_t</a> *&#160;</td>
          <td class="paramname"><em>model</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>name</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">float32&#160;</td>
          <td class="paramname"><em>weight</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>reuse_widmap</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Add a language model to a set. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">set</td><td>The language model set to add to. </td></tr>
    <tr><td class="paramname">model</td><td>The language model to add. </td></tr>
    <tr><td class="paramname">name</td><td>The name to associate with this model. </td></tr>
    <tr><td class="paramname">weight</td><td>Interpolation weight for this model, relative to the uniform distribution. 1.0 is a safe value. </td></tr>
    <tr><td class="paramname">reuse_widmap</td><td>Reuse the existing word-ID mapping in <code>set</code>. Any new words present in <code>model</code> will not be added to the word-ID mapping in this case. </td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="ngram__model__set_8c_source.html#l00520">520</a> of file <a class="el" href="ngram__model__set_8c_source.html">ngram_model_set.c</a>.</p>

<p>References <a class="el" href="ckd__alloc_8h_source.html#l00270">ckd_calloc_2d</a>, <a class="el" href="ckd__alloc_8c_source.html#l00252">ckd_free_2d()</a>, <a class="el" href="ckd__alloc_8h_source.html#l00258">ckd_realloc</a>, <a class="el" href="ckd__alloc_8h_source.html#l00264">ckd_salloc</a>, <a class="el" href="ngram__model__internal_8h_source.html#l00066">ngram_model_s::lmath</a>, <a class="el" href="ngram__model__set_8h_source.html#l00056">ngram_model_set_s::lms</a>, <a class="el" href="logmath_8c_source.html#l00447">logmath_log()</a>, <a class="el" href="ngram__model__set_8h_source.html#l00058">ngram_model_set_s::lweights</a>, <a class="el" href="ngram__model__set_8h_source.html#l00060">ngram_model_set_s::maphist</a>, <a class="el" href="ngram__model__internal_8h_source.html#l00061">ngram_model_s::n</a>, <a class="el" href="ngram__model__set_8h_source.html#l00054">ngram_model_set_s::n_models</a>, <a class="el" href="ngram__model__internal_8h_source.html#l00059">ngram_model_s::n_words</a>, <a class="el" href="ngram__model__set_8h_source.html#l00057">ngram_model_set_s::names</a>, <a class="el" href="ngram__model_8c_source.html#l00771">ngram_wid()</a>, <a class="el" href="ngram__model__set_8h_source.html#l00059">ngram_model_set_s::widmap</a>, and <a class="el" href="ngram__model__internal_8h_source.html#l00073">ngram_model_s::word_str</a>.</p>

</div>
</div>
<a class="anchor" id="af783553aa7527b7544d093aaea74d97a"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">SPHINXBASE_EXPORT int32 ngram_model_set_current_wid </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="ngram__model_8h.html#afaaf0c00e20056d97efcd97e4cae4ea7">ngram_model_t</a> *&#160;</td>
          <td class="paramname"><em>set</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int32&#160;</td>
          <td class="paramname"><em>set_wid</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Query the word-ID mapping for the current language model. </p>
<dl class="section return"><dt>Returns</dt><dd>the local word ID in the current language model, or NGRAM_INVALID_WID if <code>set_wid</code> is invalid or interpolation is enabled. </dd></dl>

<p>Definition at line <a class="el" href="ngram__model__set_8c_source.html#l00456">456</a> of file <a class="el" href="ngram__model__set_8c_source.html">ngram_model_set.c</a>.</p>

<p>References <a class="el" href="ngram__model__set_8h_source.html#l00055">ngram_model_set_s::cur</a>, <a class="el" href="ngram__model__internal_8h_source.html#l00059">ngram_model_s::n_words</a>, <a class="el" href="ngram__model_8h_source.html#l00084">NGRAM_INVALID_WID</a>, and <a class="el" href="ngram__model__set_8h_source.html#l00059">ngram_model_set_s::widmap</a>.</p>

</div>
</div>
<a class="anchor" id="a02310e01a48928e1d430aef0ea3c9a99"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">SPHINXBASE_EXPORT <a class="el" href="ngram__model_8h.html#afaaf0c00e20056d97efcd97e4cae4ea7">ngram_model_t</a>* ngram_model_set_init </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcmd__ln__t.html">cmd_ln_t</a> *&#160;</td>
          <td class="paramname"><em>config</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="ngram__model_8h.html#afaaf0c00e20056d97efcd97e4cae4ea7">ngram_model_t</a> **&#160;</td>
          <td class="paramname"><em>models</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">char **&#160;</td>
          <td class="paramname"><em>names</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const float32 *&#160;</td>
          <td class="paramname"><em>weights</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int32&#160;</td>
          <td class="paramname"><em>n_models</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Create a set of language models sharing a common space of word IDs. </p>
<p>This function creates a meta-language model which groups together a set of language models, synchronizing word IDs between them. To use this language model, you can either select a submodel to use exclusively using <a class="el" href="ngram__model_8h.html#a5e7a3fd20d32783ce07b760781f658f8" title="Select a single language model from a set for scoring. ">ngram_model_set_select()</a>, or interpolate between scores from all models. To do the latter, you can either pass a non-NULL value of the <code>weights</code> parameter, or re-activate interpolation later on by calling <a class="el" href="ngram__model_8h.html#a8a4c853e77c6b48face3a781480e77d6" title="Set interpolation weights for a set and enables interpolation. ">ngram_model_set_interp()</a>.</p>
<p>In order to make this efficient, there are some restrictions on the models that can be grouped together. The most important (and currently the only) one is that they <b>must</b> all share the same log-math parameters.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">config</td><td>Any configuration parameters to be shared between models. </td></tr>
    <tr><td class="paramname">models</td><td>Array of pointers to previously created language models. </td></tr>
    <tr><td class="paramname">names</td><td>Array of strings to use as unique identifiers for LMs. </td></tr>
    <tr><td class="paramname">weights</td><td>Array of weights to use in interpolating LMs, or NULL for no interpolation. </td></tr>
    <tr><td class="paramname">n_models</td><td>Number of elements in the arrays passed to this function. </td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="ngram__model__set_8c_source.html#l00121">121</a> of file <a class="el" href="ngram__model__set_8c_source.html">ngram_model_set.c</a>.</p>

<p>References <a class="el" href="ngram__model__set_8h_source.html#l00052">ngram_model_set_s::base</a>, <a class="el" href="ckd__alloc_8h_source.html#l00248">ckd_calloc</a>, <a class="el" href="ckd__alloc_8h_source.html#l00264">ckd_salloc</a>, <a class="el" href="ngram__model__set_8h_source.html#l00055">ngram_model_set_s::cur</a>, <a class="el" href="err_8h_source.html#l00169">E_ERROR</a>, <a class="el" href="ngram__model__internal_8h_source.html#l00066">ngram_model_s::lmath</a>, <a class="el" href="ngram__model__set_8h_source.html#l00056">ngram_model_set_s::lms</a>, <a class="el" href="logmath_8c_source.html#l00368">logmath_get_base()</a>, <a class="el" href="logmath_8c_source.html#l00386">logmath_get_shift()</a>, <a class="el" href="logmath_8c_source.html#l00447">logmath_log()</a>, <a class="el" href="ngram__model__set_8h_source.html#l00058">ngram_model_set_s::lweights</a>, <a class="el" href="ngram__model__set_8h_source.html#l00060">ngram_model_set_s::maphist</a>, <a class="el" href="ngram__model__internal_8h_source.html#l00061">ngram_model_s::n</a>, <a class="el" href="ngram__model__set_8h_source.html#l00054">ngram_model_set_s::n_models</a>, and <a class="el" href="ngram__model__set_8h_source.html#l00057">ngram_model_set_s::names</a>.</p>

<p>Referenced by <a class="el" href="ngram__model__set_8c_source.html#l00182">ngram_model_set_read()</a>.</p>

</div>
</div>
<a class="anchor" id="a8a4c853e77c6b48face3a781480e77d6"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">SPHINXBASE_EXPORT <a class="el" href="ngram__model_8h.html#afaaf0c00e20056d97efcd97e4cae4ea7">ngram_model_t</a>* ngram_model_set_interp </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="ngram__model_8h.html#afaaf0c00e20056d97efcd97e4cae4ea7">ngram_model_t</a> *&#160;</td>
          <td class="paramname"><em>set</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char **&#160;</td>
          <td class="paramname"><em>names</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const float32 *&#160;</td>
          <td class="paramname"><em>weights</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Set interpolation weights for a set and enables interpolation. </p>
<p>If <code>weights</code> is NULL, any previously initialized set of weights will be used. If no weights were specified to <a class="el" href="ngram__model_8h.html#a02310e01a48928e1d430aef0ea3c9a99" title="Create a set of language models sharing a common space of word IDs. ">ngram_model_set_init()</a>, then a uniform distribution will be used. </p>

<p>Definition at line <a class="el" href="ngram__model__set_8c_source.html#l00489">489</a> of file <a class="el" href="ngram__model__set_8c_source.html">ngram_model_set.c</a>.</p>

<p>References <a class="el" href="ngram__model__set_8h_source.html#l00055">ngram_model_set_s::cur</a>, <a class="el" href="err_8h_source.html#l00169">E_ERROR</a>, <a class="el" href="ngram__model__internal_8h_source.html#l00066">ngram_model_s::lmath</a>, <a class="el" href="logmath_8c_source.html#l00447">logmath_log()</a>, <a class="el" href="ngram__model__set_8h_source.html#l00058">ngram_model_set_s::lweights</a>, <a class="el" href="ngram__model__set_8h_source.html#l00054">ngram_model_set_s::n_models</a>, and <a class="el" href="ngram__model__set_8h_source.html#l00057">ngram_model_set_s::names</a>.</p>

</div>
</div>
<a class="anchor" id="a880c7768b082a124e1b6f6f1a764b1e3"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">SPHINXBASE_EXPORT <a class="el" href="ngram__model_8h.html#afffd75c5bde8dd84107449468be48547">ngram_model_set_iter_t</a>* ngram_model_set_iter </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="ngram__model_8h.html#afaaf0c00e20056d97efcd97e4cae4ea7">ngram_model_t</a> *&#160;</td>
          <td class="paramname"><em>set</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Begin iterating over language models in a set. </p>
<dl class="section return"><dt>Returns</dt><dd>iterator pointing to the first language model, or NULL if no models remain. </dd></dl>

<p>Definition at line <a class="el" href="ngram__model__set_8c_source.html#l00368">368</a> of file <a class="el" href="ngram__model__set_8c_source.html">ngram_model_set.c</a>.</p>

<p>References <a class="el" href="ckd__alloc_8h_source.html#l00248">ckd_calloc</a>, and <a class="el" href="ngram__model__set_8h_source.html#l00054">ngram_model_set_s::n_models</a>.</p>

</div>
</div>
<a class="anchor" id="a438592444037281175150e3cf1543052"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">SPHINXBASE_EXPORT <a class="el" href="ngram__model_8h.html#afaaf0c00e20056d97efcd97e4cae4ea7">ngram_model_t</a>* ngram_model_set_iter_model </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="ngram__model_8h.html#afffd75c5bde8dd84107449468be48547">ngram_model_set_iter_t</a> *&#160;</td>
          <td class="paramname"><em>itor</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">char const **&#160;</td>
          <td class="paramname"><em>lmname</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Get language model and associated name from an iterator. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">itor</td><td>the iterator </td></tr>
    <tr><td class="paramname">lmname</td><td>Output: string name associated with this language model. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Language model pointed to by this iterator. </dd></dl>

<p>Definition at line <a class="el" href="ngram__model__set_8c_source.html#l00397">397</a> of file <a class="el" href="ngram__model__set_8c_source.html">ngram_model_set.c</a>.</p>

<p>References <a class="el" href="ngram__model__set_8h_source.html#l00056">ngram_model_set_s::lms</a>, and <a class="el" href="ngram__model__set_8h_source.html#l00057">ngram_model_set_s::names</a>.</p>

</div>
</div>
<a class="anchor" id="a038a174f17632703cffce02611149265"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">SPHINXBASE_EXPORT <a class="el" href="ngram__model_8h.html#afffd75c5bde8dd84107449468be48547">ngram_model_set_iter_t</a>* ngram_model_set_iter_next </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="ngram__model_8h.html#afffd75c5bde8dd84107449468be48547">ngram_model_set_iter_t</a> *&#160;</td>
          <td class="paramname"><em>itor</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Move to the next language model in a set. </p>
<dl class="section return"><dt>Returns</dt><dd>iterator pointing to the next language model, or NULL if no models remain. </dd></dl>

<p>Definition at line <a class="el" href="ngram__model__set_8c_source.html#l00381">381</a> of file <a class="el" href="ngram__model__set_8c_source.html">ngram_model_set.c</a>.</p>

<p>References <a class="el" href="ngram__model__set_8h_source.html#l00054">ngram_model_set_s::n_models</a>, and <a class="el" href="ngram__model__set_8c_source.html#l00391">ngram_model_set_iter_free()</a>.</p>

</div>
</div>
<a class="anchor" id="ad87975912cfe1ac5d0c3ebe12de79209"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">SPHINXBASE_EXPORT int32 ngram_model_set_known_wid </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="ngram__model_8h.html#afaaf0c00e20056d97efcd97e4cae4ea7">ngram_model_t</a> *&#160;</td>
          <td class="paramname"><em>set</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int32&#160;</td>
          <td class="paramname"><em>set_wid</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Test whether a word ID corresponds to a known word in the current state of the language model set. </p>
<dl class="section return"><dt>Returns</dt><dd>If there is a current language model, returns non-zero if <code>set_wid</code> corresponds to a known word in that language model. Otherwise, returns non-zero if <code>set_wid</code> corresponds to a known word in any language model. </dd></dl>

<p>Definition at line <a class="el" href="ngram__model__set_8c_source.html#l00468">468</a> of file <a class="el" href="ngram__model__set_8c_source.html">ngram_model_set.c</a>.</p>

<p>References <a class="el" href="ngram__model__set_8h_source.html#l00055">ngram_model_set_s::cur</a>, <a class="el" href="ngram__model__set_8h_source.html#l00056">ngram_model_set_s::lms</a>, <a class="el" href="ngram__model__set_8h_source.html#l00054">ngram_model_set_s::n_models</a>, <a class="el" href="ngram__model__internal_8h_source.html#l00059">ngram_model_s::n_words</a>, <a class="el" href="ngram__model_8c_source.html#l00644">ngram_unknown_wid()</a>, and <a class="el" href="ngram__model__set_8h_source.html#l00059">ngram_model_set_s::widmap</a>.</p>

</div>
</div>
<a class="anchor" id="a1797a53b95a2a1ca2a6be732918d9fa0"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">SPHINXBASE_EXPORT <a class="el" href="ngram__model_8h.html#afaaf0c00e20056d97efcd97e4cae4ea7">ngram_model_t</a>* ngram_model_set_lookup </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="ngram__model_8h.html#afaaf0c00e20056d97efcd97e4cae4ea7">ngram_model_t</a> *&#160;</td>
          <td class="paramname"><em>set</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>name</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Look up a language model by name from a set. </p>
<dl class="section return"><dt>Returns</dt><dd>language model corresponding to <code>name</code>, or NULL if no language model by that name exists. </dd></dl>

<p>Definition at line <a class="el" href="ngram__model__set_8c_source.html#l00405">405</a> of file <a class="el" href="ngram__model__set_8c_source.html">ngram_model_set.c</a>.</p>

<p>References <a class="el" href="ngram__model__set_8h_source.html#l00055">ngram_model_set_s::cur</a>, <a class="el" href="ngram__model__set_8h_source.html#l00056">ngram_model_set_s::lms</a>, <a class="el" href="ngram__model__set_8h_source.html#l00054">ngram_model_set_s::n_models</a>, and <a class="el" href="ngram__model__set_8h_source.html#l00057">ngram_model_set_s::names</a>.</p>

</div>
</div>
<a class="anchor" id="afb7b13dbb4a3149b2fa9f7b15dbe35e8"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">SPHINXBASE_EXPORT <a class="el" href="ngram__model_8h.html#afaaf0c00e20056d97efcd97e4cae4ea7">ngram_model_t</a>* ngram_model_set_read </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcmd__ln__t.html">cmd_ln_t</a> *&#160;</td>
          <td class="paramname"><em>config</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>lmctlfile</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="logmath_8h.html#ae613aa7db1dd40ff56a80a7dadb22cc8">logmath_t</a> *&#160;</td>
          <td class="paramname"><em>lmath</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Read a set of language models from a control file. </p>
<p>This file creates a language model set from a "control file" of the type used in Sphinx-II and Sphinx-III. File format (optional stuff is indicated by enclosing in []):</p>
<pre>
  [{ LMClassFileName LMClassFilename ... }]
  TrigramLMFileName LMName [{ LMClassName LMClassName ... }]
  TrigramLMFileName LMName [{ LMClassName LMClassName ... }]
  ...
(There should be whitespace around the { and } delimiters.)
</pre><p>This is an extension of the older format that had only TrigramLMFilenName and LMName pairs. The new format allows a set of LMClass files to be read in and referred to by the trigram LMs.</p>
<p>No "comments" allowed in this file.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">config</td><td>Configuration parameters. </td></tr>
    <tr><td class="paramname">lmctlfile</td><td>Path to the language model control file. </td></tr>
    <tr><td class="paramname">lmath</td><td>Log-math parameters to use for probability calculations. Ownership of this object is assumed by the newly created ngram_model_t, and you should not attempt to free it manually. If you wish to reuse it elsewhere, you must retain it with <a class="el" href="logmath_8h.html#a1c1b2ba3b137a39e9e835a8f3e27d381" title="Retain ownership of a log table. ">logmath_retain()</a>. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>newly created language model set. </dd></dl>

<p>Definition at line <a class="el" href="ngram__model__set_8c_source.html#l00182">182</a> of file <a class="el" href="ngram__model__set_8c_source.html">ngram_model_set.c</a>.</p>

<p>References <a class="el" href="ckd__alloc_8h_source.html#l00248">ckd_calloc</a>, <a class="el" href="ckd__alloc_8c_source.html#l00241">ckd_free()</a>, <a class="el" href="ckd__alloc_8h_source.html#l00264">ckd_salloc</a>, <a class="el" href="err_8h_source.html#l00169">E_ERROR</a>, <a class="el" href="err_8h_source.html#l00142">E_ERROR_SYSTEM</a>, <a class="el" href="err_8h_source.html#l00147">E_INFO</a>, <a class="el" href="glist_8c_source.html#l00074">glist_add_ptr()</a>, <a class="el" href="glist_8c_source.html#l00145">glist_count()</a>, <a class="el" href="glist_8c_source.html#l00133">glist_free()</a>, <a class="el" href="glist_8c_source.html#l00169">glist_reverse()</a>, <a class="el" href="glist_8h_source.html#l00109">gnode_ptr</a>, <a class="el" href="hash__table_8c_source.html#l00695">hash_table_free()</a>, <a class="el" href="hash__table_8c_source.html#l00309">hash_table_lookup()</a>, <a class="el" href="hash__table_8c_source.html#l00158">hash_table_new()</a>, <a class="el" href="hash__table_8c_source.html#l00623">hash_table_tolist()</a>, <a class="el" href="ngram__model_8h_source.html#l00078">NGRAM_AUTO</a>, <a class="el" href="ngram__model_8c_source.html#l01005">ngram_model_add_class()</a>, <a class="el" href="ngram__model_8c_source.html#l00254">ngram_model_free()</a>, <a class="el" href="ngram__model_8c_source.html#l00121">ngram_model_read()</a>, <a class="el" href="ngram__model__set_8c_source.html#l00121">ngram_model_set_init()</a>, <a class="el" href="filename_8c_source.html#l00126">path_is_absolute()</a>, <a class="el" href="strfuncs_8c_source.html#l00062">string_join()</a>, and <a class="el" href="hash__table_8h_source.html#l00155">hash_entry_s::val</a>.</p>

</div>
</div>
<a class="anchor" id="af761011a07b87c209e6d174e07b34617"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">SPHINXBASE_EXPORT <a class="el" href="ngram__model_8h.html#afaaf0c00e20056d97efcd97e4cae4ea7">ngram_model_t</a>* ngram_model_set_remove </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="ngram__model_8h.html#afaaf0c00e20056d97efcd97e4cae4ea7">ngram_model_t</a> *&#160;</td>
          <td class="paramname"><em>set</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>name</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>reuse_widmap</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Remove a language model from a set. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">set</td><td>The language model set to remove from. </td></tr>
    <tr><td class="paramname">name</td><td>The name associated with the model to remove. </td></tr>
    <tr><td class="paramname">reuse_widmap</td><td>Reuse the existing word-ID mapping in <code>set</code>. </td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="ngram__model__set_8c_source.html#l00580">580</a> of file <a class="el" href="ngram__model__set_8c_source.html">ngram_model_set.c</a>.</p>

<p>References <a class="el" href="ckd__alloc_8c_source.html#l00241">ckd_free()</a>, <a class="el" href="ngram__model__internal_8h_source.html#l00066">ngram_model_s::lmath</a>, <a class="el" href="ngram__model__set_8h_source.html#l00056">ngram_model_set_s::lms</a>, <a class="el" href="ngram__model__internal_8h_source.html#l00072">ngram_model_s::log_zero</a>, <a class="el" href="logmath_8c_source.html#l00456">logmath_exp()</a>, <a class="el" href="logmath_8c_source.html#l00447">logmath_log()</a>, <a class="el" href="ngram__model__set_8h_source.html#l00058">ngram_model_set_s::lweights</a>, <a class="el" href="ngram__model__internal_8h_source.html#l00061">ngram_model_s::n</a>, <a class="el" href="ngram__model__set_8h_source.html#l00054">ngram_model_set_s::n_models</a>, <a class="el" href="ngram__model__internal_8h_source.html#l00059">ngram_model_s::n_words</a>, <a class="el" href="ngram__model__set_8h_source.html#l00057">ngram_model_set_s::names</a>, and <a class="el" href="ngram__model__set_8h_source.html#l00059">ngram_model_set_s::widmap</a>.</p>

</div>
</div>
<a class="anchor" id="a5e7a3fd20d32783ce07b760781f658f8"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">SPHINXBASE_EXPORT <a class="el" href="ngram__model_8h.html#afaaf0c00e20056d97efcd97e4cae4ea7">ngram_model_t</a>* ngram_model_set_select </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="ngram__model_8h.html#afaaf0c00e20056d97efcd97e4cae4ea7">ngram_model_t</a> *&#160;</td>
          <td class="paramname"><em>set</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>name</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Select a single language model from a set for scoring. </p>
<dl class="section return"><dt>Returns</dt><dd>the newly selected language model, or NULL if no language model by that name exists. </dd></dl>

<p>Definition at line <a class="el" href="ngram__model__set_8c_source.html#l00428">428</a> of file <a class="el" href="ngram__model__set_8c_source.html">ngram_model_set.c</a>.</p>

<p>References <a class="el" href="ngram__model__set_8h_source.html#l00055">ngram_model_set_s::cur</a>, <a class="el" href="ngram__model__set_8h_source.html#l00056">ngram_model_set_s::lms</a>, <a class="el" href="ngram__model__set_8h_source.html#l00054">ngram_model_set_s::n_models</a>, and <a class="el" href="ngram__model__set_8h_source.html#l00057">ngram_model_set_s::names</a>.</p>

</div>
</div>
<a class="anchor" id="ac8ff04e1bccbef23bde9e81fb61c57fe"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">SPHINXBASE_EXPORT int ngram_model_write </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="ngram__model_8h.html#afaaf0c00e20056d97efcd97e4cae4ea7">ngram_model_t</a> *&#160;</td>
          <td class="paramname"><em>model</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>file_name</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="ngram__model_8h.html#a0e7d02703c48237b2afea436392dcb82">ngram_file_type_t</a>&#160;</td>
          <td class="paramname"><em>format</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Write an N-Gram model to disk. </p>
<dl class="section return"><dt>Returns</dt><dd>0 for success, &lt;0 on error </dd></dl>

<p>Definition at line <a class="el" href="ngram__model_8c_source.html#l00167">167</a> of file <a class="el" href="ngram__model_8c_source.html">ngram_model.c</a>.</p>

<p>References <a class="el" href="err_8h_source.html#l00169">E_ERROR</a>, <a class="el" href="ngram__model_8h_source.html#l00079">NGRAM_ARPA</a>, <a class="el" href="ngram__model_8h_source.html#l00078">NGRAM_AUTO</a>, <a class="el" href="ngram__model_8h_source.html#l00080">NGRAM_DMP</a>, <a class="el" href="ngram__model_8c_source.html#l00064">ngram_file_name_to_type()</a>, and <a class="el" href="ngram__model_8h_source.html#l00077">NGRAM_INVALID</a>.</p>

</div>
</div>
<a class="anchor" id="a218d8d140b93d3d8008f8933f9e04ec6"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">SPHINXBASE_EXPORT int32 ngram_ng_prob </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="ngram__model_8h.html#afaaf0c00e20056d97efcd97e4cae4ea7">ngram_model_t</a> *&#160;</td>
          <td class="paramname"><em>model</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int32&#160;</td>
          <td class="paramname"><em>wid</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int32 *&#160;</td>
          <td class="paramname"><em>history</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int32&#160;</td>
          <td class="paramname"><em>n_hist</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int32 *&#160;</td>
          <td class="paramname"><em>n_used</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Quick "raw" probability lookup for a general N-Gram. </p>
<p>See documentation for <a class="el" href="ngram__model_8h.html#a6ac5799e78ea4ad82a11e2439016471e" title="Quick general N-Gram score lookup. ">ngram_ng_score()</a> and ngram_apply_weights() for an explanation of this. </p>

<p>Definition at line <a class="el" href="ngram__model_8c_source.html#l00570">570</a> of file <a class="el" href="ngram__model_8c_source.html">ngram_model.c</a>.</p>

<p>References <a class="el" href="ngram__model__internal_8h_source.html#l00076">ngram_model_s::classes</a>, <a class="el" href="ngram__model__internal_8h_source.html#l00077">ngram_model_s::funcs</a>, <a class="el" href="ngram__model__internal_8h_source.html#l00072">ngram_model_s::log_zero</a>, <a class="el" href="ngram__model_8h_source.html#l00084">NGRAM_INVALID_WID</a>, <a class="el" href="ngram__model__internal_8h_source.html#l00134">ngram_funcs_s::raw_score</a>, and <a class="el" href="ngram__model__internal_8h_source.html#l00084">ngram_class_s::tag_wid</a>.</p>

<p>Referenced by <a class="el" href="ngram__model_8c_source.html#l00600">ngram_prob()</a>.</p>

</div>
</div>
<a class="anchor" id="a68cfda3f503e1a4a87f08aa5a3a5ea88"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">SPHINXBASE_EXPORT int32 ngram_prob </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="ngram__model_8h.html#afaaf0c00e20056d97efcd97e4cae4ea7">ngram_model_t</a> *&#160;</td>
          <td class="paramname"><em>model</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>word</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>...</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Get the "raw" log-probability for a general N-Gram. </p>
<p>This returns the log-probability of an N-Gram, as defined in the language model file, before any language weighting, interpolation, or insertion penalty has been applied.</p>
<dl class="section note"><dt>Note</dt><dd>When backing off to a unigram from a bigram or trigram, the unigram weight (interpolation with uniform) is not removed. </dd></dl>

<p>Definition at line <a class="el" href="ngram__model_8c_source.html#l00600">600</a> of file <a class="el" href="ngram__model_8c_source.html">ngram_model.c</a>.</p>

<p>References <a class="el" href="ckd__alloc_8h_source.html#l00248">ckd_calloc</a>, <a class="el" href="ckd__alloc_8c_source.html#l00241">ckd_free()</a>, <a class="el" href="ngram__model_8c_source.html#l00570">ngram_ng_prob()</a>, and <a class="el" href="ngram__model_8c_source.html#l00771">ngram_wid()</a>.</p>

</div>
</div>
<a class="anchor" id="a9c23d79885af400e17ac2a1b7169660d"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">SPHINXBASE_EXPORT int32 ngram_score </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="ngram__model_8h.html#afaaf0c00e20056d97efcd97e4cae4ea7">ngram_model_t</a> *&#160;</td>
          <td class="paramname"><em>model</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>word</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>...</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Get the score (scaled, interpolated log-probability) for a general N-Gram. </p>
<p>The argument list consists of the history words (as null-terminated strings) of the N-Gram, <b>in reverse order</b>, followed by NULL. Therefore, if you wanted to get the N-Gram score for "a whole joy", you would call:</p>
<pre>
 score = ngram_score(model, "joy", "whole", "a", NULL);
</pre><p>This is not the function to use in decoding, because it has some overhead for looking up words. Use <a class="el" href="ngram__model_8h.html#a6ac5799e78ea4ad82a11e2439016471e" title="Quick general N-Gram score lookup. ">ngram_ng_score()</a>, <a class="el" href="ngram__model_8h.html#a0f8ad53c1a7cab528113b74aad00f15a" title="Quick trigram score lookup. ">ngram_tg_score()</a>, or <a class="el" href="ngram__model_8h.html#a8c06698fbcb0ef82420088ace045ae81" title="Quick bigram score lookup. ">ngram_bg_score()</a> instead. In the future there will probably be a version that takes a general language model state object, to support suffix-array LM and things like that.</p>
<p>If one of the words is not in the LM's vocabulary, the result will depend on whether this is an open or closed vocabulary language model. For an open-vocabulary model, unknown words are all mapped to the unigram &lt;UNK&gt; which has a non-zero probability and also participates in higher-order N-Grams. Therefore, you will get a score of some sort in this case.</p>
<p>For a closed-vocabulary model, unknown words are impossible and thus have zero probability. Therefore, if <code>word</code> is unknown, this function will return a "zero" log-probability, i.e. a large negative number. To obtain this number for comparison, call <a class="el" href="ngram__model_8h.html#ae401a87ad55ae64f286dcd83170f7100" title="Get the &quot;zero&quot; log-probability value for a language model. ">ngram_zero()</a>. </p>

<p>Definition at line <a class="el" href="ngram__model_8c_source.html#l00524">524</a> of file <a class="el" href="ngram__model_8c_source.html">ngram_model.c</a>.</p>

<p>References <a class="el" href="ckd__alloc_8h_source.html#l00248">ckd_calloc</a>, <a class="el" href="ckd__alloc_8c_source.html#l00241">ckd_free()</a>, <a class="el" href="ngram__model_8c_source.html#l00494">ngram_ng_score()</a>, and <a class="el" href="ngram__model_8c_source.html#l00771">ngram_wid()</a>.</p>

</div>
</div>
<a class="anchor" id="ae0cf3a94128927e2be6422d2de34f49b"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">SPHINXBASE_EXPORT int32 ngram_score_to_prob </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="ngram__model_8h.html#afaaf0c00e20056d97efcd97e4cae4ea7">ngram_model_t</a> *&#160;</td>
          <td class="paramname"><em>model</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int32&#160;</td>
          <td class="paramname"><em>score</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Convert score to "raw" log-probability. </p>
<dl class="section note"><dt>Note</dt><dd>The unigram weight (interpolation with uniform) is not removed, since there is no way to know which order of N-Gram generated <code>score</code>.</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">model</td><td>The N-Gram model from which score was obtained. </td></tr>
    <tr><td class="paramname">score</td><td>The N-Gram score to convert </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The raw log-probability value. </dd></dl>

<p>Definition at line <a class="el" href="ngram__model_8c_source.html#l00631">631</a> of file <a class="el" href="ngram__model_8c_source.html">ngram_model.c</a>.</p>

<p>References <a class="el" href="ngram__model__internal_8h_source.html#l00068">ngram_model_s::log_wip</a>, and <a class="el" href="ngram__model__internal_8h_source.html#l00067">ngram_model_s::lw</a>.</p>

</div>
</div>
<a class="anchor" id="affb3d938049e58c191e72858a7191e9c"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">SPHINXBASE_EXPORT <a class="el" href="ngram__model_8h.html#a0e7d02703c48237b2afea436392dcb82">ngram_file_type_t</a> ngram_str_to_type </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>str_name</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Get the N-Gram file type from a string. </p>
<dl class="section return"><dt>Returns</dt><dd>file type, or NGRAM_INVALID if no such file type exists. </dd></dl>

<p>Definition at line <a class="el" href="ngram__model_8c_source.html#l00097">97</a> of file <a class="el" href="ngram__model_8c_source.html">ngram_model.c</a>.</p>

<p>References <a class="el" href="ngram__model_8h_source.html#l00079">NGRAM_ARPA</a>, <a class="el" href="ngram__model_8h_source.html#l00080">NGRAM_DMP</a>, <a class="el" href="ngram__model_8h_source.html#l00077">NGRAM_INVALID</a>, and <a class="el" href="case_8c_source.html#l00094">strcmp_nocase()</a>.</p>

</div>
</div>
<a class="anchor" id="a992b8a8d7f623e2662ae94991f6aec55"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">SPHINXBASE_EXPORT char const* ngram_type_to_str </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>type</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Get the canonical name for an N-Gram file type. </p>
<dl class="section return"><dt>Returns</dt><dd>read-only string with the name for this file type, or NULL if no such type exists. </dd></dl>

<p>Definition at line <a class="el" href="ngram__model_8c_source.html#l00107">107</a> of file <a class="el" href="ngram__model_8c_source.html">ngram_model.c</a>.</p>

<p>References <a class="el" href="ngram__model_8h_source.html#l00079">NGRAM_ARPA</a>, and <a class="el" href="ngram__model_8h_source.html#l00080">NGRAM_DMP</a>.</p>

</div>
</div>
<a class="anchor" id="a1469e9e1c8516a77c9ac1e248a61ef4e"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">SPHINXBASE_EXPORT int32 ngram_unknown_wid </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="ngram__model_8h.html#afaaf0c00e20056d97efcd97e4cae4ea7">ngram_model_t</a> *&#160;</td>
          <td class="paramname"><em>model</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Get the unknown word ID for a language model. </p>
<p>Language models can be either "open vocabulary" or "closed
vocabulary". The difference is that the former assigns a fixed non-zero unigram probability to unknown words, while the latter does not allow unknown words (or, equivalently, it assigns them zero probability). If this is a closed vocabulary model, this function will return NGRAM_INVALID_WID.</p>
<dl class="section return"><dt>Returns</dt><dd>The ID for the unknown word, or NGRAM_INVALID_WID if none exists. </dd></dl>

<p>Definition at line <a class="el" href="ngram__model_8c_source.html#l00644">644</a> of file <a class="el" href="ngram__model_8c_source.html">ngram_model.c</a>.</p>

<p>References <a class="el" href="hash__table_8c_source.html#l00329">hash_table_lookup_int32()</a>, <a class="el" href="ngram__model_8h_source.html#l00084">NGRAM_INVALID_WID</a>, and <a class="el" href="ngram__model__internal_8h_source.html#l00074">ngram_model_s::wid</a>.</p>

<p>Referenced by <a class="el" href="ngram__model_8c_source.html#l01005">ngram_model_add_class()</a>, <a class="el" href="ngram__model__set_8c_source.html#l00468">ngram_model_set_known_wid()</a>, and <a class="el" href="ngram__model_8c_source.html#l00771">ngram_wid()</a>.</p>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="dir_d44c64559bbebec7f509842c48db8b23.html">include</a></li><li class="navelem"><a class="el" href="dir_e3d154c296a8e9be2797a4f81e9375b2.html">sphinxbase</a></li><li class="navelem"><a class="el" href="ngram__model_8h.html">ngram_model.h</a></li>
    <li class="footer">Generated on Sat Oct 18 2014 15:21:17 for SphinxBase by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.8 </li>
  </ul>
</div>
</body>
</html>