#include <sent/stddefs.h>
#include <sent/htk_defs.h>
#include <sent/ptree.h>
#include <sent/htk_param.h>
Include dependency graph for htk_hmm.h:
This graph shows which files directly or indirectly include this file:
Go to the source code of this file.
Defines | |
#define | currentis(A) (!strcasecmp(A, rdhmmdef_token)) |
Macro to check whether the next token is "A". | |
#define | NoTokErr(S) if (!rdhmmdef_token) rderr(S) |
Macro to jump to error if no token left. | |
#define | HMMDEF_DELM " \t\n<>" |
Delimiter string for parsing HMM definition file. | |
#define | MAX_STATE_NUM 65535 |
Possible maximum value of state ID (in unsigned short). | |
#define | HMM_RC_DLIM "+" |
Right context delimiter in string. | |
#define | HMM_LC_DLIM "-" |
Left context delimiter in string. | |
#define | HMM_RC_DLIM_C '+' |
Right context delimiter in character. | |
#define | HMM_LC_DLIM_C '-' |
Left context delimiter in character. | |
#define | SPMODEL_NAME_DEFAULT "sp" |
Default logical name of short pause model. | |
#define | MAX_HMMNAME_LEN 128 |
Length limit of HMM name (including ones generated in Julius). | |
Typedefs | |
typedef _HTK_HMM_trans | HTK_HMM_Trans |
HMM transition table | |
typedef _HTK_HMM_variance | HTK_HMM_Var |
HMM variance data | |
typedef _HTK_HMM_dens | HTK_HMM_Dens |
HMM Gaussian density (or mixture) data | |
typedef _HTK_HMM_state | HTK_HMM_State |
HMM state data | |
typedef _HTK_HMM_data | HTK_HMM_Data |
Top HMM model, corresponds to "~h" macro in hmmdefs. | |
typedef _cd_set | CD_Set |
Context-dependent HMM set (called "pseudo") for a logical context. | |
typedef _HMM_logical | HMM_Logical |
Logical HMM to map logical names to physical/pseudo HMM. | |
Enumerations | |
enum | iwcd_type { IWCD_MAX, IWCD_AVG, IWCD_NBEST } |
Specify method of calculating approximated acoustic score at inter-word context pseudo phones on word edge. More... | |
Functions | |
void | htk_hmm_set_pause_model (HTK_HMM_INFO *hmminfo, char *spmodel_name) |
void | rderr (char *str) |
char * | read_token (FILE *fp) |
void | init_hmm (HTK_HMM_INFO *) |
boolean | rdhmmdef (FILE *, HTK_HMM_INFO *) |
Main top routine to read in HTK HMM definition file. | |
void | set_global_opt (FILE *fp, HTK_HMM_INFO *hmm) |
char * | get_cov_str (short covtype) |
char * | get_dur_str (short durtype) |
void | trans_add (HTK_HMM_INFO *hmm, HTK_HMM_Trans *new) |
HTK_HMM_Trans * | get_trans_data (FILE *, HTK_HMM_INFO *) |
Return a pointer to the data located at the current point. | |
void | def_trans_macro (char *, FILE *, HTK_HMM_INFO *) |
HTK_HMM_State * | get_state_data (FILE *, HTK_HMM_INFO *) |
Return a pointer to the data located at the current point. | |
void | def_state_macro (char *, FILE *, HTK_HMM_INFO *) |
HTK_HMM_State * | state_lookup (HTK_HMM_INFO *hmm, char *keyname) |
void | state_add (HTK_HMM_INFO *hmm, HTK_HMM_State *new) |
HTK_HMM_Dens * | get_dens_data (FILE *, HTK_HMM_INFO *) |
Return a pointer to the data located at the current point. | |
void | def_dens_macro (char *, FILE *, HTK_HMM_INFO *) |
HTK_HMM_Dens * | dens_lookup (HTK_HMM_INFO *hmm, char *keyname) |
void | dens_add (HTK_HMM_INFO *hmm, HTK_HMM_Dens *new) |
HTK_HMM_Var * | get_var_data (FILE *, HTK_HMM_INFO *) |
Return a pointer to the data located at the current point. | |
void | def_var_macro (char *, FILE *, HTK_HMM_INFO *) |
void | var_add (HTK_HMM_INFO *hmm, HTK_HMM_Var *new) |
void | def_HMM (char *, FILE *, HTK_HMM_INFO *) |
HTK_HMM_Data * | htk_hmmdata_new () |
void | htk_hmmdata_add (HTK_HMM_INFO *hmm, HTK_HMM_Data *new) |
void | tmix_read (FILE *fp, HTK_HMM_State *state, HTK_HMM_INFO *hmm) |
Read a codebook name and weights, build the codebook structure on demand, and assigns them to the current state. | |
void | codebook_add (HTK_HMM_INFO *hmm, GCODEBOOK *new) |
void | def_regtree_macro (char *name, FILE *fp, HTK_HMM_INFO *hmm) |
boolean | rdhmmlist (FILE *fp, HTK_HMM_INFO *hmminfo) |
void | put_htk_trans (HTK_HMM_Trans *t) |
void | put_htk_var (HTK_HMM_Var *v) |
void | put_htk_dens (HTK_HMM_Dens *d) |
void | put_htk_state (HTK_HMM_State *s) |
void | put_htk_hmm (HTK_HMM_Data *h) |
void | put_logical_hmm (HMM_Logical *l) |
void | print_hmmdef_info (HTK_HMM_INFO *) |
HTK_HMM_INFO * | hmminfo_new () |
void | init_hmminfo (HTK_HMM_INFO *hmminfo, char *filename, char *mapfile) |
Load HTK HMM definition file and HMMList file, and setup phone HMM information. | |
HTK_HMM_Data * | htk_hmmdata_lookup_physical (HTK_HMM_INFO *, char *) |
HMM_Logical * | htk_hmmdata_lookup_logical (HTK_HMM_INFO *, char *) |
void | hmm_add_physical_to_logical (HTK_HMM_INFO *) |
Add all physical HMM to logical HMM. | |
void | hmm_add_pseudo_phones (HTK_HMM_INFO *hmminfo) |
void | make_hmm_basephone_list (HTK_HMM_INFO *hmminfo) |
boolean | check_hmm_limit (HTK_HMM_Data *dt) |
boolean | check_all_hmm_limit (HTK_HMM_INFO *hmm) |
boolean | check_hmm_options (HTK_HMM_INFO *hmm) |
boolean | guess_if_cd_hmm (HTK_HMM_INFO *hmm) |
HMM_Logical * | get_right_context_HMM (HMM_Logical *base, char *rc_name, HTK_HMM_INFO *hmminfo) |
Search for right context HMM in logical HMM. | |
HMM_Logical * | get_left_context_HMM (HMM_Logical *base, char *lc_name, HTK_HMM_INFO *hmminfo) |
Search for left context HMM in logical HMM. | |
void | add_right_context (char name[], char *rc) |
Generate context-dependent phone name from base phone name and its right context phone name. | |
void | add_left_context (char name[], char *lc) |
Generate context-dependent phone name from base phone name and its left context phone name. | |
char * | center_name (char *hmmname, char *buf) |
char * | leftcenter_name (char *hmmname, char *buf) |
char * | rightcenter_name (char *hmmname, char *buf) |
boolean | regist_cdset (APATNODE **root, HTK_HMM_Data *d, char *cdname) |
boolean | make_cdset (HTK_HMM_INFO *hmminfo) |
void | put_all_cdinfo (HTK_HMM_INFO *hmminfo) |
CD_Set * | cdset_lookup (HTK_HMM_INFO *hmminfo, char *cdstr) |
CD_Set * | lcdset_lookup_by_hmmname (HTK_HMM_INFO *hmminfo, char *hmmname) |
CD_Set * | rcdset_lookup_by_hmmname (HTK_HMM_INFO *hmminfo, char *hmmname) |
int | hmm_logical_state_num (HMM_Logical *lg) |
HTK_HMM_Trans * | hmm_logical_trans (HMM_Logical *lg) |
boolean | check_param_coherence (HTK_HMM_INFO *hmm, HTK_Param *pinfo) |
boolean | check_param_basetype (HTK_HMM_INFO *hmm, HTK_Param *pinfo) |
HTK_Param * | new_param_check_and_adjust (HTK_HMM_INFO *hmm, HTK_Param *pinfo, boolean vflag) |
Top function to adjust parameter. | |
boolean | write_binhmm (FILE *fp, HTK_HMM_INFO *hmm) |
boolean | read_binhmm (FILE *fp, HTK_HMM_INFO *hmm) |
Definition in file htk_hmm.h.
|
Set up pause model.
Definition at line 133 of file init_phmm.c. Referenced by initialize_HMM(). |
|
Output error message, with current reading status.
Definition at line 60 of file rdhmmdef.c. Referenced by codebook_add(), def_regtree_macro(), dens_add(), dens_read(), get_dens_data(), get_opttype_str(), get_state_data(), get_trans_data(), get_var_data(), htk_hmmdata_add(), htk_hmmdata_read(), rdhmmdef(), read_global_opt(), state_add(), tmix_read(), trans_add(), trans_read(), var_add(), and var_read(). |
|
Read next token and ste it to rdhmmdef_token.
Definition at line 77 of file rdhmmdef.c. Referenced by dens_read(), get_dens_data(), get_state_data(), get_trans_data(), get_var_data(), htk_hmmdata_read(), rdhmmdef(), read_global_opt(), regtree_read(), state_read(), tmix_read(), trans_read(), and var_read(). |
|
Initialize the HMM definition data by setting default values.
Definition at line 129 of file rdhmmdef.c. Referenced by rdhmmdef(). |
|
Main top routine to read in HTK HMM definition file. A HTK HMM definition file will be read from fp. After reading, the parameter type is checked and calculate some statistics.
Definition at line 174 of file rdhmmdef.c. Referenced by init_hmminfo(). |
|
Set global options starting at the current token to HMM definition data.
Definition at line 133 of file rdhmmdef_options.c. Referenced by rdhmmdef(). |
|
Get covariance option name string from its type code.
Definition at line 168 of file rdhmmdef_options.c. Referenced by print_hmmdef_info(). |
|
Get duration option name string from its type code.
Definition at line 181 of file rdhmmdef_options.c. Referenced by print_hmmdef_info(). |
|
Add a new data to the global structure.
Definition at line 60 of file rdhmmdef_trans.c. Referenced by def_trans_macro(), get_trans_data(), and rd_trans(). |
|
Return a pointer to the data located at the current point. If the current point is a macro reference, the pointer to the already defined data will be searched and returned. Otherwise, the definition of the data will be read from the current point and pointer to the newly allocated data will be returned.
Definition at line 171 of file rdhmmdef_trans.c. Referenced by htk_hmmdata_read(). |
|
Read a new data and store it as a macro.
Definition at line 206 of file rdhmmdef_trans.c. Referenced by rdhmmdef(). |
|
Return a pointer to the data located at the current point. If the current point is a macro reference, the pointer to the already defined data will be searched and returned. Otherwise, the definition of the data will be read from the current point and pointer to the newly allocated data will be returned.
Definition at line 200 of file rdhmmdef_state.c. Referenced by htk_hmmdata_read(). |
|
Read a new data and store it as a macro.
Definition at line 237 of file rdhmmdef_state.c. Referenced by rdhmmdef(). |
|
Look up a data macro by the name.
Definition at line 92 of file rdhmmdef_state.c. Referenced by build_state2gs(), and get_state_data(). |
|
Add a new data to the global structure.
Definition at line 58 of file rdhmmdef_state.c. Referenced by def_state_macro(), get_state_data(), and rd_state(). |
|
Return a pointer to the data located at the current point. If the current point is a macro reference, the pointer to the already defined data will be searched and returned. Otherwise, the definition of the data will be read from the current point and pointer to the newly allocated data will be returned.
Definition at line 199 of file rdhmmdef_dens.c. Referenced by state_read(). |
|
Read a new data and store it as a macro.
Definition at line 233 of file rdhmmdef_dens.c. Referenced by rdhmmdef(). |
|
Look up a data macro by the name.
Definition at line 112 of file rdhmmdef_dens.c. Referenced by get_dens_data(), and tmix_create_codebook_index(). |
|
Add a new data to the global structure.
Definition at line 79 of file rdhmmdef_dens.c. Referenced by def_dens_macro(), get_dens_data(), and rd_dens(). |
|
Return a pointer to the data located at the current point. If the current point is a macro reference, the pointer to the already defined data will be searched and returned. Otherwise, the definition of the data will be read from the current point and pointer to the newly allocated data will be returned.
Definition at line 161 of file rdhmmdef_var.c. Referenced by dens_read(). |
|
Read a new data and store it as a macro.
Definition at line 196 of file rdhmmdef_var.c. Referenced by rdhmmdef(). |
|
Add a new data to the global structure.
Definition at line 58 of file rdhmmdef_var.c. Referenced by def_var_macro(), get_var_data(), and rd_var(). |
|
Read a new data and store it as a macro.
Definition at line 159 of file rdhmmdef_data.c. Referenced by rdhmmdef(). |
|
Allocate a new data and return it.
Definition at line 35 of file rdhmmdef_data.c. Referenced by htk_hmmdata_read(). |
|
Add a new data to the global structure.
Definition at line 57 of file rdhmmdef_data.c. |
|
Read a codebook name and weights, build the codebook structure on demand, and assigns them to the current state. The required codebook on the current token will be assigned to this state. If the corresponding codebook structure is not built yet, it will be constructed here on demand by gathering corresponding mixture density definitions. Then this state will store the pointer to the codebook, together with its own mixture weights in the following tokens.
Definition at line 136 of file rdhmmdef_tiedmix.c. Referenced by state_read(). |
|
Add a new data to the global structure.
Definition at line 58 of file rdhmmdef_tiedmix.c. Referenced by rd_tmix(), and tmix_read(). |
|
Skip a regression tree data or its macro reference.
Definition at line 71 of file rdhmmdef_regtree.c. Referenced by rdhmmdef(). |
|
Read a HMMList file and build initial logical triphone list.
Definition at line 68 of file rdhmmlist.c. Referenced by init_hmminfo(). |
|
Output transition matrix.
Definition at line 38 of file put_htkdata_info.c. Referenced by check_hmm_limit(), and put_htk_hmm(). |
|
Output variance vector (diagonal).
Definition at line 60 of file put_htkdata_info.c. Referenced by put_htk_dens(). |
|
Output a density information, mean and variance.
Definition at line 81 of file put_htkdata_info.c. Referenced by put_htk_state(). |
|
Output mixture component of a state.
Definition at line 104 of file put_htkdata_info.c. Referenced by put_hmm_outprob(), and put_htk_hmm(). |
|
Output HMM model, number of states and information for each state.
Definition at line 125 of file put_htkdata_info.c. |
|
Output logical HMM data and its mapping status.
Definition at line 144 of file put_htkdata_info.c. Referenced by print_hmminfo(). |
|
Output total statistic informations of the HMM definition data.
Definition at line 300 of file put_htkdata_info.c. Referenced by print_info(). |
|
Allocate memory for a new HMM definition data.
Definition at line 34 of file init_phmm.c. Referenced by initialize_GMM(), initialize_GSHMM(), and initialize_HMM(). |
|
Load HTK HMM definition file and HMMList file, and setup phone HMM information. First try ascii format, then try binary format.
Definition at line 53 of file init_phmm.c. Referenced by initialize_GMM(), initialize_GSHMM(), and initialize_HMM(). |
|
Look up physical (defined in HTK HMM definition file) HMM by its name.
Definition at line 62 of file hmm_lookup.c. Referenced by rdhmmlist(). |
|
Look up logical HMM by its name.
Definition at line 82 of file hmm_lookup.c. Referenced by get_left_context_HMM(), get_right_context_HMM(), htk_hmm_set_pause_model(), new_str2phseq(), print_hmminfo(), triphone_callback_normal(), triphone_callback_right(), voca_load_htkdict_line(), and voca_mono2tri(). |
|
Add all physical HMM to logical HMM. This function should be called only if HMMList is not specified. Julius assumes all the triphones should be explicitly mapped using HMMList file.
Definition at line 119 of file hmm_lookup.c. Referenced by init_hmminfo(). |
|
Update logical HMM list by adding all the possible pseudo monophone and biphone to the list.
Definition at line 209 of file hmm_lookup.c. Referenced by make_cdset(). |
|
Build a list of base phones by gathering center phones of the defined HMM.
Definition at line 47 of file chkhmmlist.c. Referenced by init_hmminfo(). |
|
Check if the transition matrix conforms the ristrictions of Julius.
Definition at line 209 of file check_hmm_restriction.c. Referenced by check_all_hmm_limit(). |
|
Check all the HMM definitions in a HTK HMM definition data.
Definition at line 242 of file check_hmm_restriction.c. Referenced by rdhmmdef(). |
|
Check if the required parameter type in this HMM can be handled by Julius.
Definition at line 37 of file check_hmmtype.c. Referenced by rdhmmdef(). |
|
Guess whether the given HMM definition contains context-dependent modeling, just by the naming rule.
Definition at line 41 of file guess_cdHMM.c. Referenced by init_hmminfo(). |
|
Search for right context HMM in logical HMM. The name of a new right context HMM, given base phone HMM and a right context phone string, will be generated, and search it in the list of logical HMM. If found, return the pointer to the logical HMM.
Definition at line 106 of file cdhmm.c. Referenced by make_phseq(), next_word(), and scan_word(). |
|
Search for left context HMM in logical HMM. The name of a new left context HMM, given base phone HMM and a left context phone string, will be generated, and search it in the list of logical HMM. If found, return the pointer to the logical HMM.
Definition at line 128 of file cdhmm.c. Referenced by make_phseq(), outprob_style(), and scan_word(). |
|
Generate context-dependent phone name from base phone name and its right context phone name. The center phone name of the right context name will be appended to the base phone name. If the phone name already has right context, it will be renamed to the new one.
Definition at line 45 of file cdhmm.c. Referenced by error_missing_right_triphone(), get_right_context_HMM(), triphone_callback_normal(), and triphone_callback_right(). |
|
Generate context-dependent phone name from base phone name and its left context phone name. The center phone name of the left context name will be appended to the base phone name. If the phone name already has left context, it will be renamed to the new one.
Definition at line 72 of file cdhmm.c. Referenced by error_missing_left_triphone(), get_left_context_HMM(), outprob_style(), triphone_callback_left(), and triphone_callback_normal(). |
|
Extract the center phone name and copy to the specified buffer.
Definition at line 144 of file cdhmm.c. Referenced by add_left_context(), add_right_context(), build_state2gs(), hmm_add_pseudo_phones(), make_cdset(), make_hmm_basephone_list(), mark_word_edge(), msock_word_out1(), msock_word_out2(), new_str2phseq(), put_hypo_phoneme(), and ttyout_pass1_final(). |
|
Return "left - center" phone name, modifying buf.
Definition at line 175 of file cdhmm.c. Referenced by hmm_add_pseudo_phones(), lcdset_lookup_by_hmmname(), make_cdset(), and new_str2phseq(). |
|
Return "center + right" phone name, modifying buf.
Definition at line 197 of file cdhmm.c. Referenced by hmm_add_pseudo_phones(), make_cdset(), new_str2phseq(), and rcdset_lookup_by_hmmname(). |
|
Register a physical HMM as a member of a pseudo phone set.
Definition at line 206 of file cdset.c. Referenced by make_cdset(). |
|
Construct the whole pseudo HMM information, and also add them to the logical Triphone tree.
Definition at line 351 of file cdset.c. Referenced by initialize_HMM(). |
|
Output all pseudo phone set information to stdout
|
|
Look up for a pseudo phone with the name, and return the content.
Definition at line 112 of file cdset.c. Referenced by hmm_add_pseudo_phones_sub(), lcdset_lookup_by_hmmname(), and rcdset_lookup_by_hmmname(). |
|
Look up for a pseudo phone by the "left - center" name of the given phone name.
Definition at line 132 of file cdset.c. Referenced by outprob_style(), and wchmm_add_word(). |
|
Look up for a pseudo phone by the "center + right" name of the given phone name.
|
|
Generic function to get the number of states in a logical HMM.
Definition at line 245 of file hmm_lookup.c. Referenced by do_align(), new_make_word_hmm_with_lm(), next_word(), print_voca_info(), scan_word(), totalstatelen(), wchmm_add_word(), wchmm_duplicate_leafnode(), wchmm_duplicate_state(), and wchmm_link_subword(). |
|
Generic function to get transition matrix of a logical HMM.
Definition at line 261 of file hmm_lookup.c. Referenced by new_make_word_hmm_with_lm(), next_word(), wchmm_add_word(), wchmm_calc_wordend_arc(), wchmm_duplicate_leafnode(), and wchmm_link_subword(). |
|
Check if an input parameter type exactly matches that of HMM.
Definition at line 66 of file check_hmmtype.c. Referenced by new_param_check_and_adjust(), and RealTimePipeLinePrepare(). |
|
Check if the base type of input parameter matches that of HMM.
Definition at line 104 of file check_hmmtype.c. Referenced by new_param_check_and_adjust(). |
|
Top function to adjust parameter. It compares the types for the given parameter param and HMM definition hmminfo. If type is not the same, adjustment will be tried. If adjustment is performed, the input param will be freed and the newly allocated adjusted parameter will be returned. Otherwise, the original param will be returned.
Definition at line 429 of file paramselect.c. Referenced by main_recognition_loop(). |
|
Top function to write HMM definition data to a binary file.
Definition at line 665 of file write_binhmm.c. |
|
Top function to read a binary HMM file from fp.
Definition at line 454 of file read_binhmm.c. Referenced by init_hmminfo(). |