Main Page | Modules | Data Structures | Directories | File List | Data Fields | Globals | Related Pages

search.h

Go to the documentation of this file.
00001 
00034 /*
00035  * Copyright (c) 1991-2006 Kawahara Lab., Kyoto University
00036  * Copyright (c) 2000-2005 Shikano Lab., Nara Institute of Science and Technology
00037  * Copyright (c) 2005-2006 Julius project team, Nagoya Institute of Technology, Nagoya Institute of Technology
00038  * All rights reserved
00039  */
00040 
00041 #ifndef __SENT_SEARCH_H__
00042 #define __SENT_SEARCH_H__
00043 
00054 typedef struct __nextword__ {
00055   WORD_ID id;                   
00056 #ifdef USE_NGRAM
00057   LOGPROB lscore;               
00058 #else  /* USE_DFA */
00059   int next_state;               
00060   boolean can_insert_sp;        
00061 #endif
00062   TRELLIS_ATOM *tre;            
00063 } NEXTWORD;
00064 
00065 #ifdef VISUALIZE
00066 
00074 typedef struct __popnode__ {
00075   TRELLIS_ATOM *tre;            
00076   LOGPROB score;                
00077   struct __popnode__ *last;     
00078   struct __popnode__ *next;     
00079 } POPNODE;
00080 #endif /* VISUALIZE */
00081 
00082 #ifdef GRAPHOUT
00083 #define FANOUTSTEP 7            
00084 
00085 
00093 typedef struct __word_graph__ {
00094   WORD_ID wid;                  
00095   int lefttime;                 
00096   int righttime;                
00097   LOGPROB fscore_head;          
00098   LOGPROB fscore_tail;          
00099   LOGPROB gscore_head;          
00100   LOGPROB gscore_tail;          
00101 #ifdef USE_NGRAM
00102   LOGPROB lscore;               
00103 #endif
00104 #ifdef CM_SEARCH
00105   LOGPROB cmscore;              
00106 #endif
00107   struct __word_graph__ **leftword; 
00108   int leftwordnum;              
00109   int leftwordmaxnum;           
00110   struct __word_graph__ **rightword; 
00111   int rightwordnum;             
00112   int rightwordmaxnum;          
00113   struct __word_graph__ *next;  
00114   boolean mark;                 
00115   int id;                       
00116   boolean saved;                
00117 #ifdef GRAPHOUT_DYNAMIC
00118   boolean purged;               
00119 #endif
00120 } WordGraph;
00121 #endif /* GRAPHOUT */
00122 
00131 typedef struct __node__ {
00132   struct __node__    *next;     
00133   struct __node__    *prev;     
00134   boolean endflag;              
00135   WORD_ID seq[MAXSEQNUM];       
00136   short seqnum;                 
00137   LOGPROB score;                
00138   short bestt;                  
00139   short estimated_next_t;       
00140   LOGPROB *g;                   
00141 #ifdef MULTIPATH_VERSION
00142   LOGPROB final_g;              
00143 #endif
00144 #ifdef USE_DFA
00145   int state;                    
00146 #endif
00147   TRELLIS_ATOM *tre;            
00148   
00149 #ifndef PASS2_STRICT_IWCD
00150   /* for inter-word context dependency, the last phone on previous word
00151      need to be calculated later */
00152   LOGPROB *g_prev;              
00153 #endif
00154   HMM_Logical *last_ph;         
00155 #ifdef MULTIPATH_VERSION
00156   boolean last_ph_sp_attached;  
00157 #endif
00158 #ifdef USE_NGRAM
00159   LOGPROB lscore;               
00160   LOGPROB totallscore;          
00161 #endif /* USE_NGRAM */
00162 #ifdef CONFIDENCE_MEASURE
00163 #ifdef CM_MULTIPLE_ALPHA
00164   LOGPROB cmscore[MAXSEQNUM][100]; 
00165 #else
00166   LOGPROB cmscore[MAXSEQNUM];   
00167 #endif /* CM_MULTIPLE_ALPHA */
00168 #endif /* CONFIDENCE_MEASURE */
00169 #ifdef VISUALIZE
00170   POPNODE *popnode;             
00171 #endif
00172 #ifdef GRAPHOUT
00173 #ifdef GRAPHOUT_PRECISE_BOUNDARY
00174   short *wordend_frame;         
00175   LOGPROB *wordend_gscore;      
00176 #endif
00177   WordGraph *prevgraph;         
00178   WordGraph *lastcontext;       
00179 #ifndef GRAPHOUT_PRECISE_BOUNDARY
00180   LOGPROB tail_g_score;         
00181 #endif
00182 #endif /* GRAPHOUT */
00183 } NODE;
00184 
00185 /*
00186   HOW SCORES ARE CALCULATED:
00187   
00188               0         bestt                            T-1
00189               |-h(n)---->|<------------g(n)--------------|
00190 ==============================================================
00191               |\                                         |
00192               .....                                  .....  
00193                                                             <word trellis>
00194               |    \estimated_next_t                     |  =backward trellis
00195 --------------------\------------------------------------|  (1st pass)
00196               |      \                                   |   
00197 seq[seqnum-1] |       \_                                 |   
00198               |         \bestt                           |   
00199 =========================+====================================================
00200               |           \                              |<-g[0..T-1]
00201               |            \                             |   
00202 seq[seqnum-2] |             \__                          |
00203               |                \                         |
00204 --------------------------------\------------------------|
00205      (last_ph)|                  \__                     |
00206               |_ _ _ _ _ _ _ _ _ _ _\ _ _ _ _ _ _ _ _ _ _|
00207 seq[seqnum-3] |                      \______             |<--g_prev[0..T-1]
00208               |                             \___         |  
00209               |                                 \        |  
00210 -------------------------------------------------\-------|  <forward trellis>
00211               ......                                ......  (2nd pass)
00212 
00213               |                                        \_|
00214 ===============================================================       
00215 */
00216 
00217 #endif /* __SENT_SEARCH_H__ */

Generated on Tue Mar 28 16:01:38 2006 for Julius by  doxygen 1.4.2