Functions
dict2pid.c File Reference

Implementation of dict2pid. More...

#include <string.h>
#include "dict2pid.h"
#include "logs3.h"

Functions

void compress_table (s3ssid_t *uncomp_tab, s3ssid_t *com_tab, s3cipid_t *ci_map, int32 n_ci)
 
int32 get_rc_nssid (dict2pid_t *d2p, s3wid_t w, dict_t *dict)
 
s3cipid_tdict2pid_get_rcmap (dict2pid_t *d2p, s3wid_t w, dict_t *dict)
 
dict2pid_tdict2pid_build (mdef_t *mdef, dict_t *dict, int32 is_composite, logmath_t *logmath)
 
void dict2pid_free (dict2pid_t *d2p)
 
void dict2pid_report (dict2pid_t *d2p)
 
void dict2pid_comsenscr (dict2pid_t *d2p, int32 *senscr, int32 *comsenscr)
 
void dict2pid_comsseq2sen_active (dict2pid_t *d2p, mdef_t *mdef, uint8 *comssid, uint8 *sen)
 
void dict2pid_dump (FILE *fp, dict2pid_t *d2p, mdef_t *mdef, dict_t *dict)
 

Detailed Description

Implementation of dict2pid.

A general remark, notice "comsseq" sometimes means compressed sequence. It should be understood as differnet thing as composite in the source code.

Function Documentation

◆ compress_table()

void compress_table ( s3ssid_t uncomp_tab,
s3ssid_t com_tab,
s3cipid_t ci_map,
int32  n_ci 
)

Compress this map

References BAD_S3CIPID, and BAD_S3SSID.

◆ dict2pid_build()

dict2pid_t* dict2pid_build ( mdef_t mdef,
dict_t dict,
int32  is_composite,
logmath_t *  logmath 
)

Build the dict2pid structure for the given model/dictionary

This segments of code take care of the initialization of internal[0] and ldiph[b][r][l]

This part will take care of the initialization of internal[pronlen-1] and rdiph[b][l][r]. Notice that this is symmetric to the first part of the code.

Parameters
mdefA model definition
dictAn initialized dictionary
is_compositeWhether composite triphones will be built

◆ dict2pid_comsenscr()

void dict2pid_comsenscr ( dict2pid_t d2p,
int32 *  senscr,
int32 *  comsenscr 
)

Populate composite senone score array.

The composite senone score is the maximum of its component senones' scores, scaled down by the number of component senones.

Parameters
d2pIn: a dict2pid_t structure
senscrIn: Ordinary senone scores
comsenscrOut: Composite senone scores

References dict2pid_t::comstate, dict2pid_t::comwt, dict2pid_t::n_comstate, and NOT_S3SENID.

◆ dict2pid_comsseq2sen_active()

void dict2pid_comsseq2sen_active ( dict2pid_t d2p,
mdef_t mdef,
uint8 *  comssid,
uint8 *  sen 
)

Mark senones active based on a set of active composite senones.

Parameters
d2pIn: a dict2pid_t structure
mdefIn: a mdef_t structure
comssidIn: Active flag for each comssid
senIn/Out: Active flags set for senones indicated by the active comssid

◆ dict2pid_dump()

void dict2pid_dump ( FILE *  fp,
dict2pid_t d2p,
mdef_t mdef,
dict_t dict 
)

For debugging

Parameters
fpIn: a file pointer
d2pIn: a dict2pid_t structure
mdefIn: a mdef_t structure
dictIn: a dictionary structure

◆ dict2pid_free()

void dict2pid_free ( dict2pid_t d2p)

◆ dict2pid_get_rcmap()

s3cipid_t* dict2pid_get_rcmap ( dict2pid_t d2p,
s3wid_t  w,
dict_t dict 
)

Get RC map

Parameters
d2pIn: a dict2pid
wIn: a wid
dictIn: a dictionary

◆ dict2pid_report()

void dict2pid_report ( dict2pid_t d2p)

Report a dict2pid data structure

Parameters
d2pIn: a dict2pid_t structure

References dict2pid_t::is_composite, dict2pid_t::n_comsseq, and dict2pid_t::n_comstate.

◆ get_rc_nssid()

int32 get_rc_nssid ( dict2pid_t d2p,
s3wid_t  w,
dict_t dict 
)

ARCHAN, A duplicate of get_rc_npid in ctxt_table.h. I doubt whether it is correct because the compressed map has not been checked.

Parameters
d2pIn: a dict2pid
wIn: a wid
dictIn: a dictionary