\doxysection{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$>$}

\doxysubsubsection*{Data Fields}
\begin{DoxyCompactItemize}
\item 
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 
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 
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 
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 
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 
\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 
\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 
\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 
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 
\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 
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}


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

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



\doxysubsection{Field Documentation}
\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}}
\doxysubsubsection{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 \textbf{ 150} of file \textbf{ ngram\+\_\+model\+\_\+internal.\+h}.



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

\label{structngram__funcs__s_a300368439a0d71d856236efd38dfcfe2} 
\index{ngram\_funcs\_s@{ngram\_funcs\_s}!apply\_weights@{apply\_weights}}
\index{apply\_weights@{apply\_weights}!ngram\_funcs\_s@{ngram\_funcs\_s}}
\doxysubsubsection{apply\_weights}
{\footnotesize\ttfamily int($\ast$ ngram\+\_\+funcs\+\_\+s\+::apply\+\_\+weights) (\textbf{ ngram\+\_\+model\+\_\+t} $\ast$model, float32 lw, float32 wip, float32 uw)}



Implementation-\/specific function for applying language model weights. 



Definition at line \textbf{ 118} of file \textbf{ ngram\+\_\+model\+\_\+internal.\+h}.



Referenced by \textbf{ ngram\+\_\+model\+\_\+apply\+\_\+weights()}.

\label{structngram__funcs__s_af1ab9c61d3b9fa4a4782b8df3089baa6} 
\index{ngram\_funcs\_s@{ngram\_funcs\_s}!flush@{flush}}
\index{flush@{flush}!ngram\_funcs\_s@{ngram\_funcs\_s}}
\doxysubsubsection{flush}
{\footnotesize\ttfamily void($\ast$ ngram\+\_\+funcs\+\_\+s\+::flush) (\textbf{ ngram\+\_\+model\+\_\+t} $\ast$model)}



Implementation-\/specific function for purging N-\/\+Gram cache. 



Definition at line \textbf{ 155} of file \textbf{ ngram\+\_\+model\+\_\+internal.\+h}.



Referenced by \textbf{ ngram\+\_\+model\+\_\+flush()}.

\label{structngram__funcs__s_ae13797f51aee31ddde0f150c1bbe1570} 
\index{ngram\_funcs\_s@{ngram\_funcs\_s}!free@{free}}
\index{free@{free}!ngram\_funcs\_s@{ngram\_funcs\_s}}
\doxysubsubsection{free}
{\footnotesize\ttfamily void($\ast$ ngram\+\_\+funcs\+\_\+s\+::free) (\textbf{ ngram\+\_\+model\+\_\+t} $\ast$model)}



Implementation-\/specific function for freeing an ngram\+\_\+model\+\_\+t. 



Definition at line \textbf{ 114} of file \textbf{ ngram\+\_\+model\+\_\+internal.\+h}.



Referenced by \textbf{ ngram\+\_\+model\+\_\+free()}.

\label{structngram__funcs__s_a36267ee9e31d4b51f9ef3a2ad88e7388} 
\index{ngram\_funcs\_s@{ngram\_funcs\_s}!iter@{iter}}
\index{iter@{iter}!ngram\_funcs\_s@{ngram\_funcs\_s}}
\doxysubsubsection{iter}
{\footnotesize\ttfamily \textbf{ ngram\+\_\+iter\+\_\+t} $\ast$($\ast$ ngram\+\_\+funcs\+\_\+s\+::iter) (\textbf{ ngram\+\_\+model\+\_\+t} $\ast$model, int32 wid, int32 $\ast$history, int32 n\+\_\+hist)}



Implementation-\/specific function for iterating. 



Definition at line \textbf{ 160} of file \textbf{ ngram\+\_\+model\+\_\+internal.\+h}.



Referenced by \textbf{ ngram\+\_\+ng\+\_\+iter()}.

\label{structngram__funcs__s_ac073f51673d16dbe0c2f175babd4b6ba} 
\index{ngram\_funcs\_s@{ngram\_funcs\_s}!iter\_free@{iter\_free}}
\index{iter\_free@{iter\_free}!ngram\_funcs\_s@{ngram\_funcs\_s}}
\doxysubsubsection{iter\_free}
{\footnotesize\ttfamily void($\ast$ ngram\+\_\+funcs\+\_\+s\+::iter\+\_\+free) (\textbf{ ngram\+\_\+iter\+\_\+t} $\ast$itor)}



Implementation-\/specific function for iterating. 



Definition at line \textbf{ 187} of file \textbf{ ngram\+\_\+model\+\_\+internal.\+h}.



Referenced by \textbf{ ngram\+\_\+iter\+\_\+free()}.

\label{structngram__funcs__s_ada065707d0f08a4fb835df1edcd6d240} 
\index{ngram\_funcs\_s@{ngram\_funcs\_s}!iter\_get@{iter\_get}}
\index{iter\_get@{iter\_get}!ngram\_funcs\_s@{ngram\_funcs\_s}}
\doxysubsubsection{iter\_get}
{\footnotesize\ttfamily int32 const  $\ast$($\ast$ ngram\+\_\+funcs\+\_\+s\+::iter\+\_\+get) (\textbf{ ngram\+\_\+iter\+\_\+t} $\ast$itor, int32 $\ast$out\+\_\+score, int32 $\ast$out\+\_\+bowt)}



Implementation-\/specific function for iterating. 



Definition at line \textbf{ 175} of file \textbf{ ngram\+\_\+model\+\_\+internal.\+h}.



Referenced by \textbf{ ngram\+\_\+iter\+\_\+get()}.

\label{structngram__funcs__s_a4e65f8f0f731df51646bd1fef0b944b3} 
\index{ngram\_funcs\_s@{ngram\_funcs\_s}!iter\_next@{iter\_next}}
\index{iter\_next@{iter\_next}!ngram\_funcs\_s@{ngram\_funcs\_s}}
\doxysubsubsection{iter\_next}
{\footnotesize\ttfamily \textbf{ ngram\+\_\+iter\+\_\+t} $\ast$($\ast$ ngram\+\_\+funcs\+\_\+s\+::iter\+\_\+next) (\textbf{ ngram\+\_\+iter\+\_\+t} $\ast$itor)}



Implementation-\/specific function for iterating. 



Definition at line \textbf{ 182} of file \textbf{ ngram\+\_\+model\+\_\+internal.\+h}.



Referenced by \textbf{ ngram\+\_\+iter\+\_\+next()}.

\label{structngram__funcs__s_a085d92301268f0c2b377cfac2ee02fc5} 
\index{ngram\_funcs\_s@{ngram\_funcs\_s}!mgrams@{mgrams}}
\index{mgrams@{mgrams}!ngram\_funcs\_s@{ngram\_funcs\_s}}
\doxysubsubsection{mgrams}
{\footnotesize\ttfamily \textbf{ ngram\+\_\+iter\+\_\+t} $\ast$($\ast$ ngram\+\_\+funcs\+\_\+s\+::mgrams) (\textbf{ ngram\+\_\+model\+\_\+t} $\ast$model, int32 m)}



Implementation-\/specific function for iterating. 



Definition at line \textbf{ 165} of file \textbf{ ngram\+\_\+model\+\_\+internal.\+h}.



Referenced by \textbf{ ngram\+\_\+model\+\_\+mgrams()}.

\label{structngram__funcs__s_a9c9f83dc5151495a21b7eff16ad747d3} 
\index{ngram\_funcs\_s@{ngram\_funcs\_s}!raw\_score@{raw\_score}}
\index{raw\_score@{raw\_score}!ngram\_funcs\_s@{ngram\_funcs\_s}}
\doxysubsubsection{raw\_score}
{\footnotesize\ttfamily int32($\ast$ ngram\+\_\+funcs\+\_\+s\+::raw\+\_\+score) (\textbf{ ngram\+\_\+model\+\_\+t} $\ast$model, int32 wid, int32 $\ast$history, int32 n\+\_\+hist, int32 $\ast$n\+\_\+used)}



Implementation-\/specific function for querying raw language model probability. 



Definition at line \textbf{ 134} of file \textbf{ ngram\+\_\+model\+\_\+internal.\+h}.



Referenced by \textbf{ ngram\+\_\+ng\+\_\+prob()}.

\label{structngram__funcs__s_ab74c094f1e88465559fdd29859bf4395} 
\index{ngram\_funcs\_s@{ngram\_funcs\_s}!score@{score}}
\index{score@{score}!ngram\_funcs\_s@{ngram\_funcs\_s}}
\doxysubsubsection{score}
{\footnotesize\ttfamily int32($\ast$ ngram\+\_\+funcs\+\_\+s\+::score) (\textbf{ ngram\+\_\+model\+\_\+t} $\ast$model, int32 wid, int32 $\ast$history, int32 n\+\_\+hist, int32 $\ast$n\+\_\+used)}



Implementation-\/specific function for querying language model score. 



Definition at line \textbf{ 125} of file \textbf{ ngram\+\_\+model\+\_\+internal.\+h}.



Referenced by \textbf{ ngram\+\_\+ng\+\_\+score()}.

\label{structngram__funcs__s_ae6a3c703e6a4abb21cca7aea6959f04d} 
\index{ngram\_funcs\_s@{ngram\_funcs\_s}!successors@{successors}}
\index{successors@{successors}!ngram\_funcs\_s@{ngram\_funcs\_s}}
\doxysubsubsection{successors}
{\footnotesize\ttfamily \textbf{ ngram\+\_\+iter\+\_\+t} $\ast$($\ast$ ngram\+\_\+funcs\+\_\+s\+::successors) (\textbf{ ngram\+\_\+iter\+\_\+t} $\ast$itor)}



Implementation-\/specific function for iterating. 



Definition at line \textbf{ 170} of file \textbf{ ngram\+\_\+model\+\_\+internal.\+h}.



Referenced by \textbf{ ngram\+\_\+iter\+\_\+successors()}.



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