libjulius/include/julius/extern.h

Go to the documentation of this file.
00001 
00018 /*
00019  * Copyright (c) 1991-2007 Kawahara Lab., Kyoto University
00020  * Copyright (c) 2000-2005 Shikano Lab., Nara Institute of Science and Technology
00021  * Copyright (c) 2005-2007 Julius project team, Nagoya Institute of Technology
00022  * All rights reserved
00023  */
00024 
00025 /* should be included after all include files */
00026 
00027 /* backtrellis.c */
00028 void bt_init(BACKTRELLIS *bt);
00029 void bt_prepare(BACKTRELLIS *bt);
00030 void bt_free(BACKTRELLIS *bt);
00031 TRELLIS_ATOM *bt_new(BACKTRELLIS *bt);
00032 void bt_store(BACKTRELLIS *bt, TRELLIS_ATOM *aotm);
00033 void bt_relocate_rw(BACKTRELLIS *bt);
00034 void set_terminal_words(RecogProcess *r);
00035 void bt_discount_pescore(WCHMM_INFO *wchmm, BACKTRELLIS *bt, HTK_Param *param);
00036 void bt_discount_lm(BACKTRELLIS *bt);
00037 void bt_sort_rw(BACKTRELLIS *bt);
00038 TRELLIS_ATOM *bt_binsearch_atom(BACKTRELLIS *bt, int time, WORD_ID wkey);
00039 
00040 /* factoring_sub.c */
00041 void make_iwcache_index(WCHMM_INFO *wchmm);
00042 void adjust_sc_index(WCHMM_INFO *wchmm);
00043 void make_successor_list(WCHMM_INFO *wchmm);
00044 void max_successor_cache_init(WCHMM_INFO *wchmm);
00045 void max_successor_cache_free(WCHMM_INFO *wchmm);
00046 LOGPROB max_successor_prob(WCHMM_INFO *wchmm, WORD_ID lastword, int node);
00047 LOGPROB *max_successor_prob_iw(WCHMM_INFO *wchmm, WORD_ID lastword);
00048 void  calc_all_unigram_factoring_values(WCHMM_INFO *wchmm);
00049 boolean can_succeed(WCHMM_INFO *wchmm, WORD_ID lastword, int node);
00050 
00051 /* beam.c */
00052 boolean get_back_trellis_init(HTK_Param *param, RecogProcess *r);
00053 boolean get_back_trellis_proceed(int t, HTK_Param *param, RecogProcess *r, boolean final_for_multipath);
00054 void get_back_trellis_end(HTK_Param *param, RecogProcess *r);
00055 void fsbeam_free(FSBeam *d);
00056 void finalize_1st_pass(RecogProcess *r, int len);
00057 
00058 /* pass1.c */
00059 #ifdef POWER_REJECT
00060 boolean power_reject(Recog *recog);
00061 #endif
00062 int decode_proceed(Recog *recog);
00063 void decode_end_segmented(Recog *recog);
00064 void decode_end(Recog *recog);
00065 boolean get_back_trellis(Recog *recog);
00066 
00067 /* spsegment.c */
00068 boolean is_sil(WORD_ID w, RecogProcess *r);
00069 void mfcc_copy_to_rest_and_shrink(MFCCCalc *mfcc, int start, int end);
00070 void mfcc_shrink(MFCCCalc *mfcc, int p);
00071 boolean detect_end_of_segment(RecogProcess *r, int time);
00072 void finalize_segment(Recog *recog);
00073 void spsegment_init(Recog *recog);
00074 boolean spsegment_trigger_sync(Recog *recog);
00075 boolean spsegment_need_restart(Recog *recog, int *rf_ret, boolean *repro_ret);
00076 void spsegment_restart_mfccs(Recog *recog, int rewind_frame, boolean reprocess);
00077 
00078 
00079 /* outprob_style.c */
00080 #ifdef PASS1_IWCD
00081 void outprob_style_cache_init(WCHMM_INFO *wchmm);
00082 CD_Set *lcdset_lookup_with_category(WCHMM_INFO *wchmm, HMM_Logical *hmm, WORD_ID category);
00083 void lcdset_register_with_category_all(WCHMM_INFO *wchmm);
00084 void lcdset_remove_with_category_all(WCHMM_INFO *wchmm);
00085 #endif
00086 LOGPROB outprob_style(WCHMM_INFO *wchmm, int node, int last_wid, int t, HTK_Param *param);
00087 void error_missing_right_triphone(HMM_Logical *base, char *rc_name);
00088 void error_missing_left_triphone(HMM_Logical *base, char *lc_name);
00089 
00090 /* ngram_decode.c */
00091 #include "search.h"
00092 int ngram_firstwords(NEXTWORD **nw, int peseqlen, int maxnw, RecogProcess *r);
00093 int ngram_nextwords(NODE *hypo, NEXTWORD **nw, int maxnw, RecogProcess *r);
00094 boolean ngram_acceptable(NODE *hypo, RecogProcess *r);
00095 int dfa_firstwords(NEXTWORD **nw, int peseqlen, int maxnw, RecogProcess *r);
00096 int dfa_nextwords(NODE *hypo, NEXTWORD **nw, int maxnw, RecogProcess *r);
00097 boolean dfa_acceptable(NODE *hypo, RecogProcess *r);
00098 boolean dfa_look_around(NEXTWORD *nword, NODE *hypo, RecogProcess *r);
00099 
00100 /* search_bestfirst_main.c */
00101 void segment_set_last_nword(NODE *hypo, RecogProcess *r);
00102 void wchmm_fbs(HTK_Param *param, RecogProcess *r, int cate_bgn, int cate_num);
00103 
00104 /* search_bestfirst_v?.c */
00105 void clear_stocker(StackDecode *s);
00106 void free_node(NODE *node);
00107 NODE *cpy_node(NODE *dst, NODE *src);
00108 NODE *newnode(RecogProcess *r);
00109 void malloc_wordtrellis(RecogProcess *r);
00110 void free_wordtrellis();
00111 void scan_word(NODE *now, HTK_Param *param, RecogProcess *r);
00112 void next_word(NODE *now, NODE *new, NEXTWORD *nword, HTK_Param *param, RecogProcess *r);
00113 void start_word(NODE *new, NEXTWORD *nword, HTK_Param *param, RecogProcess *r);
00114 void last_next_word(NODE *now, NODE *new, HTK_Param *param, RecogProcess *r);
00115 
00116 /* wav2mfcc.c */
00117 boolean wav2mfcc(SP16 speech[], int speechlen, Recog *recog);
00118 
00119 /* version.c */
00120 void j_put_header(FILE *stream);
00121 void j_put_version(FILE *stream);
00122 void j_put_compile_defs(FILE *stream);
00123 void j_put_library_defs(FILE *stream);
00124 
00125 /* wchmm.c */
00126 WCHMM_INFO *wchmm_new();
00127 void wchmm_free(WCHMM_INFO *w);
00128 void print_wchmm_info(WCHMM_INFO *wchmm);
00129 boolean build_wchmm(WCHMM_INFO *wchmm, JCONF_LM *lmconf);
00130 boolean build_wchmm2(WCHMM_INFO *wchmm, JCONF_LM *lmconf);
00131 
00132 /* wchmm_check.c */
00133 void wchmm_check_interactive(WCHMM_INFO *wchmm);
00134 void check_wchmm(WCHMM_INFO *wchmm);
00135 
00136 /* realtime.c --- callback for adin_cut() */
00137 boolean RealTimeInit(Recog *recog);
00138 boolean RealTimePipeLinePrepare(Recog *recog);
00139 boolean RealTimeMFCC(MFCCCalc *mfcc, SP16 *window, int windowlen);
00140 int RealTimePipeLine(SP16 *Speech, int len, Recog *recog);
00141 int RealTimeResume(Recog *recog);
00142 boolean RealTimeParam(Recog *recog);
00143 void RealTimeCMNUpdate(MFCCCalc *mfcc, Recog *recog);
00144 void RealTimeTerminate(Recog *recog);
00145 void realbeam_free(Recog *recog);
00146 
00147 /* word_align.c */
00148 void word_align(WORD_ID *words, short wnum, HTK_Param *param, Sentence *s, RecogProcess *r);
00149 void phoneme_align(WORD_ID *words, short wnum, HTK_Param *param, Sentence *s, RecogProcess *r);
00150 void state_align(WORD_ID *words, short wnum, HTK_Param *param, Sentence *s, RecogProcess *r);
00151 void word_rev_align(WORD_ID *revwords, short wnum, HTK_Param *param, Sentence *s, RecogProcess *r);
00152 void phoneme_rev_align(WORD_ID *revwords, short wnum, HTK_Param *param, Sentence *s, RecogProcess *r);
00153 void state_rev_align(WORD_ID *revwords, short wnum, HTK_Param *param, Sentence *s, RecogProcess *r);
00154 
00155 /* m_usage.c */
00156 void opt_terminate();
00157 void j_output_argument_help(FILE *fp);
00158 /* m_options.c */
00159 char *filepath(char *filename, char *dirname);
00160 boolean opt_parse(int argc, char *argv[], char *cwd, Jconf *jconf);
00161 void opt_release(Jconf *jconf);
00162 /* m_jconf.c */
00163 void get_dirname(char *path);
00164 boolean config_file_parse(char *conffile, Jconf *jconf);
00165 /* m_chkparam.c */
00166 boolean checkpath(char *filename);
00167 boolean j_jconf_finalize(Jconf *jconf);
00168 int set_beam_width(WCHMM_INFO *wchmm, int specified);
00169 /* m_info.c */
00170 void print_jconf_overview(Jconf *jconf);
00171 void print_engine_info(Recog *recog);
00172 /* m_bootup.c */
00173 void system_bootup(Recog *recog);
00174 /* m_adin.c */
00175 boolean adin_initialize(Recog *recog);
00176 boolean adin_initialize_user(Recog *recog, void *arg);
00177 /* m_fusion.c */
00178 boolean j_load_am(Recog *recog, JCONF_AM *amconf);
00179 boolean j_load_lm(Recog *recog, JCONF_LM *lmconf);
00180 boolean j_load_all(Recog *recog, Jconf *jconf);
00181 boolean j_launch_recognition_instance(Recog *recog, JCONF_SEARCH *sconf);
00182 boolean j_final_fusion(Recog *recog);
00183 void create_mfcc_calc_instances(Recog *recog);
00184 
00185 /* hmm_check.c */
00186 void hmm_check(RecogProcess *r);
00187 
00188 /* visual.c */
00189 void visual_init(Recog *recog);
00190 void visual_show(BACKTRELLIS *bt);
00191 void visual2_init(int maxhypo);
00192 void visual2_popped(NODE *n, int popctr);
00193 void visual2_next_word(NODE *next, NODE *prev, int popctr);
00194 void visual2_best(NODE *now, WORD_INFO *winfo);
00195 
00196 /* gmm.c */
00197 boolean gmm_init(Recog *recog);
00198 void gmm_prepare(Recog *recog);
00199 void gmm_proceed(Recog *recog);
00200 void gmm_end(Recog *recog);
00201 boolean gmm_valid_input(Recog *recog);
00202 void gmm_free(Recog *recog);
00203 #ifdef GMM_VAD
00204 void gmm_check_trigger(Recog *recog);
00205 #endif
00206 
00207 /* graphout.c */
00208 void wordgraph_init(WCHMM_INFO *wchmm);
00209 void wordgraph_free(WordGraph *wg);
00210 void put_wordgraph(FILE *fp, WordGraph *wg, WORD_INFO *winfo);
00211 void wordgraph_dump(FILE *fp, WordGraph *root, WORD_INFO *winfo);
00212 WordGraph *wordgraph_assign(WORD_ID wid, WORD_ID wid_left, WORD_ID wid_right, int leftframe, int rightframe, LOGPROB fscore_head, LOGPROB fscore_tail, LOGPROB gscore_head, LOGPROB gscore_tail, LOGPROB lscore, LOGPROB cmscore, RecogProcess *r);
00213 boolean wordgraph_check_and_add_rightword(WordGraph *wg, WordGraph *right, LOGPROB lscore);
00214 boolean wordgraph_check_and_add_leftword(WordGraph *wg, WordGraph *left, LOGPROB lscore);
00215 void wordgraph_save(WordGraph *wg, WordGraph *right, WordGraph **root);
00216 WordGraph *wordgraph_check_merge(WordGraph *now, WordGraph **root, WORD_ID next_wid, boolean *merged_p, JCONF_SEARCH *jconf);
00217 WordGraph *wordgraph_dup(WordGraph *wg, WordGraph **root);
00218 void wordgraph_purge_leaf_nodes(WordGraph **rootp, RecogProcess *r);
00219 void wordgraph_depth_cut(WordGraph **rootp, RecogProcess *r);
00220 void wordgraph_adjust_boundary(WordGraph **rootp, RecogProcess *r);
00221 void wordgraph_clean(WordGraph **rootp);
00222 void wordgraph_compaction_thesame(WordGraph **rootp);
00223 void wordgraph_compaction_exacttime(WordGraph **rootp, RecogProcess *r);
00224 void wordgraph_compaction_neighbor(WordGraph **rootp, RecogProcess *r);
00225 int wordgraph_sort_and_annotate_id(WordGraph **rootp, RecogProcess *r);
00226 void wordgraph_check_coherence(WordGraph *rootp, RecogProcess *r);
00227 void graph_forward_backward(WordGraph *root, RecogProcess *r);
00228 
00229 /* default.c */
00230 void jconf_set_default_values(Jconf *j);
00231 void jconf_set_default_values_am(JCONF_AM *j);
00232 void jconf_set_default_values_lm(JCONF_LM *j);
00233 void jconf_set_default_values_search(JCONF_SEARCH *j);
00234 
00235 
00236 /* multi-gram.c */
00237 void multigram_add(DFA_INFO *dfa, WORD_INFO *winfo, char *name, PROCESS_LM *lm);
00238 boolean multigram_delete(int gid, PROCESS_LM *lm);
00239 void multigram_delete_all(PROCESS_LM *lm);
00240 boolean multigram_update(PROCESS_LM *lm);
00241 boolean multigram_build(RecogProcess *r);
00242 int multigram_activate(int gid, PROCESS_LM *lm);
00243 int multigram_deactivate(int gid, PROCESS_LM *lm);
00244 boolean multigram_load_all_gramlist(PROCESS_LM *lm);
00245 int multigram_get_gram_from_category(int category, PROCESS_LM *lm);
00246 int multigram_get_all_num(PROCESS_LM *lm);
00247 void multigram_free_all(MULTIGRAM *root);
00248 
00249 MULTIGRAM *multigram_get_grammar_by_name(PROCESS_LM *lm, char *gramname);
00250 MULTIGRAM *multigram_get_grammar_by_id(PROCESS_LM *lm, unsigned short id);
00251 boolean multigram_add_words_to_grammar(PROCESS_LM *lm, MULTIGRAM *m, WORD_INFO *winfo);
00252 boolean multigram_add_words_to_grammar_by_name(PROCESS_LM *lm, char *gramname, WORD_INFO *winfo);
00253 boolean multigram_add_words_to_grammar_by_id(PROCESS_LM *lm, unsigned short id, WORD_INFO *winfo);
00254 
00255 
00256 /* gramlist.c */
00257 void multigram_add_gramlist(char *dfafile, char *dictfile, JCONF_LM *j, int lmvar);
00258 void multigram_remove_gramlist(JCONF_LM *j);
00259 boolean multigram_add_prefix_list(char *prefix_list, char *cwd, JCONF_LM *j, int lmvar);
00260 boolean multigram_add_prefix_filelist(char *listfile, JCONF_LM *j, int lmvar);
00261 
00262 
00263 /* adin-cut.c */
00264 void adin_setup_param(ADIn *adin, Jconf *jconf);
00265 boolean adin_thread_create(Recog *recog);
00266 int adin_go(int (*ad_process)(SP16 *, int, Recog *), int (*ad_check)(Recog *), Recog *recog);
00267 boolean adin_standby(ADIn *a, int freq, void *arg);
00268 boolean adin_begin(ADIn *a);
00269 boolean adin_end(ADIn *a);
00270 void adin_free_param(Recog *recog);
00271 
00272 /* confnet.c */
00273 CN_CLUSTER *confnet_create(WordGraph *root, RecogProcess *r);
00274 void graph_make_order(WordGraph *root, RecogProcess *r);
00275 void graph_free_order();
00276 void cn_free_all(CN_CLUSTER **croot);
00277 
00278 /* callback.c */
00279 void callback_init(Recog *recog);
00280 int callback_add(Recog *recog, int code, void (*func)(Recog *recog, void *data), void *data);
00281 int callback_add_adin(Recog *recog, int code, void (*func)(Recog *recog, SP16 *buf, int len, void *data), void *data);
00282 void callback_exec(int code, Recog *recog);
00283 void callback_exec_adin(int code, Recog *recog, SP16 *buf, int len);
00284 boolean callback_exist(Recog *recog, int code);
00285 boolean callback_delete(Recog *recog, int id);
00286 
00287 /* recogmain.c */
00288 void result_sentence_malloc(RecogProcess *r, int num);
00289 void result_sentence_free(RecogProcess *r);
00290 void clear_result(RecogProcess *r);

Generated on Tue Dec 18 15:59:50 2007 for Julius by  doxygen 1.5.4