julius/wchmm.h

Go to the documentation of this file.
00001 
00033 /*
00034  * Copyright (c) 1991-2006 Kawahara Lab., Kyoto University
00035  * Copyright (c) 2000-2005 Shikano Lab., Nara Institute of Science and Technology
00036  * Copyright (c) 2005-2006 Julius project team, Nagoya Institute of Technology
00037  * All rights reserved
00038  */
00039 
00040 #ifndef __SENT_WORD_CONJ_HMM__
00041 #define __SENT_WORD_CONJ_HMM__
00042 
00043 #define         MAXWCNSTEP  40000 
00044 
00045 
00049 typedef struct s_cell {
00050   WORD_ID word;                 
00051   struct s_cell *next;          
00052 } S_CELL;
00053 
00054 
00055 #ifdef PASS1_IWCD
00056 
00057 /* Cross-word triphone handling */
00058 
00064 typedef struct {
00065   HMM_Logical  *hmm;            
00066   short         state_loc;      
00067   /* Context cache */
00068   boolean       last_is_lset;   
00069   union {
00070     HTK_HMM_State *state;       
00071     CD_State_Set  *lset;        
00072   } cache;
00073   WORD_ID       lastwid_cache;  
00074 } RC_INFO;
00075 
00081 typedef struct {
00082   HMM_Logical  *hmm;            
00083   short         state_loc;      
00084   /* Context cache */
00085   boolean       last_is_lset;   
00086 #ifdef CATEGORY_TREE
00087   WORD_ID       category;       
00088 #endif
00089   union {
00090     HTK_HMM_State *state;       
00091     CD_State_Set  *lset;        
00092   } cache;
00093   WORD_ID       lastwid_cache;  
00094 } LRC_INFO;
00095 
00096 /* For word tail phoneme, pseudo phone on the dictionary will be directly
00097    used as context-dependent state set */
00098 
00104 typedef union {
00105   HTK_HMM_State *state;         
00106   CD_State_Set  *lset;          
00107   RC_INFO       *rset;          
00108   LRC_INFO      *lrset;         
00109 } ACOUSTIC_SPEC;
00110 
00115 typedef enum {
00116   AS_STATE,                     
00117   AS_LSET,                      
00118   AS_RSET,                      
00119   AS_LRSET                      
00120 } AS_Style;
00121 #endif
00122   
00123 /*************************************************************************/
00124 
00129 typedef struct wchmm_state {
00130   A_CELL        *ac;            
00131 #ifdef PASS1_IWCD
00132   ACOUSTIC_SPEC out;            
00133   /* below has been moved to WCHMM (04/06/22 by ri) */
00134   /*unsigned char       outstyle;       output type (one of AS_Style) */
00135 #else  /* ~PASS1_IWCD */
00136   HTK_HMM_State *out;           
00137 #endif /* ~PASS1_IWCD */
00138 #ifndef CATEGORY_TREE
00139 
00145   int scid;
00146 #endif
00147 } WCHMM_STATE;
00148 
00153 typedef struct wchmm_info {
00154   HTK_HMM_INFO *hmminfo;        
00155 #ifdef USE_NGRAM
00156   NGRAM_INFO *ngram;            
00157 #endif
00158 #ifdef USE_DFA
00159   DFA_INFO *dfa;                
00160 #endif
00161   WORD_INFO *winfo;             
00162   int   maxwcn;                 
00163   int   n;                      
00164   WCHMM_STATE   *state;         
00165 #ifndef MULTIPATH_VERSION
00166   WORD_ID       *ststart;       
00167 #endif
00168   WORD_ID       *stend;         
00169   int   **offset;               
00170   int   *wordend;               
00171   int   startnum;               
00172   int   *startnode;             
00173 #ifdef MULTIPATH_VERSION
00174   int   *wordbegin;             
00175   int   maxstartnum;            
00176 # ifdef CATEGORY_TREE
00177   WORD_ID *start2wid;           
00178 # endif
00179 #endif /* MULTIPATH_VERSION */
00180 #ifdef UNIGRAM_FACTORING
00181   int   *start2isolate;         
00182   int   isolatenum;             
00183 #endif
00184 #ifndef MULTIPATH_VERSION
00185   LOGPROB       *wordend_a;     
00186 #endif
00187 #ifdef PASS1_IWCD
00188   unsigned char *outstyle;      
00189 #endif
00190 #ifndef CATEGORY_TREE
00191   /* Successor lists on the tree are stored on sequencial list at @a sclist,
00192      and each node has index to the list */
00193   S_CELL **sclist;              
00194   int *sclist2node;             
00195   int   scnum;                  
00196 #ifdef UNIGRAM_FACTORING
00197   LOGPROB *fscore;              
00198   int fsnum;                    
00199 #endif
00200 #endif
00201   BMALLOC_BASE *malloc_root;    
00202 #ifdef PASS1_IWCD
00203 #ifdef CATEGORY_TREE
00204   APATNODE *lcdset_category_root; 
00205 #endif /* CATEGORY_TREE */
00206 #endif /* PASS1_IWCD */
00207 } WCHMM_INFO;
00208 
00209 /*************************************************************************/
00210 /* word trellis index (result of 1st pass) */
00211 
00217 typedef struct __trellis_atom__ {
00218   LOGPROB backscore;            
00219 #ifdef USE_NGRAM
00220   LOGPROB lscore;               
00221 #endif
00222   WORD_ID wid;                  
00223   short begintime;              
00224   short endtime;                
00225 #ifdef WORD_GRAPH
00226   boolean within_wordgraph;     
00227   boolean within_context;       
00228 #endif
00229   struct __trellis_atom__ *last_tre; 
00230   struct __trellis_atom__ *next; 
00231 } TRELLIS_ATOM;
00232 
00237 typedef struct __backtrellis__ {
00238   int framelen;                 
00239   int *num;                     
00240   TRELLIS_ATOM ***rw;           
00241   TRELLIS_ATOM *list;           
00242   BMALLOC_BASE *root;           
00243 } BACKTRELLIS;
00244 
00245 #endif /* __SENT_WORD_CONJ_HMM__ */

Generated on Tue Dec 26 16:16:33 2006 for Julius by  doxygen 1.5.0