メインページ | モジュール | データ構造 | Directories | ファイル一覧 | データフィールド | グローバル | 関連ページ

m_options.c

説明を見る。
00001 
00017 /*
00018  * Copyright (c) 1991-2006 Kawahara Lab., Kyoto University
00019  * Copyright (c) 2000-2005 Shikano Lab., Nara Institute of Science and Technology
00020  * Copyright (c) 2005-2006 Julius project team, Nagoya Institute of Technology, Nagoya Institute of Technology
00021  * All rights reserved
00022  */
00023 
00024 #include <julius.h>
00025 
00050 char *
00051 filepath(char *filename, char *dirname)
00052 {
00053   char *p;
00054   if (dirname != NULL && filename[0] != '/'
00055 #if defined(_WIN32)
00056       && filename[0] != '\\' && !(strlen(filename) >= 3 && filename[1] == ':')
00057 #endif
00058       ) {
00059     p = (char *)mymalloc(strlen(filename) + strlen(dirname) + 1);
00060     strcpy(p, dirname);
00061     strcat(p, filename);
00062   } else {
00063     p = strcpy((char *)mymalloc(strlen(filename)+1), filename);
00064   }
00065   return p;
00066 }
00067 
00084 static char *
00085 args_needed_exit(char *opt)
00086 {
00087   j_printerr("%s: option requires argument -- %s\n", EXECNAME, opt);
00088   opt_terminate();
00089   return(NULL);
00090 }
00091 
00108 void
00109 opt_parse(int argc, char *argv[], char *cwd)
00110 {
00111   char *tmparg;
00112   int i;
00113 
00114 #define NEXTARG (++i >= argc) ? (char *)args_needed_exit(argv[i-1]) : argv[i] 
00115 
00116   if (argc == 1) {              /* no argument */
00117     usage();
00118   }
00119   
00120   for (i=1;i<argc;i++) {
00121     if (strmatch(argv[i],"-C")) { /* include jconf file  */
00122       config_file_parse(filepath(NEXTARG, cwd));
00123       continue;
00124     } else if (strmatch(argv[i],"-input")) { /* speech input */
00125       tmparg = NEXTARG;
00126       if (strmatch(tmparg,"rawfile")) {
00127         speech_input = SP_RAWFILE;
00128         realtime_flag = FALSE;
00129       } else if (strmatch(tmparg,"mfcfile")) {
00130         speech_input = SP_MFCFILE;
00131         realtime_flag = FALSE;
00132       } else if (strmatch(tmparg,"stdin")) {
00133         speech_input = SP_STDIN;
00134         realtime_flag = FALSE;
00135       } else if (strmatch(tmparg,"adinnet")) {
00136         speech_input = SP_ADINNET;
00137         realtime_flag = TRUE;
00138 #ifdef USE_NETAUDIO
00139       } else if (strmatch(tmparg,"netaudio")) {
00140         speech_input = SP_NETAUDIO;
00141         realtime_flag = TRUE;
00142 #endif
00143 #ifdef USE_MIC
00144       } else if (strmatch(tmparg,"mic")) {
00145         speech_input = SP_MIC;
00146         realtime_flag = TRUE;
00147 #endif
00148       } else if (strmatch(tmparg,"file")) { /* for 1.1 compat */
00149         speech_input = SP_RAWFILE;
00150         realtime_flag = FALSE;
00151       } else if (strmatch(tmparg,"mfc")) { /* for 1.1 compat */
00152         speech_input = SP_MFCFILE;
00153         realtime_flag = FALSE;
00154       } else {
00155         j_printerr("%s: no such speech input source \"%s\" supported\n", argv[0], tmparg);
00156         opt_terminate();
00157       }
00158       continue;
00159     } else if (strmatch(argv[i],"-filelist")) { /* input file list */
00160       inputlist_filename = NEXTARG;
00161       continue;
00162     } else if (strmatch(argv[i],"-record")) {   /* record speech data*/
00163       record_dirname = NEXTARG;
00164       continue;
00165     } else if (strmatch(argv[i],"-rejectshort")) { /* short input rejection */
00166       rejectshortlen = atoi(NEXTARG);
00167       continue;
00168     } else if (strmatch(argv[i],"-module")) { /* enable module mode */
00169       module_mode = TRUE;
00170       if (i+1 < argc) {
00171         if (argv[i+1][0] >= '0' && argv[i+1][0] <= '9') {
00172           module_port = atoi(NEXTARG);
00173         }
00174       }
00175       /* this option implicitly includes "-result msock" */
00176       result_output = SP_RESULT_MSOCK;
00177       continue;
00178     } else if (strmatch(argv[i],"-result")) { /* result output */
00179       tmparg = NEXTARG;
00180       if (strmatch(tmparg,"tty")) {
00181         result_output = SP_RESULT_TTY;
00182       } else if (strmatch(tmparg,"msock")) {
00183         result_output = SP_RESULT_MSOCK;
00184       } else {
00185         j_printerr("%s: no such result output \"%s\"\n", argv[0], tmparg);
00186         opt_terminate();
00187       }
00188       continue;
00189     } else if (strmatch(argv[i],"-outcode")) {
00190       decode_output_selection(NEXTARG);
00191       continue;
00192     } else if (strmatch(argv[i],"-force_realtime")) { /* force realtime */
00193       tmparg = NEXTARG;
00194       if (strmatch(tmparg, "on")) {
00195         forced_realtime = TRUE;
00196       } else if (strmatch(tmparg, "off")) {
00197         forced_realtime = FALSE;
00198       } else {
00199         j_printerr("%s: \"-force_realtime\" allows \"on\" or \"off\" only\n", EXECNAME);
00200         opt_terminate();
00201       }
00202       force_realtime_flag = TRUE;
00203       continue;
00204     } else if (strmatch(argv[i],"-realtime")) { /* equal to "-force_realtime on" */
00205       forced_realtime = TRUE;
00206       force_realtime_flag = TRUE;
00207       continue;
00208     } else if (strmatch(argv[i], "-norealtime")) { /* equal to "-force_realtime off" */
00209       forced_realtime = FALSE;
00210       force_realtime_flag = TRUE;
00211       continue;
00212     } else if (strmatch(argv[i],"-forcedict")) { /* skip dict error */
00213       forcedict_flag = TRUE;
00214       continue;
00215     } else if (strmatch(argv[i],"-check")) { /* interactive model check mode */
00216       tmparg = NEXTARG;
00217       if (strmatch(tmparg, "wchmm")) {
00218         wchmm_check_flag = TRUE;
00219       } else if (strmatch(tmparg, "trellis")) {
00220         trellis_check_flag = TRUE;
00221       } else if (strmatch(tmparg, "triphone")) {
00222         triphone_check_flag = TRUE;
00223       } else {
00224         j_printerr("%s: invalid check style: %s\n", argv[0], tmparg);
00225         opt_terminate();
00226       }
00227       continue;
00228     } else if (strmatch(argv[i],"-notypecheck")) { /* don't check param type */
00229       paramtype_check_flag = FALSE;
00230       continue;
00231     } else if (strmatch(argv[i],"-separatescore")) { /* output LM/AM score */
00232 #ifdef USE_NGRAM
00233       separate_score_flag = TRUE;
00234 #else  /* USE_DFA */
00235       j_printerr("Warning: option \"-separatescore\" ignored\n");
00236 #endif
00237       continue;
00238     } else if (strmatch(argv[i],"-nlimit")) { /* limit N token in a node */
00239 #ifdef WPAIR_KEEP_NLIMIT
00240       wpair_keep_nlimit = atoi(NEXTARG);
00241 #else
00242       j_printerr("Warning: option \"-nlimit\" ignored\n");
00243 #endif
00244       continue;
00245     } else if (strmatch(argv[i],"-lookuprange")) { /* trellis neighbor range */
00246       lookup_range = atoi(NEXTARG);
00247       continue;
00248 #ifdef GRAPHOUT
00249     } else if (strmatch(argv[i],"-graphrange")) { /* neighbor merge range frame */
00250       graph_merge_neighbor_range = atoi(NEXTARG);
00251       continue;
00252 #endif
00253 #ifdef USE_DFA
00254     } else if (strmatch(argv[i],"-looktrellis")) { /* activate loopuprange */
00255       looktrellis_flag = TRUE;
00256       continue;
00257     } else if (strmatch(argv[i],"-multigramout")) { /* enable per-grammar decoding on 2nd pass */
00258       multigramout_flag = TRUE;
00259       continue;
00260     } else if (strmatch(argv[i],"-nomultigramout")) { /* disable per-grammar decoding on 2nd pass */
00261       multigramout_flag = FALSE;
00262       continue;
00263 #endif
00264 #ifdef CATEGORY_TREE
00265     } else if (strmatch(argv[i],"-oldtree")) { /* use old tree function */
00266       old_tree_function_flag = TRUE;
00267       continue;
00268 #ifdef PASS1_IWCD
00269     } else if (strmatch(argv[i],"-oldiwcd")) { /* use full lcd ignoring category constraint */
00270       old_iwcd_flag = TRUE;
00271       continue;
00272 #endif
00273 #endif
00274     } else if (strmatch(argv[i],"-sb")) { /* score envelope width in 2nd pass */
00275 #ifdef SCAN_BEAM
00276       scan_beam_thres = atof(NEXTARG);
00277 #else
00278       j_printerr("Warning: option \"-sb\" ignored\n");
00279 #endif
00280       continue;
00281     } else if (strmatch(argv[i],"-discount")) { /* (bogus) */
00282       j_printerr("Warning: option \"-discount\" ignored\n");
00283       continue;
00284     } else if (strmatch(argv[i],"-cutsilence")) { /* force (long) silence detection on */
00285       silence_cut = 1;
00286       continue;
00287     } else if (strmatch(argv[i],"-nocutsilence")) { /* force (long) silence detection off */
00288       silence_cut = 0;
00289       continue;
00290     } else if (strmatch(argv[i],"-pausesegment")) { /* force (long) silence detection on (for backward compatibility) */
00291       silence_cut = 1;
00292       continue;
00293     } else if (strmatch(argv[i],"-nopausesegment")) { /* force (long) silence detection off (for backward comatibility) */
00294       silence_cut = 0;
00295       continue;
00296     } else if (strmatch(argv[i],"-lv")) { /* silence detection threshold level */
00297       level_thres = atoi(NEXTARG);
00298       continue;
00299     } else if (strmatch(argv[i],"-zc")) { /* silence detection zero cross num */
00300       zero_cross_num = atoi(NEXTARG);
00301       continue;
00302     } else if (strmatch(argv[i],"-headmargin")) { /* head silence length */
00303       head_margin_msec = atoi(NEXTARG);
00304       continue;
00305     } else if (strmatch(argv[i],"-tailmargin")) { /* tail silence length */
00306       tail_margin_msec = atoi(NEXTARG);
00307       continue;
00308     } else if (strmatch(argv[i],"-hipass")||strmatch(argv[i],"-hifreq")) { /* frequency of upper band limit */
00309       hipass = atoi(NEXTARG);
00310       continue;
00311     } else if (strmatch(argv[i],"-lopass")||strmatch(argv[i],"-lofreq")) { /* frequency of lower band limit */
00312       lopass = atoi(NEXTARG);
00313       continue;
00314     } else if (strmatch(argv[i],"-smpPeriod")) { /* sample period (ns) */
00315       smpPeriod = atoi(NEXTARG);
00316       smpFreq = period2freq(smpPeriod);
00317       continue;
00318     } else if (strmatch(argv[i],"-smpFreq")) { /* sample frequency (Hz) */
00319       smpFreq = atoi(NEXTARG);
00320       smpPeriod = freq2period(smpFreq);
00321       continue;
00322     } else if (strmatch(argv[i],"-fsize")) { /* Window size */
00323       fsize = atoi(NEXTARG);
00324       continue;
00325     } else if (strmatch(argv[i],"-fshift")) { /* Frame shiht */
00326       fshift = atoi(NEXTARG);
00327       continue;
00328     } else if (strmatch(argv[i],"-preemph")) {
00329       preemph = atof(NEXTARG);
00330       continue;
00331     } else if (strmatch(argv[i],"-fbank")) {
00332       fbank_num = atoi(NEXTARG);
00333       continue;
00334     } else if (strmatch(argv[i],"-ceplif")) {
00335       ceplifter = atoi(NEXTARG);
00336       continue;
00337     } else if (strmatch(argv[i],"-rawe")) {
00338       rawe_required = TRUE;
00339       continue;
00340     } else if (strmatch(argv[i],"-norawe")) {
00341       rawe_required = FALSE;
00342       continue;
00343     } else if (strmatch(argv[i],"-enormal")) {
00344       enormal_required = TRUE;
00345       continue;
00346     } else if (strmatch(argv[i],"-noenormal")) {
00347       enormal_required = FALSE;
00348       continue;
00349     } else if (strmatch(argv[i],"-escale")) {
00350       enormal_escale = atof(NEXTARG);
00351       continue;
00352     } else if (strmatch(argv[i],"-silfloor")) {
00353       enormal_silfloor = atof(NEXTARG);
00354       continue;
00355     } else if (strmatch(argv[i],"-delwin")) { /* Delta window length */
00356       delwin = atoi(NEXTARG);
00357       continue;
00358     } else if (strmatch(argv[i],"-accwin")) { /* Acceleration window length */
00359       accwin = atoi(NEXTARG);
00360       continue;
00361     } else if (strmatch(argv[i],"-ssalpha")) { /* alpha coef. for SS */
00362       ssalpha = atof(NEXTARG);
00363       continue;
00364     } else if (strmatch(argv[i],"-ssfloor")) { /* spectral floor for SS */
00365       ssfloor = atof(NEXTARG);
00366       continue;
00367     } else if (strmatch(argv[i],"-version") || strmatch(argv[i], "--version") || strmatch(argv[i], "-setting") || strmatch(argv[i], "--setting")) { /* print version and exit */
00368       put_header(stderr);
00369       put_compile_defs(stderr);
00370       j_exit();
00371     } else if (strmatch(argv[i],"-quiet")) { /* minimum output */
00372       debug2_flag = verbose_flag = FALSE;
00373       continue;
00374     } else if (strmatch(argv[i],"-debug")) { /* debug mode: output huge log */
00375       debug2_flag = verbose_flag = TRUE;
00376       continue;
00377     } else if (strmatch(argv[i],"-progout")) { /* enable progressive output */
00378       progout_flag = TRUE;
00379       continue;
00380     } else if (strmatch(argv[i],"-proginterval")) { /* interval for -progout */
00381       progout_interval = atoi(NEXTARG);
00382       continue;
00383     } else if (strmatch(argv[i],"-nocharconv")) { /* disable character set conversion */
00384 #ifdef CHARACTER_CONVERSION
00385       from_code = NULL;
00386       to_code = NULL;
00387 #else
00388       j_printerr("Warning: character set conversion disabled, option \"-nocharconv\" ignored\n");
00389 #endif
00390       continue;
00391     } else if (strmatch(argv[i],"-charconv")) { /* enable character set conversion */
00392 #ifdef CHARACTER_CONVERSION
00393       from_code = NEXTARG;
00394       to_code = NEXTARG;
00395 #else
00396       j_printerr("Warning: character set conversion disabled, option \"-charconv\" ignored\n");
00397       i+=2;
00398 #endif
00399       continue;
00400     } else if (strmatch(argv[i],"-kanji")) {
00401 #ifdef CHARACTER_CONVERSION
00402       from_code = NULL;
00403       tmparg = NEXTARG;
00404       if (strmatch(tmparg, "noconv")) {
00405         to_code = NULL;
00406       } else {
00407         to_code = tmparg;
00408       }
00409 #else
00410       j_printerr("Warning: character set conversion disabled, option \"-kanji\" ignored\n");
00411       i++;
00412 #endif
00413       continue;
00414     } else if (strmatch(argv[i],"-demo")) { /* quiet + progout */
00415       debug2_flag = verbose_flag = FALSE;
00416       progout_flag = TRUE;
00417       continue;
00418     } else if (strmatch(argv[i],"-walign")) { /* do forced alignment by word */
00419       align_result_word_flag = TRUE;
00420       continue;
00421     } else if (strmatch(argv[i],"-palign")) { /* do forced alignment by phoneme */
00422       align_result_phoneme_flag = TRUE;
00423       continue;
00424     } else if (strmatch(argv[i],"-salign")) { /* do forced alignment by state */
00425       align_result_state_flag = TRUE;
00426       continue;
00427     } else if (strmatch(argv[i],"-output")) { /* output up to N candidate */
00428       output_hypo_maxnum = atoi(NEXTARG);
00429       continue;
00430     } else if (strmatch(argv[i],"-1pass")) { /* do only 1st pass */
00431       compute_only_1pass = TRUE;
00432       continue;
00433     } else if (strmatch(argv[i],"-hlist")) { /* HMM list file */
00434       mapfilename = filepath(NEXTARG, cwd);
00435       continue;
00436 #ifdef USE_NGRAM
00437     } else if (strmatch(argv[i],"-nlr")) { /* word LR 2-gram (ARPA) */
00438       ngram_filename_lr_arpa = filepath(NEXTARG, cwd);
00439       ngram_filename = NULL;
00440       continue;
00441     } else if (strmatch(argv[i],"-nrl")) { /* word RL 3-gram (ARPA) */
00442       ngram_filename_rl_arpa = filepath(NEXTARG, cwd);
00443       ngram_filename = NULL;
00444       continue;
00445     } else if (strmatch(argv[i],"-lmp")) { /* LM weight and penalty (pass1) */
00446       lm_weight = (LOGPROB)atof(NEXTARG);
00447       lm_penalty = (LOGPROB)atof(NEXTARG);
00448       lmp_specified = TRUE;
00449       continue;
00450     } else if (strmatch(argv[i],"-lmp2")) { /* LM weight and penalty (pass2) */
00451       lm_weight2 = (LOGPROB)atof(NEXTARG);
00452       lm_penalty2 = (LOGPROB)atof(NEXTARG);
00453       lmp2_specified = TRUE;
00454       continue;
00455     } else if (strmatch(argv[i],"-transp")) { /* penalty for transparent word */
00456       lm_penalty_trans = (LOGPROB)atof(NEXTARG);
00457       continue;
00458 #else  /* USE_DFA */
00459     } else if (strmatch(argv[i],"-gram")) { /* comma-separatedlist of grammar prefix */
00460       multigram_add_prefix_list(NEXTARG, cwd);
00461       continue;
00462     } else if (strmatch(argv[i],"-gramlist")) { /* file of grammar prefix list */
00463       multigram_add_prefix_filelist(filepath(NEXTARG, cwd));
00464       continue;
00465     } else if (strmatch(argv[i],"-nogram")) { /* remove grammar list */
00466       multigram_remove_gramlist();
00467       if (dfa_filename != NULL) {
00468         free(dfa_filename);
00469         dfa_filename = NULL;
00470       }
00471       if (dictfilename != NULL) {
00472         free(dictfilename);
00473         dictfilename = NULL;
00474       }
00475       continue;
00476     } else if (strmatch(argv[i],"-dfa")) { /* DFA filename */
00477       dfa_filename = filepath(NEXTARG, cwd);
00478       continue;
00479     } else if (strmatch(argv[i],"-penalty1")) { /* word insertion penalty (pass1) */
00480       penalty1 = (LOGPROB)atof(NEXTARG);
00481       continue;
00482     } else if (strmatch(argv[i],"-penalty2")) { /* word insertion penalty (pass2) */
00483       penalty2 = (LOGPROB)atof(NEXTARG);
00484       continue;
00485 #endif
00486     } else if (strmatch(argv[i],"-spmodel") || strmatch(argv[i], "-sp")) { /* name of short pause word */
00487       spmodel_name = NEXTARG;
00488       continue;
00489 #ifdef MULTIPATH_VERSION
00490     } else if (strmatch(argv[i],"-iwsp")) { /* enable inter-word short pause handing */
00491       enable_iwsp = TRUE;
00492       continue;
00493     } else if (strmatch(argv[i],"-iwsppenalty")) { /* set inter-word short pause transition penalty */
00494       iwsp_penalty = atof(NEXTARG);
00495       continue;
00496 #endif
00497 #ifdef USE_NGRAM
00498     } else if (strmatch(argv[i],"-silhead")) { /* head silence word name */
00499       head_silname = NEXTARG;
00500       continue;
00501     } else if (strmatch(argv[i],"-siltail")) { /* tail silence word name */
00502       tail_silname = NEXTARG;
00503       continue;
00504     } else if (strmatch(argv[i],"-iwspword")) { /* add short pause word */
00505       enable_iwspword = TRUE;
00506       continue;
00507     } else if (strmatch(argv[i],"-iwspentry")) { /* content of the iwspword */
00508       iwspentry = NEXTARG;
00509       continue;
00510     } else if (strmatch(argv[i],"-iwcache")) { /* control cross-word LM cache */
00511 #ifdef HASH_CACHE_IW
00512       iw_cache_rate = atof(NEXTARG);
00513       if (iw_cache_rate > 100) iw_cache_rate = 100;
00514       if (iw_cache_rate < 1) iw_cache_rate = 1;
00515 #else
00516       j_printerr("Warning: option \"-iwcache\" ignored\n");
00517 #endif
00518       continue;
00519     } else if (strmatch(argv[i],"-sepnum")) { /* N-best frequent word will be separated from tree */
00520 #ifdef SEPARATE_BY_UNIGRAM
00521       separate_wnum = atoi(NEXTARG);
00522 #else
00523       j_printerr("Warning: option \"-sepnum\" ignored\n");
00524       i++;
00525 #endif
00526       continue;
00527 #endif /* USE_NGRAM */
00528 #ifdef USE_NETAUDIO
00529     } else if (strmatch(argv[i],"-NA")) { /* netautio device name */
00530       netaudio_devname = NEXTARG;
00531       continue;
00532 #endif
00533     } else if (strmatch(argv[i],"-adport")) { /* adinnet port num */
00534       adinnet_port = atoi(NEXTARG);
00535       continue;
00536     } else if (strmatch(argv[i],"-nostrip")) { /* do not strip zero samples */
00537       strip_zero_sample = FALSE;
00538       continue;
00539     } else if (strmatch(argv[i],"-zmean")) { /* enable DC offset by zero mean */
00540       use_zmean = TRUE;
00541       continue;
00542     } else if (strmatch(argv[i],"-nozmean")) { /* disable DC offset by zero mean */
00543       use_zmean = FALSE;
00544       continue;
00545     } else if (strmatch(argv[i],"-zmeanframe")) { /* enable frame-wise DC offset by zero mean */
00546       zmean_frame = TRUE;
00547       continue;
00548     } else if (strmatch(argv[i],"-nozmeanframe")) { /* disable frame-wise DC offset by zero mean */
00549       zmean_frame = FALSE;
00550       continue;
00551 #ifdef SP_BREAK_CURRENT_FRAME
00552     } else if (strmatch(argv[i],"-spdur")) { /* short-pause duration threshold */
00553       sp_frame_duration = atoi(NEXTARG);
00554       continue;
00555 #endif
00556     } else if (strmatch(argv[i],"-gprune")) { /* select Gaussian pruning method */
00557       tmparg = NEXTARG;
00558       if (strmatch(tmparg,"safe")) { /* safest, slowest */
00559         gprune_method = GPRUNE_SEL_SAFE;
00560       } else if (strmatch(tmparg,"heuristic")) {
00561         gprune_method = GPRUNE_SEL_HEURISTIC;
00562       } else if (strmatch(tmparg,"beam")) { /* fastest */
00563         gprune_method = GPRUNE_SEL_BEAM;
00564       } else if (strmatch(tmparg,"none")) { /* no prune: compute all Gaussian */
00565         gprune_method = GPRUNE_SEL_NONE;
00566       } else if (strmatch(tmparg,"default")) {
00567         gprune_method = GPRUNE_SEL_UNDEF;
00568       } else {
00569         j_printerr("%s: no such pruning method \"%s\"\n", argv[0], tmparg);
00570         opt_terminate();
00571       }
00572       continue;
00573 /* 
00574  *     } else if (strmatch(argv[i],"-reorder")) {
00575  *       result_reorder_flag = TRUE;
00576  *       continue;
00577  */
00578     } else if (strmatch(argv[i],"-no_ccd")) { /* force triphone handling = OFF */
00579       ccd_flag = FALSE;
00580       ccd_flag_force = TRUE;
00581       continue;
00582     } else if (strmatch(argv[i],"-force_ccd")) { /* force triphone handling = ON */
00583       ccd_flag = TRUE;
00584       ccd_flag_force = TRUE;
00585       continue;
00586     } else if (strmatch(argv[i],"-iwcd1")) { /* select cross-word triphone computation method */
00587       tmparg = NEXTARG;
00588       if (strmatch(tmparg, "max")) { /* use maximum score in triphone variants */
00589         iwcdmethod = IWCD_MAX;
00590       } else if (strmatch(tmparg, "avg")) { /* use average in variants */
00591         iwcdmethod = IWCD_AVG;
00592       } else if (strmatch(tmparg, "best")) { /* use average in variants */
00593         iwcdmethod = IWCD_NBEST;
00594         tmparg = NEXTARG;
00595         iwcdmaxn = atoi(tmparg);
00596       } else {
00597         j_printerr("%s: -iwcd1: wrong argument (max|avg|best N): %s\n", argv[0], tmparg);
00598         opt_terminate();
00599       }
00600       continue;
00601     } else if (strmatch(argv[i],"-tmix")) { /* num of mixture to select */
00602       if (i + 1 < argc && isdigit(argv[i+1][0])) {
00603         mixnum_thres = atoi(argv[++i]);
00604       }
00605       continue;
00606     } else if (strmatch(argv[i],"-b2") || strmatch(argv[i],"-bw") || strmatch(argv[i],"-wb")) { /* word beam width in 2nd pass */
00607       enveloped_bestfirst_width = atoi(NEXTARG);
00608       continue;
00609     } else if (strmatch(argv[i],"-hgs")) { /* Gaussian selection model file */
00610       hmm_gs_filename = filepath(NEXTARG, cwd);
00611       continue;
00612     } else if (strmatch(argv[i],"-booknum")) { /* num of state to select in GS */
00613       gs_statenum = atoi(NEXTARG);
00614       continue;
00615     } else if (strmatch(argv[i],"-gshmm")) { /* same as "-hgs" */
00616       hmm_gs_filename = filepath(NEXTARG, cwd);
00617       continue;
00618     } else if (strmatch(argv[i],"-gsnum")) { /* same as "-booknum" */
00619       gs_statenum = atoi(NEXTARG);
00620       continue;
00621     } else if (strmatch(argv[i],"-cmnload")) { /* load CMN parameter from file */
00622       cmnload_filename = filepath(NEXTARG, cwd);
00623       continue;
00624     } else if (strmatch(argv[i],"-cmnsave")) { /* save CMN parameter to file */
00625       cmnsave_filename = filepath(NEXTARG, cwd);
00626       continue;
00627     } else if (strmatch(argv[i],"-cmnupdate")) { /* update CMN parameter */
00628       cmn_update = TRUE;
00629       continue;
00630     } else if (strmatch(argv[i],"-cmnnoupdate")) { /* not update CMN parameter */
00631       cmn_update = FALSE;
00632       continue;
00633     } else if (strmatch(argv[i],"-cmnmapweight")) { /* CMN weight for MAP */
00634       cmn_map_weight = (float)atof(NEXTARG);
00635       continue;
00636     } else if (strmatch(argv[i],"-sscalc")) { /* do spectral subtraction (SS) for raw file input */
00637       sscalc = TRUE;
00638       ssload_filename = NULL;
00639       continue;
00640     } else if (strmatch(argv[i],"-sscalclen")) { /* head silence length used to compute SS (in msec) */
00641       sscalc_len = atoi(NEXTARG);
00642       continue;
00643     } else if (strmatch(argv[i],"-ssload")) { /* load SS parameter from file */
00644       ssload_filename = filepath(NEXTARG, cwd);
00645       sscalc = FALSE;
00646       continue;
00647 #ifdef CONFIDENCE_MEASURE
00648     } else if (strmatch(argv[i],"-cmalpha")) { /* CM log score scaling factor */
00649 #ifdef CM_MULTIPLE_ALPHA
00650       cm_alpha_bgn = (LOGPROB)atof(NEXTARG);
00651       cm_alpha_end = (LOGPROB)atof(NEXTARG);
00652       cm_alpha_step = (LOGPROB)atof(NEXTARG);
00653       cm_alpha_num = (int)((cm_alpha_end - cm_alpha_bgn) / cm_alpha_step) + 1;
00654       if (cm_alpha_num > 100) j_error("too small step or wide range! outputnum > 100\n");
00655 #else
00656       cm_alpha = (LOGPROB)atof(NEXTARG);
00657 #endif
00658       continue;
00659 #ifdef CM_SEARCH_LIMIT
00660     } else if (strmatch(argv[i],"-cmthres")) { /* CM cut threshold for CM decoding */
00661       cm_cut_thres = (LOGPROB)atof(NEXTARG);
00662       continue;
00663 #endif
00664 #ifdef CM_SEARCH_LIMIT_POP
00665     } else if (strmatch(argv[i],"-cmthres2")) { /* CM cut threshold for CM decoding */
00666       cm_cut_thres_pop = (LOGPROB)atof(NEXTARG);
00667       continue;
00668 #endif
00669 #endif /* CONFIDENCE_MEASURE */
00670     } else if (strmatch(argv[i],"-gmm")) { /* load SS parameter from file */
00671       gmm_filename = filepath(NEXTARG, cwd);
00672       continue;
00673     } else if (strmatch(argv[i],"-gmmnum")) { /* num of Gaussian pruning for GMM */
00674       gmm_gprune_num = atoi(NEXTARG);
00675       continue;
00676     } else if (strmatch(argv[i],"-gmmreject")) {
00677       tmparg = NEXTARG;
00678       gmm_reject_cmn_string = (char *)mymalloc(strlen(tmparg)+1);
00679       strcpy(gmm_reject_cmn_string, tmparg);
00680       continue;
00681     } else if (strmatch(argv[i],"-help")) { /* output version and option */
00682       detailed_help();
00683     } else if (strmatch(argv[i],"--help")) {
00684       detailed_help();
00685     }
00686     if (argv[i][0] == '-' && strlen(argv[i]) == 2) {
00687       /* 1-letter options */
00688       switch(argv[i][1]) {
00689       case 'h':                 /* hmmdefs */
00690         hmmfilename = filepath(NEXTARG, cwd);
00691         break;
00692       case 'v':                 /* dictionary */
00693         dictfilename = filepath(NEXTARG, cwd);
00694         break;
00695 #ifdef USE_NGRAM
00696       case 'd':                 /* binary N-gram */
00697         ngram_filename = filepath(NEXTARG, cwd);
00698         ngram_filename_lr_arpa = NULL;
00699         ngram_filename_rl_arpa = NULL;
00700         break;
00701 #endif
00702       case 'b':                 /* beam width in 1st pass */
00703         specified_trellis_beam_width = atoi(NEXTARG);
00704         break;
00705       case 's':                 /* stack size in 2nd pass */
00706         stack_size = atoi(NEXTARG);
00707         break;
00708       case 'n':                 /* N-best search */
00709         nbest = atoi(NEXTARG);
00710         break;
00711       case 'm':                 /* upper limit of hypothesis generation */
00712         hypo_overflow = atoi(NEXTARG);
00713         break;
00714       default:
00715         j_printerr("%s: wrong argument: %s\n", argv[0], argv[i]);
00716         opt_terminate();
00717       }
00718     } else {                    /* error */
00719       j_printerr("%s: wrong argument: %s\n", argv[0], argv[i]);
00720       opt_terminate();
00721     }
00722   }
00723 }
00724 

Juliusに対してTue Mar 28 16:20:49 2006に生成されました。  doxygen 1.4.2