Functions
flat_fwd.c File Reference

Implementation of forward search in a flat lexicon. More...

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include <s3types.h>
#include "mdef.h"
#include "tmat.h"
#include "dict.h"
#include "lm.h"
#include "fillpen.h"
#include "logs3.h"
#include "search.h"
#include "ctxt_table.h"
#include "dag.h"
#include "srch_flat_fwd_internal.h"

Functions

void dump_all_whmm (srch_FLAT_FWD_graph_t *fwg, whmm_t **whmm, int32 n_frm, int32 *senscr)
 
void dump_all_word (srch_FLAT_FWD_graph_t *fwg, whmm_t **whmm)
 
int32 whmm_eval (srch_FLAT_FWD_graph_t *fwg, int32 *senscr)
 
void whmm_renorm (srch_FLAT_FWD_graph_t *fwg, whmm_t **whmm, int32 bestscr)
 
void whmm_transition (srch_FLAT_FWD_graph_t *fwg, whmm_t **whmm, int32 w, whmm_t *h)
 
void whmm_exit (srch_FLAT_FWD_graph_t *fwg, whmm_t **whmm, latticehist_t *lathist, int32 thresh, int32 wordthresh, int32 phone_penalty)
 
void word_enter (srch_FLAT_FWD_graph_t *fwg, s3wid_t w, int32 score, s3latid_t l, s3cipid_t lc)
 
void word_trans (srch_FLAT_FWD_graph_t *fwg, whmm_t **whmm, latticehist_t *lathist, int32 thresh, int32 phone_penalty)
 
void flat_fwd_dag_add_fudge_edges (srch_FLAT_FWD_graph_t *fwg, dag_t *dagp, int32 fudge, int32 min_ef_range, void *hist, dict_t *dict)
 
void build_word_cand_cf (int32 cf, dict_t *dict, s3wid_t *wcand_cf, int32 word_cand_win, word_cand_t **wcand)
 
int32 word_cand_load (FILE *fp, word_cand_t **wcand, dict_t *dict, char *uttid)
 
void word_cand_free (word_cand_t **wcand)
 

Detailed Description

Implementation of forward search in a flat lexicon.

Function Documentation

void build_word_cand_cf ( int32  cf,
dict_t *  dict,
s3wid_t *  wcand_cf,
int32  word_cand_win,
word_cand_t **  wcand 
)

Build array of candidate words that start around the current frame (cf). Note: filler words are not in this list since they are always searched (see word_trans).

Parameters
cfCurrent frame
dictThe dictionary
wcand_cfThe array of word candidate
word_cand_winIn frame f, candidate words in input lattice from frames [(f - word_cand_win) .. (f + word_cand_win)] will be the actual candidates to be started(entered)

References BAD_S3WID, dict_t::filler_start, dict_t::finishwid, dict_t::n_word, word_cand_s::next, S3_MAX_FRAMES, dict_t::startwid, and word_cand_s::wid.

Referenced by word_trans().

void dump_all_whmm ( srch_FLAT_FWD_graph_t *  fwg,
whmm_t **  whmm,
int32  n_frm,
int32 *  senscr 
)
void dump_all_word ( srch_FLAT_FWD_graph_t *  fwg,
whmm_t **  whmm 
)
void flat_fwd_dag_add_fudge_edges ( srch_FLAT_FWD_graph_t *  fwg,
dag_t *  dagp,
int32  fudge,
int32  min_ef_range,
void *  hist,
dict_t *  dict 
)
int32 whmm_eval ( srch_FLAT_FWD_graph_t *  fwg,
int32 *  senscr 
)
void whmm_exit ( srch_FLAT_FWD_graph_t *  fwg,
whmm_t **  whmm,
latticehist_t *  lathist,
int32  thresh,
int32  wordthresh,
int32  phone_penalty 
)
void whmm_renorm ( srch_FLAT_FWD_graph_t *  fwg,
whmm_t **  whmm,
int32  bestscr 
)
void whmm_transition ( srch_FLAT_FWD_graph_t *  fwg,
whmm_t **  whmm,
int32  w,
whmm_t *  h 
)

Transition from hmm h into the next appropriate one for word w. Threshold check for incoming score already completed. The next HMM may be the last triphone for the word w, in which case, instantiate multiple instances corresponding cross-word triphone modelling for all right context ciphones.

References dictword_t::ciphone, srch_FLAT_FWD_graph_s::ctxt, ctxt_table_word_int_ssid, FALSE, get_rcssid(), hmm_enter(), hmm_in_score, hmm_out_history, hmm_out_score, srch_FLAT_FWD_graph_s::hmmctx, srch_FLAT_FWD_graph_s::kbcore, kbcore_dict, kbcore_tmat, srch_FLAT_FWD_graph_s::n_frm, word_ugprob_s::next, dictword_t::pronlen, whmm_alloc(), and dict_t::word.

Referenced by whmm_exit().

void word_cand_free ( word_cand_t **  wcand)

Free word candidate

Parameters
wcandlist of word candidate to free

References word_ugprob_s::next, word_cand_s::next, and S3_MAX_FRAMES.

int32 word_cand_load ( FILE *  fp,
word_cand_t **  wcand,
dict_t *  dict,
char *  uttid 
)

Load word candidate into a list

Parameters
fpAn initialized for inputfile poiner
wcandlist of word candidate
dictThe dictionary
uttidThe ID of an utterance

References dict_basewid, dict_wordid(), word_cand_s::next, NOT_S3WID, S3_MAX_FRAMES, and word_cand_s::wid.

void word_enter ( srch_FLAT_FWD_graph_t *  fwg,
s3wid_t  w,
int32  score,
s3latid_t  l,
s3cipid_t  lc 
)
void word_trans ( srch_FLAT_FWD_graph_t *  fwg,
whmm_t **  whmm,
latticehist_t *  lathist,
int32  thresh,
int32  phone_penalty 
)