1
/* ====================================================================
2
* Copyright (c) 1995-2000 Carnegie Mellon University. All rights
5
* Redistribution and use in source and binary forms, with or without
6
* modification, are permitted provided that the following conditions
9
* 1. Redistributions of source code must retain the above copyright
10
* notice, this list of conditions and the following disclaimer.
12
* 2. Redistributions in binary form must reproduce the above copyright
13
* notice, this list of conditions and the following disclaimer in
14
* the documentation and/or other materials provided with the
17
* This work was supported in part by funding from the Defense Advanced
18
* Research Projects Agency and the National Science Foundation of the
19
* United States of America, and the CMU Sphinx Speech Consortium.
21
* THIS SOFTWARE IS PROVIDED BY CARNEGIE MELLON UNIVERSITY ``AS IS'' AND
22
* ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
23
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
24
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL CARNEGIE MELLON UNIVERSITY
25
* NOR ITS EMPLOYEES BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33
* ====================================================================
36
/*********************************************************************
38
* File: parse_cmd_ln.c
41
* These routines define and parse the command line for init_gau.
44
* Eric H. Thayer (eht@cs.cmu.edu)
45
*********************************************************************/
47
#include "parse_cmd_ln.h"
49
#include <sphinxbase/cmd_ln.h>
50
#include <sphinxbase/feat.h>
53
#include <sys_compat/misc.h>
60
/* defines, parses and (partially) validates the arguments
61
given on the command line */
64
parse_cmd_ln(int argc, char *argv[])
69
const char helpstr[] =
70
"Description: (Copy from Rita's web manual) To initialize the means and variances, global values of \n\
71
these parameters are first estimated and then copied into appropriate \n\
72
positions in the parameter files. The global mean is computed using \n\
73
all the vectors you have in your feature files. This is usually a \n\
74
very large number, so the job is divided into many parts. At this \n\
75
stage you tell the Sphinx how many parts you want it to divide this \n\
76
operation into (depending on the computing facilities you have) and \n\
77
the Sphinx \"accumulates\" or gathers up the vectors for each part \n\
78
separately and writes it into an intermediate buffer on your \n\
79
machine. The executable init_gau is used for this purpose.";
81
const char examplestr[]=
84
init_gau -accumdir accumdir -ctlfn controlfn -part 1 -npart 1 -cepdir cepdir -feat 1s_12c_12d_3p_12dd -ceplen 13 ";
86
static arg_t defn[] = {
90
"Shows the usage of the tool"},
95
"Shows example of how to use the tool"},
100
"Model definition file for the single density HMM's to initialize"},
104
"Tied-state-to-codebook mapping file"},
108
"Where to write mean/var counts"},
112
"Mean file for variance initialization"},
116
"Accumulate for full covariance matrices"},
120
"Control file of the training corpus"},
124
"# of lines to skip in the control file"},
128
"# of lines to process in the control file (after any skip)"},
132
"Identifies the corpus part number (range 1..NPART)" },
136
"Partition the corpus into this many equal sized subsets" },
140
"All word transcripts for the training corpus (consistent order w/ -ctlfn!)"},
144
"Dictionary for the content words"},
148
"Dictionary for the filler words"},
152
"Root directory of the training corpus state segmentation files."},
156
"Extension of the training corpus state segmentation files."},
161
"Scale existing segmentation to fit new parameter stream length."},
165
"Root directory of the training corpus cepstrum files."},
170
"Extension of the training corpus cepstrum files."},
172
cepstral_to_feature_command_line_macro(),
173
{NULL, 0, NULL, NULL}
176
cmd_ln_parse(defn, argc, argv, 1);
178
isHelp = cmd_ln_int32("-help");
179
isExample = cmd_ln_int32("-example");
182
printf("%s\n\n",helpstr);
186
printf("%s\n\n",examplestr);
189
if(isHelp || isExample){
190
E_INFO("User asked for help or example.\n");