26 namespace po = boost::program_options;
42 po::variables_map *vm ) {
44 po::options_description desc (
"Command-line/configuration file options" );
47 po::value<std::string>()->default_value (
"1"),
48 "Indices of sentences to translate" )
50 "Number of threads (trimmed to number of cpus in the machine) " )
52 , po::value<std::string>()->default_value (
"" )
53 ,
"Feature weights applied in hifst. This is a comma-separated sequence " 54 "of language model(s) and grammar feature weights.\n" 55 "IMPORTANT: If this option is not empty string, then it will override " 56 "any values in lm.featureweights and ruleflowerlattice.featureweights" 59 "Filter the flower lattice with the vocabulary of the alignment lattices" )
61 "Load a synchronous context-free grammar file" )
63 po::value<std::string>()->default_value (
"" ),
"Store the fst (SparseWeight)" )
65 po::value<std::string>()->default_value (
"1" ),
66 "One or more feature weights. Must match the number of features in the grammar" )
68 po::value<std::string>(),
"Load an alignment lattice" )
70 po::value<std::string>()->default_value (
"" ),
71 "Store the fst (SparseWeight) containing a vector of weights " )
73 po::value<std::string>()->default_value (
"no" ),
74 "Strip any special Hifst epsilon labels (e.g. oov, deletion rule, ...)" )
76 po::value<std::string>()->default_value (
"yes" ),
77 "Determinizes (and minimizes) the vector feature lattice. yes|no" )
79 po::value<std::string>()->default_value (
"" ),
80 "Store the fst (SparseWeight) containing a vector of weights " )
82 po::value<std::string>()->default_value (
"" ),
83 "Use wordmap when dumping nbest list (to use with storenbestfile option )" )
85 po::value<std::string>()->default_value (
"" ),
86 "Store the fst (SparseWeight) containing a vector of weights " )
88 po::value<unsigned>()->default_value ( 50 ),
89 "Number for which the feature output will printed in sparse format (weight_1@position_1 ... weight_n@position_n" )
94 LDEBUG (
"ruleflowerlattice.load=" <<
97 LERROR (
"parameter ruleflowerlattice.load not defined" );
98 exit ( EXIT_FAILURE );
100 }
catch ( std::exception& e ) {
101 cerr <<
"error: " << e.what() <<
"\n";
102 exit ( EXIT_FAILURE );
104 cerr <<
"Exception of unknown type!\n";
105 exit ( EXIT_FAILURE );
107 LINFO (
"Configuration loaded" );
void parseOptionsGeneric(bpo::options_description &desc, bpo::variables_map *vm, int argc, const char *argv[])
void init_param_options(int argc, const char *argv[], po::variables_map *vm)
Function to initialize boost program_options module with command-line and config file options...
const std::string kRuleflowerlatticeLoad
const std::string kSparseweightvectorlatticeDeterminize
const std::string kSparseweightvectorlatticeLoadalilats
std::string const kRangeExtended
List of constants to be used both across program options and class runners.
const std::string kSparseweightvectorlatticeStripSpecialEpsilonLabels
const std::string kSparseweightvectorlatticeStorenbestfile
const std::string kRuleflowerlatticeFilterbyalilats
const std::string kRuleflowerlatticeFeatureweights
const std::string kNThreads
const std::string kSparseweightvectorlatticeWordmap
const std::string kSparseweightvectorlatticeStorefeaturefile
const std::string kRuleflowerlatticeStore
const std::string kSparseweightvectorlatticeStore
const std::string kSparseweightvectorlatticeFirstsparsefeatureatindex
To initialize boost parameter options.
void initCommonApplylmOptions(po::options_description &desc)
const std::string kFeatureweights