00001 00023 /* 00024 * Copyright (c) 1991-2007 Kawahara Lab., Kyoto University 00025 * Copyright (c) 2000-2005 Shikano Lab., Nara Institute of Science and Technology 00026 * Copyright (c) 2005-2007 Julius project team, Nagoya Institute of Technology 00027 * All rights reserved 00028 */ 00029 00030 #include <julius/julius.h> 00031 00056 void 00057 jconf_set_default_values(Jconf *j) 00058 { 00059 j->input.speech_input = SP_MFCFILE; 00060 j->input.sfreq = 16000; 00061 j->input.period = 625; 00062 j->input.framesize = DEF_FRAMESIZE; 00063 j->input.frameshift = DEF_FRAMESHIFT; 00064 j->input.use_ds48to16 = FALSE; 00065 j->input.inputlist_filename = NULL; 00066 j->input.adinnet_port = ADINNET_PORT; 00067 #ifdef USE_NETAUDIO 00068 j->input.netaudio_devname = NULL; 00069 #endif 00070 j->input.paramtype_check_flag = TRUE; 00071 00072 j->detect.level_thres = 2000; 00073 j->detect.head_margin_msec = 300; 00074 j->detect.tail_margin_msec = 400; 00075 j->detect.zero_cross_num = 60; 00076 j->detect.silence_cut = 2; /* accept device default */ 00077 #ifdef GMM_VAD 00078 j->detect.gmm_margin = DEFAULT_GMM_MARGIN; 00079 #endif 00080 00081 j->preprocess.strip_zero_sample = TRUE; 00082 j->preprocess.use_zmean = FALSE; 00083 00084 j->reject.gmm_filename = NULL; 00085 j->reject.gmm_gprune_num = 10; 00086 j->reject.gmm_reject_cmn_string = NULL; 00087 j->reject.rejectshortlen = 0; 00088 #ifdef POWER_REJECT 00089 j->reject.powerthres = POWER_REJECT_DEFAULT_THRES; 00090 #endif 00091 00092 j->decodeopt.forced_realtime = FALSE; 00093 j->decodeopt.force_realtime_flag = FALSE; 00094 j->decodeopt.segment = FALSE; 00095 } 00096 00113 void 00114 jconf_set_default_values_am(JCONF_AM *j) 00115 { 00116 j->name[0] = '\0'; 00117 00118 j->hmmfilename = NULL; 00119 j->mapfilename = NULL; 00120 j->gprune_method = GPRUNE_SEL_UNDEF; 00121 j->mixnum_thres = 2; 00122 j->spmodel_name = NULL; 00123 j->hmm_gs_filename = NULL; 00124 j->gs_statenum = 24; 00125 j->iwcdmethod = IWCD_UNDEF; 00126 j->iwcdmaxn = 3; 00127 j->iwsp_penalty = -1.0; 00128 j->force_multipath = FALSE; 00129 undef_para(&(j->analysis.para)); 00130 undef_para(&(j->analysis.para_hmm)); 00131 undef_para(&(j->analysis.para_default)); 00132 undef_para(&(j->analysis.para_htk)); 00133 make_default_para(&(j->analysis.para_default)); 00134 make_default_para_htk(&(j->analysis.para_htk)); 00135 j->analysis.cmnload_filename = NULL; 00136 j->analysis.cmn_update = TRUE; 00137 j->analysis.cmnsave_filename = NULL; 00138 j->analysis.cmn_map_weight = 100.0; 00139 j->frontend.ss_alpha = DEF_SSALPHA; 00140 j->frontend.ss_floor = DEF_SSFLOOR; 00141 j->frontend.sscalc = FALSE; 00142 j->frontend.sscalc_len = 300; 00143 j->frontend.ssload_filename = NULL; 00144 } 00145 00162 void 00163 jconf_set_default_values_lm(JCONF_LM *j) 00164 { 00165 j->name[0] = '\0'; 00166 00167 j->lmtype = LM_UNDEF; 00168 j->lmvar = LM_UNDEF; 00169 j->dictfilename = NULL; 00170 j->head_silname = NULL; 00171 j->tail_silname = NULL; 00172 j->forcedict_flag = FALSE; 00173 j->ngram_filename = NULL; 00174 j->ngram_filename_lr_arpa = NULL; 00175 j->ngram_filename_rl_arpa = NULL; 00176 j->dfa_filename = NULL; 00177 j->gramlist_root = NULL; 00178 j->wordlist_root = NULL; 00179 j->enable_iwsp = FALSE; 00180 j->enable_iwspword = FALSE; 00181 j->iwspentry = NULL; 00182 #ifdef SEPARATE_BY_UNIGRAM 00183 j->separate_wnum = 150; 00184 #endif 00185 strcpy(j->wordrecog_head_silence_model_name, "silB"); 00186 strcpy(j->wordrecog_tail_silence_model_name, "silE"); 00187 j->wordrecog_silence_context_name[0] = '\0'; 00188 } 00189 00206 void 00207 jconf_set_default_values_search(JCONF_SEARCH *j) 00208 { 00209 j->name[0] = '\0'; 00210 00211 j->amconf = NULL; 00212 j->lmconf = NULL; 00213 j->compute_only_1pass = FALSE; 00214 j->force_ccd_handling = FALSE; 00215 j->ccd_handling = FALSE; 00216 /* 00217 default values below are assigned later using HMM information: 00218 j->lmp.* 00219 */ 00220 j->lmp.lm_penalty_trans = 0.0; 00221 j->lmp.penalty1 = 0.0; 00222 j->lmp.penalty2 = 0.0; 00223 j->lmp.lmp2_specified = FALSE; 00224 j->lmp.lmp_specified = FALSE; 00225 00226 j->pass1.specified_trellis_beam_width = -1; 00227 #if defined(WPAIR) && defined(WPAIR_KEEP_NLIMIT) 00228 j->pass1.wpair_keep_nlimit = 3; 00229 #endif 00230 #ifdef HASH_CACHE_IW 00231 j->pass1.iw_cache_rate = 10; 00232 #endif 00233 j->pass1.old_tree_function_flag = FALSE; 00234 #ifdef DETERMINE 00235 j->pass1.determine_score_thres = 10.0; 00236 j->pass1.determine_duration_thres = 6; 00237 #endif 00238 if (strmatch(JULIUS_SETUP, "fast")) { 00239 j->pass2.nbest = 1; 00240 j->pass2.enveloped_bestfirst_width = 30; 00241 } else { 00242 j->pass2.nbest = 10; 00243 j->pass2.enveloped_bestfirst_width = 100; 00244 } 00245 #ifdef SCAN_BEAM 00246 j->pass2.scan_beam_thres = 80.0; 00247 #endif 00248 j->pass2.hypo_overflow = 2000; 00249 j->pass2.stack_size = 500; 00250 j->pass2.lookup_range = 5; 00251 j->pass2.looktrellis_flag = FALSE; /* dfa */ 00252 00253 j->graph.enabled = FALSE; 00254 j->graph.lattice = FALSE; 00255 j->graph.confnet = FALSE; 00256 j->graph.graph_merge_neighbor_range = 0; 00257 #ifdef GRAPHOUT_DEPTHCUT 00258 j->graph.graphout_cut_depth = 80; 00259 #endif 00260 #ifdef GRAPHOUT_LIMIT_BOUNDARY_LOOP 00261 j->graph.graphout_limit_boundary_loop_num = 20; 00262 #endif 00263 #ifdef GRAPHOUT_SEARCH_DELAY_TERMINATION 00264 j->graph.graphout_search_delay = FALSE; 00265 #endif 00266 j->successive.enabled = FALSE; 00267 j->successive.sp_frame_duration = 10; 00268 j->successive.pausemodelname = NULL; 00269 #ifdef SPSEGMENT_NAIST 00270 j->successive.sp_margin = DEFAULT_SP_MARGIN; 00271 j->successive.sp_delay = DEFAULT_SP_DELAY; 00272 #endif 00273 #ifdef CONFIDENCE_MEASURE 00274 j->annotate.cm_alpha = 0.05; 00275 #ifdef CM_MULTIPLE_ALPHA 00276 j->annotate.cm_alpha_bgn = 0.03; 00277 j->annotate.cm_alpha_end = 0.15; 00278 j->annotate.cm_alpha_num = 5; 00279 j->annotate.cm_alpha_step = 0.03; 00280 #endif 00281 #ifdef CM_SEARCH_LIMIT 00282 j->annotate.cm_cut_thres = 0.03; 00283 #endif 00284 #ifdef CM_SEARCH_LIMIT_POPO 00285 j->annotate.cm_cut_thres_pop = 0.1; 00286 #endif 00287 #endif /* CONFIDENCE_MEASURE */ 00288 j->annotate.align_result_word_flag = FALSE; 00289 j->annotate.align_result_phoneme_flag = FALSE; 00290 j->annotate.align_result_state_flag = FALSE; 00291 00292 j->output.output_hypo_maxnum = 1; 00293 j->output.progout_flag = FALSE; 00294 j->output.progout_interval = 300; 00295 j->output.multigramout_flag = FALSE; /* dfa */ 00296 00297 j->sw.trellis_check_flag = FALSE; 00298 j->sw.triphone_check_flag = FALSE; 00299 j->sw.wchmm_check_flag = FALSE; 00300 j->sw.start_inactive = FALSE; 00301 00302 } 00303 00304 /* end of file */