srch_flat_fwd_internal.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076 #ifndef SRCH_FLT_FWD_INTERNAL
00077 #define SRCH_FLT_FWD_INTERNAL
00078
00079
00080 #include <stdio.h>
00081
00082 #include <profile.h>
00083 #include <s3types.h>
00084 #include <lm.h>
00085 #include <kbcore.h>
00086 #include <vithist.h>
00087 #include <word_ugprob.h>
00088 #include <word_graph.h>
00089 #include <whmm.h>
00090 #include <hmm.h>
00091 #include <ctxt_table.h>
00092 #include <dict.h>
00093
00094 #ifdef __cplusplus
00095 extern "C" {
00096 #endif
00097 #if 0
00098
00099 }
00100 #endif
00101
00107 typedef struct {
00108 s3wid_t trace_wid;
00109 int32 word_dump_sf;
00110 int32 word_dump_ef;
00111 int32 hmm_dump_sf;
00112 int32 hmm_dump_ef;
00113 } fwd_dbg_t ;
00114
00115
00123 typedef struct {
00124 s3latid_t latid;
00125 int32 score;
00126 s3cipid_t lc;
00128 } backoff_t;
00129
00130 typedef struct word_cand_s {
00131 s3wid_t wid;
00132 struct word_cand_s *next;
00133 } word_cand_t;
00134
00135
00136
00137
00138
00139
00140 typedef struct srch_FLAT_FWD_graph_s {
00141
00158
00159
00160
00161 char const *word_cand_dir;
00165 char const *latfile_ext;
00167 int32 word_cand_win;
00170 word_cand_t **word_cand;
00172 int32 n_word_cand;
00179 hmm_context_t *hmmctx;
00180 whmm_t **whmm;
00182 word_ugprob_t **word_ugprob;
00183 backoff_t *ug_backoff;
00184 backoff_t *filler_backoff;
00185 uint8 *tg_trans_done;
00189 int32 *rcscore;
00191 s3wid_t *word_cand_cf;
00195 ctxt_table_t *ctxt;
00200 fwd_dbg_t *fwdDBG;
00202 latticehist_t *lathist;
00204
00205
00206
00207 int32 n_frm;
00208 int32 final_state;
00209 int32 renormalized;
00210 int32 multiplex;
00211 int32 multiplex_singleph;
00213
00214 pctr_t* ctr_mpx_whmm;
00215 pctr_t* ctr_nonmpx_whmm;
00216 pctr_t* ctr_latentry;
00217
00218 ptmr_t tm_hmmeval;
00219 ptmr_t tm_hmmtrans;
00220 ptmr_t tm_wdtrans;
00221
00222 kbcore_t* kbcore;
00223 } srch_FLAT_FWD_graph_t ;
00224
00225
00231 void build_word_cand_cf (int32 cf,
00232 dict_t *dict,
00233 s3wid_t* wcand_cf,
00234 int32 word_cand_win,
00237 word_cand_t ** wcand
00238
00239 );
00240
00241
00242
00246 int32 word_cand_load (FILE *fp,
00247 word_cand_t** wcand,
00248 dict_t *dict,
00249 char* uttid
00250 );
00251
00252
00256 void word_cand_free ( word_cand_t ** wcand
00257 );
00258
00260 int32 whmm_eval(srch_FLAT_FWD_graph_t * fwg, int32 * senscr);
00261
00262 void dump_all_whmm(srch_FLAT_FWD_graph_t * fwg, whmm_t ** whmm,
00263 int32 n_frm, int32 * senscr);
00264
00265 void dump_all_word(srch_FLAT_FWD_graph_t * fwg, whmm_t ** whmm);
00266
00267 void whmm_renorm(srch_FLAT_FWD_graph_t * fwg, whmm_t ** whmm, int32 bestscr);
00268
00269 void whmm_transition(srch_FLAT_FWD_graph_t * fwg, whmm_t ** whmm, int32 w,
00270 whmm_t * h);
00271
00272 void word_enter(srch_FLAT_FWD_graph_t * fwg, s3wid_t w,
00273 int32 score, s3latid_t l, s3cipid_t lc);
00274
00275 void whmm_exit(srch_FLAT_FWD_graph_t * fwg,
00276 whmm_t ** whmm,
00277 latticehist_t * lathist,
00278 int32 thresh, int32 wordthresh, int32 phone_penalty);
00279
00280
00281 void word_trans(srch_FLAT_FWD_graph_t * fwg,
00282 whmm_t ** whmm,
00283 latticehist_t * lathist,
00284 int32 thresh, int32 phone_penalty);
00285
00286 void flat_fwd_dag_add_fudge_edges(srch_FLAT_FWD_graph_t * fwg,
00287 dag_t * dagp,
00288 int32 fudge,
00289 int32 min_ef_range,
00290 void *hist, dict_t * dict);
00291
00292 #ifdef __cplusplus
00293 }
00294 #endif
00295
00296
00297 #endif