\section{ngram\+\_\+funcs\+\_\+s Struct Reference}
\label{structngram__funcs__s}\index{ngram\+\_\+funcs\+\_\+s@{ngram\+\_\+funcs\+\_\+s}}


Implementation-\/specific functions for operating on ngram\+\_\+model\+\_\+t objects.  




{\ttfamily \#include $<$ngram\+\_\+model\+\_\+internal.\+h$>$}

\subsection*{Data Fields}
\begin{DoxyCompactItemize}
\item 
\mbox{\label{structngram__funcs__s_ae13797f51aee31ddde0f150c1bbe1570}} 
void($\ast$ \textbf{ free} )(\textbf{ ngram\+\_\+model\+\_\+t} $\ast$model)
\begin{DoxyCompactList}\small\item\em Implementation-\/specific function for freeing an ngram\+\_\+model\+\_\+t. \end{DoxyCompactList}\item 
\mbox{\label{structngram__funcs__s_a300368439a0d71d856236efd38dfcfe2}} 
int($\ast$ \textbf{ apply\+\_\+weights} )(\textbf{ ngram\+\_\+model\+\_\+t} $\ast$model, float32 lw, float32 wip, float32 uw)
\begin{DoxyCompactList}\small\item\em Implementation-\/specific function for applying language model weights. \end{DoxyCompactList}\item 
\mbox{\label{structngram__funcs__s_ab74c094f1e88465559fdd29859bf4395}} 
int32($\ast$ \textbf{ score} )(\textbf{ ngram\+\_\+model\+\_\+t} $\ast$model, int32 wid, int32 $\ast$history, int32 n\+\_\+hist, int32 $\ast$n\+\_\+used)
\begin{DoxyCompactList}\small\item\em Implementation-\/specific function for querying language model score. \end{DoxyCompactList}\item 
\mbox{\label{structngram__funcs__s_a9c9f83dc5151495a21b7eff16ad747d3}} 
int32($\ast$ \textbf{ raw\+\_\+score} )(\textbf{ ngram\+\_\+model\+\_\+t} $\ast$model, int32 wid, int32 $\ast$history, int32 n\+\_\+hist, int32 $\ast$n\+\_\+used)
\begin{DoxyCompactList}\small\item\em Implementation-\/specific function for querying raw language model probability. \end{DoxyCompactList}\item 
int32($\ast$ \textbf{ add\+\_\+ug} )(\textbf{ ngram\+\_\+model\+\_\+t} $\ast$model, int32 wid, int32 lweight)
\begin{DoxyCompactList}\small\item\em Implementation-\/specific function for adding unigrams. \end{DoxyCompactList}\item 
\mbox{\label{structngram__funcs__s_af1ab9c61d3b9fa4a4782b8df3089baa6}} 
void($\ast$ \textbf{ flush} )(\textbf{ ngram\+\_\+model\+\_\+t} $\ast$model)
\begin{DoxyCompactList}\small\item\em Implementation-\/specific function for purging N-\/\+Gram cache. \end{DoxyCompactList}\item 
\mbox{\label{structngram__funcs__s_a569a1f23b54db642c0a97af6aa7d376e}} 
\textbf{ ngram\+\_\+iter\+\_\+t} $\ast$($\ast$ \textbf{ iter} )(\textbf{ ngram\+\_\+model\+\_\+t} $\ast$model, int32 wid, int32 $\ast$history, int32 n\+\_\+hist)
\begin{DoxyCompactList}\small\item\em Implementation-\/specific function for iterating. \end{DoxyCompactList}\item 
\mbox{\label{structngram__funcs__s_aa91bb4fa9aa588d5565692089684f8de}} 
\textbf{ ngram\+\_\+iter\+\_\+t} $\ast$($\ast$ \textbf{ mgrams} )(\textbf{ ngram\+\_\+model\+\_\+t} $\ast$model, int32 m)
\begin{DoxyCompactList}\small\item\em Implementation-\/specific function for iterating. \end{DoxyCompactList}\item 
\mbox{\label{structngram__funcs__s_aa527f2be0bf6d5efb4a48ab76cdedee6}} 
\textbf{ ngram\+\_\+iter\+\_\+t} $\ast$($\ast$ \textbf{ successors} )(\textbf{ ngram\+\_\+iter\+\_\+t} $\ast$itor)
\begin{DoxyCompactList}\small\item\em Implementation-\/specific function for iterating. \end{DoxyCompactList}\item 
\mbox{\label{structngram__funcs__s_a2f27a56f9cdd9911b2bb42a80a304ccf}} 
int32 const  $\ast$($\ast$ \textbf{ iter\+\_\+get} )(\textbf{ ngram\+\_\+iter\+\_\+t} $\ast$itor, int32 $\ast$out\+\_\+score, int32 $\ast$out\+\_\+bowt)
\begin{DoxyCompactList}\small\item\em Implementation-\/specific function for iterating. \end{DoxyCompactList}\item 
\mbox{\label{structngram__funcs__s_aef779dc7dc14cabd390b1bf08946d9c1}} 
\textbf{ ngram\+\_\+iter\+\_\+t} $\ast$($\ast$ \textbf{ iter\+\_\+next} )(\textbf{ ngram\+\_\+iter\+\_\+t} $\ast$itor)
\begin{DoxyCompactList}\small\item\em Implementation-\/specific function for iterating. \end{DoxyCompactList}\item 
\mbox{\label{structngram__funcs__s_ac073f51673d16dbe0c2f175babd4b6ba}} 
void($\ast$ \textbf{ iter\+\_\+free} )(\textbf{ ngram\+\_\+iter\+\_\+t} $\ast$itor)
\begin{DoxyCompactList}\small\item\em Implementation-\/specific function for iterating. \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
Implementation-\/specific functions for operating on ngram\+\_\+model\+\_\+t objects. 

Definition at line 110 of file ngram\+\_\+model\+\_\+internal.\+h.



\subsection{Field Documentation}
\mbox{\label{structngram__funcs__s_aec7921e64c7cc778fa2267d6717482c3}} 
\index{ngram\+\_\+funcs\+\_\+s@{ngram\+\_\+funcs\+\_\+s}!add\+\_\+ug@{add\+\_\+ug}}
\index{add\+\_\+ug@{add\+\_\+ug}!ngram\+\_\+funcs\+\_\+s@{ngram\+\_\+funcs\+\_\+s}}
\subsubsection{add\+\_\+ug}
{\footnotesize\ttfamily int32($\ast$ ngram\+\_\+funcs\+\_\+s\+::add\+\_\+ug) (\textbf{ ngram\+\_\+model\+\_\+t} $\ast$model, int32 wid, int32 lweight)}



Implementation-\/specific function for adding unigrams. 

This function updates the internal structures of a language model to add the given unigram with the given weight (defined as a log-\/factor applied to the uniform distribution). This includes reallocating or otherwise resizing the set of unigrams.

\begin{DoxyReturn}{Returns}
The language model score (not raw log-\/probability) of the new word, or 0 for failure. 
\end{DoxyReturn}


Definition at line 150 of file ngram\+\_\+model\+\_\+internal.\+h.



Referenced by ngram\+\_\+model\+\_\+add\+\_\+word().



The documentation for this struct was generated from the following file\+:\begin{DoxyCompactItemize}
\item 
src/libsphinxbase/lm/ngram\+\_\+model\+\_\+internal.\+h\end{DoxyCompactItemize}
