\doxysection{ngram\+\_\+model\+\_\+dmp32.\+c}
\label{ngram__model__dmp32_8c_source}\index{src/libsphinxbase/lm/ngram\_model\_dmp32.c@{src/libsphinxbase/lm/ngram\_model\_dmp32.c}}

\begin{DoxyCode}{0}
\DoxyCodeLine{00001\ \textcolor{comment}{/*\ -\/*-\/\ c-\/basic-\/offset:\ 4;\ indent-\/tabs-\/mode:\ nil\ -\/*-\/\ */}}
\DoxyCodeLine{00002\ \textcolor{comment}{/*\ ====================================================================}}
\DoxyCodeLine{00003\ \textcolor{comment}{\ *\ Copyright\ (c)\ 1999-\/2007\ Carnegie\ Mellon\ University.\ \ All\ rights}}
\DoxyCodeLine{00004\ \textcolor{comment}{\ *\ reserved.}}
\DoxyCodeLine{00005\ \textcolor{comment}{\ *}}
\DoxyCodeLine{00006\ \textcolor{comment}{\ *\ Redistribution\ and\ use\ in\ source\ and\ binary\ forms,\ with\ or\ without}}
\DoxyCodeLine{00007\ \textcolor{comment}{\ *\ modification,\ are\ permitted\ provided\ that\ the\ following\ conditions}}
\DoxyCodeLine{00008\ \textcolor{comment}{\ *\ are\ met:}}
\DoxyCodeLine{00009\ \textcolor{comment}{\ *}}
\DoxyCodeLine{00010\ \textcolor{comment}{\ *\ 1.\ Redistributions\ of\ source\ code\ must\ retain\ the\ above\ copyright}}
\DoxyCodeLine{00011\ \textcolor{comment}{\ *\ \ \ \ notice,\ this\ list\ of\ conditions\ and\ the\ following\ disclaimer.\ }}
\DoxyCodeLine{00012\ \textcolor{comment}{\ *}}
\DoxyCodeLine{00013\ \textcolor{comment}{\ *\ 2.\ Redistributions\ in\ binary\ form\ must\ reproduce\ the\ above\ copyright}}
\DoxyCodeLine{00014\ \textcolor{comment}{\ *\ \ \ \ notice,\ this\ list\ of\ conditions\ and\ the\ following\ disclaimer\ in}}
\DoxyCodeLine{00015\ \textcolor{comment}{\ *\ \ \ \ the\ documentation\ and/or\ other\ materials\ provided\ with\ the}}
\DoxyCodeLine{00016\ \textcolor{comment}{\ *\ \ \ \ distribution.}}
\DoxyCodeLine{00017\ \textcolor{comment}{\ *}}
\DoxyCodeLine{00018\ \textcolor{comment}{\ *\ This\ work\ was\ supported\ in\ part\ by\ funding\ from\ the\ Defense\ Advanced\ }}
\DoxyCodeLine{00019\ \textcolor{comment}{\ *\ Research\ Projects\ Agency\ and\ the\ National\ Science\ Foundation\ of\ the\ }}
\DoxyCodeLine{00020\ \textcolor{comment}{\ *\ United\ States\ of\ America,\ and\ the\ CMU\ Sphinx\ Speech\ Consortium.}}
\DoxyCodeLine{00021\ \textcolor{comment}{\ *}}
\DoxyCodeLine{00022\ \textcolor{comment}{\ *\ THIS\ SOFTWARE\ IS\ PROVIDED\ BY\ CARNEGIE\ MELLON\ UNIVERSITY\ \`{}\`{}AS\ IS''\ AND\ }}
\DoxyCodeLine{00023\ \textcolor{comment}{\ *\ ANY\ EXPRESSED\ OR\ IMPLIED\ WARRANTIES,\ INCLUDING,\ BUT\ NOT\ LIMITED\ TO,\ }}
\DoxyCodeLine{00024\ \textcolor{comment}{\ *\ THE\ IMPLIED\ WARRANTIES\ OF\ MERCHANTABILITY\ AND\ FITNESS\ FOR\ A\ PARTICULAR}}
\DoxyCodeLine{00025\ \textcolor{comment}{\ *\ PURPOSE\ ARE\ DISCLAIMED.\ \ IN\ NO\ EVENT\ SHALL\ CARNEGIE\ MELLON\ UNIVERSITY}}
\DoxyCodeLine{00026\ \textcolor{comment}{\ *\ NOR\ ITS\ EMPLOYEES\ BE\ LIABLE\ FOR\ ANY\ DIRECT,\ INDIRECT,\ INCIDENTAL,}}
\DoxyCodeLine{00027\ \textcolor{comment}{\ *\ SPECIAL,\ EXEMPLARY,\ OR\ CONSEQUENTIAL\ DAMAGES\ (INCLUDING,\ BUT\ NOT\ }}
\DoxyCodeLine{00028\ \textcolor{comment}{\ *\ LIMITED\ TO,\ PROCUREMENT\ OF\ SUBSTITUTE\ GOODS\ OR\ SERVICES;\ LOSS\ OF\ USE,\ }}
\DoxyCodeLine{00029\ \textcolor{comment}{\ *\ DATA,\ OR\ PROFITS;\ OR\ BUSINESS\ INTERRUPTION)\ HOWEVER\ CAUSED\ AND\ ON\ ANY\ }}
\DoxyCodeLine{00030\ \textcolor{comment}{\ *\ THEORY\ OF\ LIABILITY,\ WHETHER\ IN\ CONTRACT,\ STRICT\ LIABILITY,\ OR\ TORT\ }}
\DoxyCodeLine{00031\ \textcolor{comment}{\ *\ (INCLUDING\ NEGLIGENCE\ OR\ OTHERWISE)\ ARISING\ IN\ ANY\ WAY\ OUT\ OF\ THE\ USE\ }}
\DoxyCodeLine{00032\ \textcolor{comment}{\ *\ OF\ THIS\ SOFTWARE,\ EVEN\ IF\ ADVISED\ OF\ THE\ POSSIBILITY\ OF\ SUCH\ DAMAGE.}}
\DoxyCodeLine{00033\ \textcolor{comment}{\ *}}
\DoxyCodeLine{00034\ \textcolor{comment}{\ *\ ====================================================================}}
\DoxyCodeLine{00035\ \textcolor{comment}{\ *}}
\DoxyCodeLine{00036\ \textcolor{comment}{\ */}}
\DoxyCodeLine{00037\ \textcolor{comment}{/*}}
\DoxyCodeLine{00038\ \textcolor{comment}{\ *\ \(\backslash\)file\ ngram\_model\_dmp32.c\ DMP32\ format\ language\ models}}
\DoxyCodeLine{00039\ \textcolor{comment}{\ *}}
\DoxyCodeLine{00040\ \textcolor{comment}{\ *\ Author:\ David\ Huggins-\/Daines\ <dhuggins@cs.cmu.edu>}}
\DoxyCodeLine{00041\ \textcolor{comment}{\ */}}
\DoxyCodeLine{00042\ }
\DoxyCodeLine{00043\ \textcolor{preprocessor}{\#include\ "{}sphinxbase/ckd\_alloc.h"{}}}
\DoxyCodeLine{00044\ }
\DoxyCodeLine{00045\ \textcolor{preprocessor}{\#include\ "{}ngram\_model\_internal.h"{}}}
\DoxyCodeLine{00046\ }
\DoxyCodeLine{00047\ \textcolor{keyword}{static}\ ngram\_funcs\_t\ ngram\_model\_dmp32\_funcs;}
\DoxyCodeLine{00048\ }
\DoxyCodeLine{00049\ ngram\_model\_t\ *}
\DoxyCodeLine{00050\ ngram\_model\_dmp32\_read(cmd\_ln\_t\ *config,}
\DoxyCodeLine{00051\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *file\_name,}
\DoxyCodeLine{00052\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ logmath\_t\ *lmath)}
\DoxyCodeLine{00053\ \{}
\DoxyCodeLine{00054\ \ \ \ \ \textcolor{keywordflow}{return}\ NULL;}
\DoxyCodeLine{00055\ \}}
\DoxyCodeLine{00056\ }
\DoxyCodeLine{00057\ \textcolor{keywordtype}{int}}
\DoxyCodeLine{00058\ ngram\_model\_dmp32\_write(ngram\_model\_t\ *model,}
\DoxyCodeLine{00059\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *file\_name)}
\DoxyCodeLine{00060\ \{}
\DoxyCodeLine{00061\ \ \ \ \ \textcolor{keywordflow}{return}\ -\/1;}
\DoxyCodeLine{00062\ \}}
\DoxyCodeLine{00063\ }
\DoxyCodeLine{00064\ \textcolor{keyword}{static}\ \textcolor{keywordtype}{int}}
\DoxyCodeLine{00065\ ngram\_model\_dmp32\_apply\_weights(ngram\_model\_t\ *model,\ float32\ lw,}
\DoxyCodeLine{00066\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ float32\ wip,\ float32\ uw)}
\DoxyCodeLine{00067\ \{}
\DoxyCodeLine{00068\ \ \ \ \ \textcolor{keywordflow}{return}\ 0;}
\DoxyCodeLine{00069\ \}}
\DoxyCodeLine{00070\ }
\DoxyCodeLine{00071\ \textcolor{keyword}{static}\ int32}
\DoxyCodeLine{00072\ ngram\_model\_dmp32\_score(ngram\_model\_t\ *model,\ int32\ wid,}
\DoxyCodeLine{00073\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ int32\ *history,\ int32\ n\_hist,}
\DoxyCodeLine{00074\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ int32\ *n\_used)}
\DoxyCodeLine{00075\ \{}
\DoxyCodeLine{00076\ \ \ \ \ \textcolor{keywordflow}{return}\ model-\/>log\_zero;}
\DoxyCodeLine{00077\ \}}
\DoxyCodeLine{00078\ }
\DoxyCodeLine{00079\ \textcolor{keyword}{static}\ int32}
\DoxyCodeLine{00080\ ngram\_model\_dmp32\_raw\_score(ngram\_model\_t\ *model,\ int32\ wid,}
\DoxyCodeLine{00081\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ int32\ *history,\ int32\ n\_hist,}
\DoxyCodeLine{00082\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ int32\ *n\_used)}
\DoxyCodeLine{00083\ \{}
\DoxyCodeLine{00084\ \ \ \ \ \textcolor{keywordflow}{return}\ model-\/>log\_zero;}
\DoxyCodeLine{00085\ \}}
\DoxyCodeLine{00086\ }
\DoxyCodeLine{00087\ \textcolor{keyword}{static}\ \textcolor{keywordtype}{void}}
\DoxyCodeLine{00088\ ngram\_model\_dmp32\_free(ngram\_model\_t\ *base)}
\DoxyCodeLine{00089\ \{}
\DoxyCodeLine{00090\ \ \ \ \ ckd\_free(base);}
\DoxyCodeLine{00091\ \}}
\DoxyCodeLine{00092\ }
\DoxyCodeLine{00093\ \textcolor{keyword}{static}\ ngram\_funcs\_t\ ngram\_model\_dmp32\_funcs\ =\ \{}
\DoxyCodeLine{00094\ \ \ \ \ ngram\_model\_dmp32\_free,\ \ \ \ \ \ \ \ \ \ \textcolor{comment}{/*\ free\ */}}
\DoxyCodeLine{00095\ \ \ \ \ ngram\_model\_dmp32\_apply\_weights,\ \textcolor{comment}{/*\ apply\_weights\ */}}
\DoxyCodeLine{00096\ \ \ \ \ ngram\_model\_dmp32\_score,\ \ \ \ \ \ \ \ \ \textcolor{comment}{/*\ score\ */}}
\DoxyCodeLine{00097\ \ \ \ \ ngram\_model\_dmp32\_raw\_score,\ \ \ \ \ \textcolor{comment}{/*\ raw\_score\ */}}
\DoxyCodeLine{00098\ \ \ \ \ NULL\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{/*\ add\_ug\ */}}
\DoxyCodeLine{00099\ \};}

\end{DoxyCode}
