00001
00027
00028
00029
00030
00031
00032
00033
00034 #ifndef __SENT_HMM_NEW2_H__
00035 #define __SENT_HMM_NEW2_H__
00036
00037 #include <sent/stddefs.h>
00038 #include <sent/htk_hmm.h>
00039 #include <sent/htk_param.h>
00040 #include <sent/hmm_calc.h>
00041
00043 typedef struct _a_cell {
00044 LOGPROB a;
00045 int arc;
00046 struct _a_cell *next;
00047 } A_CELL;
00048
00050 typedef struct {
00051 A_CELL *ac;
00052
00069 union {
00070 HTK_HMM_State *state;
00071 CD_State_Set *cdset;
00072 } out;
00073 boolean is_pseudo_state;
00074 } HMM_STATE;
00075
00082 typedef struct {
00083 int len;
00084 HMM_STATE *state;
00085 LOGPROB accept_ac_a;
00086 } HMM;
00087
00088
00093 typedef struct _seg_token {
00094 int last_id;
00095 int last_end_frame;
00096 LOGPROB last_end_score;
00097 struct _seg_token *next;
00098 struct _seg_token *list;
00099 } SEGTOKEN;
00100
00101
00102 HMM *new_make_word_hmm(HTK_HMM_INFO *, HMM_Logical **, int, boolean *);
00103 HMM *new_make_word_hmm_with_lm(HTK_HMM_INFO *, HMM_Logical **, int, boolean *, LOGPROB *);
00104 void free_hmm(HMM *);
00105
00106 LOGPROB viterbi_segment(HMM *hmm, HTK_Param *param, HMMWork *wrk, boolean multipath, int *endstates, int ulen, int **id_ret, int **seg_ret, LOGPROB **uscore_ret, int *retlen);
00107
00108
00109 LOGPROB outprob(HMMWork *wrk, int t, HMM_STATE *hmmstate, HTK_Param *param);
00110
00111 void put_hmm_arc(FILE *fp, HMM *d);
00112 void put_hmm_outprob(FILE *fp, HMM *d);
00113 void put_hmm(FILE *fp, HMM *d);
00114
00115 #endif