Defines | Functions
srch_output.h File Reference
#include <stdio.h>
#include <s3types.h>
#include <glist.h>
#include <dict.h>
#include <lm.h>
#include <search.h>

Go to the source code of this file.

Defines

#define HYPSEG_SUCCESS   1
#define HYPSEG_FAILURE   0
#define WORST_CONFIDENCE_SCORE   ((int)0xE0000000)

Functions

int32 compute_scale (int32 sf, int32 ef, int32 *scalearray)
S3DECODER_EXPORT void match_write (FILE *fp, glist_t hyp, char *uttid, dict_t *dict, char *hdr)
S3DECODER_EXPORT void matchseg_write (FILE *fp, glist_t hyp, char *uttid, char *hdr, lm_t *lm, dict_t *dict, int32 num_frm, int32 *scl, int32 unnorm)
void match_detailed (FILE *fp, glist_t hyp, char *uttid, char *LBL, char *lbl, int32 *senscale, dict_t *dict)
S3DECODER_EXPORT int read_s3hypseg_line (char *line, seg_hyp_line_t *seg_hyp_line, lm_t *lm, dict_t *dict)
S3DECODER_EXPORT int free_seg_hyp_line (seg_hyp_line_t *seg_hyp_line)
S3DECODER_EXPORT void log_hypstr (FILE *fp, srch_hyp_t *hypptr, char *uttid, int32 exact, int32 scr, dict_t *dict)
S3DECODER_EXPORT void log_hyp_detailed (FILE *fp, srch_hyp_t *hypptr, char *uttid, char *LBL, char *lbl, int32 *senscale)
void log_hypseg (char *uttid, FILE *fp, srch_hyp_t *hypptr, int32 nfrm, int32 scl, float64 lwf, dict_t *dict, lm_t *lm, int32 unnorm)

Define Documentation

#define HYPSEG_FAILURE   0
#define HYPSEG_SUCCESS   1
#define WORST_CONFIDENCE_SCORE   ((int)0xE0000000)

Function Documentation

int32 compute_scale ( int32  sf,
int32  ef,
int32 *  scalearray 
)
S3DECODER_EXPORT int free_seg_hyp_line ( seg_hyp_line_t seg_hyp_line)
S3DECODER_EXPORT void log_hyp_detailed ( FILE *  fp,
srch_hyp_t hypptr,
char *  uttid,
char *  LBL,
char *  lbl,
int32 *  senscale 
)
Parameters:
fpA file poointer
hypptrA srch_hyp_t
uttidAn utternace ID
LBLA header in cap
lblA header in small
senscaleSenone scale vector, if specified, normalized score would be displayed, if not, the unormalized score would be displayed.
void log_hypseg ( char *  uttid,
FILE *  fp,
srch_hyp_t hypptr,
int32  nfrm,
int32  scl,
float64  lwf,
dict_t dict,
lm_t lm,
int32  unnorm 
)

CODE DUPLICATION!!! Sphinx 3.0 family of logging hyp and hyp segments When hyp_t, srch_hyp_t are united, we could tie it with match_write (20051109) ARCHAN: The only consumer of log_hypseg now is main_dag.c

Parameters:
uttidInput; uttid
fpOut: output file
hypptrIn: Hypothesis
nfrmIn: #frames in utterance
sclIn: Acoustic scaling for entire utt
lwfIn: LM score scale-factor (in dagsearch)
dictIn: dictionary
lmIn: LM
unnormWhether unscaled the score back
S3DECODER_EXPORT void log_hypstr ( FILE *  fp,
srch_hyp_t hypptr,
char *  uttid,
int32  exact,
int32  scr,
dict_t dict 
)

CODE DUPLICATION!!! Sphinx 3.0 family of logging hyp and hyp segments When hyp_t, srch_hyp_t are united, we could tie it with match_write (20051109) ARCHAN: The only consumer of log_hypstr now is main_dag.c

Parameters:
fpA file pointer
hypptrA srch_hyp_t
uttidAn utterance ID
exactWhether to dump an exact
scrThe score
dictA dictionary to look up wid
void match_detailed ( FILE *  fp,
glist_t  hyp,
char *  uttid,
char *  LBL,
char *  lbl,
int32 *  senscale,
dict_t dict 
)

wrapping up the detail match display. Comparable with log_hyp_detailed . The only difference is match_detailed use a link list of srch_hyp_t

Parameters:
fpThe file pointer
hypA link-list that containt the hypothesis
uttidThe utterance ID
LBLA header in cap
lblA header in small
senscaleSenone scale vector, if specified, normalized score would be displayed, if not, the unormalized score would be displayed.
dictDictionary
S3DECODER_EXPORT void match_write ( FILE *  fp,
glist_t  hyp,
char *  uttid,
dict_t dict,
char *  hdr 
)

write a match file

NOTE: Current match_write has four features which is different with log_hypstr. 1, match_write allows the use of hdr. 2, log_hypstr allows matchexact in output. 3, log_hypstr allows output the score after the match file name. 4, log_hypstr will dump the pronounciation variation to the code.

I don't think they are very important in processing so I removed them.

Parameters:
fpThe file pointer
hypA link-list that contains the hypothesis
uttidUtterance id
dictThe dictionary
hdrThe header
S3DECODER_EXPORT void matchseg_write ( FILE *  fp,
glist_t  hyp,
char *  uttid,
char *  hdr,
lm_t lm,
dict_t dict,
int32  num_frm,
int32 *  scl,
int32  unnorm 
)

write match segment

Parameters:
fpThe file pointer
hypA link-list that contains the hypotheesis
uttidUtterance ID of the file
hdrThe header
lmLanguage model
dictDictionary
num_frmNumber of frames
sclScale of the decoding. Required, if inverse normalization
unnormWhether unscaled the score back
S3DECODER_EXPORT int read_s3hypseg_line ( char *  line,
seg_hyp_line_t seg_hyp_line,
lm_t lm,
dict_t dict 
)

A funtion that reads the s3 hypseg line.

Parameters:
lineA line pointer
seg_hyp_lineA hypseg line structure
lmA LM
dictA dictionary