Go to the documentation of this file.
144 #include <hash_table.h>
154 #define LM_DICTWID_BADMAP -16000
155 #define LM_CLASSID_BASE 0x01000000
158 #define LM_LEGACY_CONSTANT BAD_S3LMWID
163 #define LM_SPHINX_CONSTANT BAD_S3LMWID32
172 #define LM_CLASSID_TO_CLASS(m,i) ((m)->lmclass[(i)-LM_CLASSID_BASE])
174 #define MIN_PROB_F -99.0
182 #define LM_ALLOC_BLOCK 16
191 #define LM_NOT_FOUND -1
193 #define LM_OFFSET_TOO_LARGE -2
199 #define LM_NO_DATA_MARK -3
202 #define LM_UNKNOWN_NG -4
204 #define LM_BAD_LM_COUNT -5
206 #define LM_UNKNOWN_WORDS -6
209 #define LM_BAD_BIGRAM -7
215 #define LM_BAD_TRIGRAM -8
221 #define LM_BAD_QUADGRAM -9
228 #define LM_BAD_QUINGRAM -10
239 #define LM_BAD_NGRAM -11
245 #define LM_TOO_MANY_NGRAM -12
249 #define LM_NO_MINUS_1GRAM -13
252 #define LM_FILE_NOT_FOUND -14
254 #define LM_CANNOT_ALLOCATE -15
258 #define LMDMP_VERSIONNULL 0
264 #define LMDMP_VERSION_TG_16BIT -1
268 #define LMDMP_VERSION_TG_16BIT_V2 -2
271 #define LMDMP_VERSION_TG_32BIT -3
277 #define LMTXT_VERSION 1000
278 #define LMFST_VERSION 1001
279 #define LMFORCED_TXT32VERSION 1002
548 #define LOG2_BG_SEG_SZ 9
549 #define BG_SEG_SZ (1 << (LOG2_BG_SEG_SZ))
550 #define LM_TGCACHE_SIZE 100003
559 typedef struct lm_s {
688 #define lm_lmwid2dictwid(lm,u) ((lm)->ug[u].dictwid)
689 #define lm_n_ug(lm) ((lm)->n_ug)
690 #define lm_n_bg(lm) ((lm)->n_bg)
691 #define lm_n_tg(lm) ((lm)->n_tg)
692 #define lm_wordstr(lm,u) ((lm)->wordstr[u])
693 #define lm_startwid(lm) ((lm)->startlwid)
694 #define lm_finishwid(lm) ((lm)->finishlwid)
695 #define lm_access_type(lm) ((lm)->access_type)
763 const char* lmctlfile,
766 const char* lmdumpdir,
789 const char *lmdumpdir,
802 const char* lmdumpdir,
920 int32 lm_bg_wordprob(
lm_t *lm,
1052 logmath_t *logmath);
1136 const char *outputfile,
1137 const char *filename,
1173 const char *outputfile,
1174 const char *filename,
1176 const char* inputenc,
1206 const char* filename
1351 #define LM_TGPROB(lm,tgptr) ((lm)->tgprob[(tgptr)->probid].l)
1352 #define LM_BGPROB(lm,bgptr) ((lm)->bgprob[(bgptr)->probid].l)
1353 #define LM_UGPROB(lm,ugptr) ((ugptr)->prob.l)
1354 #define LM_RAWSCORE(lm,score) ((score - (lm)->wip) / ((lm)->lw))
1355 #define LM_DICTWID(lm,lmwid) ((lm)->ug[(lmwid)].dictwid)