1 #ifndef MAIN_NWCP_INITPARAMOPTIONS_HPP 2 #define MAIN_NWCP_INITPARAMOPTIONS_HPP 13 namespace po = boost::program_options;
29 po::variables_map *vm ) {
33 po::options_description desc (
"Command-line/configuration file options" );
36 "Indices of sentences to translate" )
38 po::value<std::string>()->default_value (
""),
39 "Map labels to words with this map file" )
40 (
kInput.c_str(), po::value<std::string>()->default_value (
"-"),
41 "Read original lattice from [file]" )
43 po::value<std::string>()->default_value (
"-"),
46 po::value<unsigned>()->default_value (1),
"Number of hypotheses" )
49 (
kWeightPrecision.c_str(), po::value<unsigned>()->default_value(6),
"Weight precision ")
50 (
kSentBleu.c_str(),
"compute sentence level bleu (blue+1)" )
53 (
kIntRefs.c_str(), po::value<std::string>(),
"reference strings (integers)" )
54 (
kWordRefs.c_str(), po::value<std::string>(),
"reference strings (words)" )
55 (
kExternalTokenizer.c_str(), po::value<std::string>(),
"external tokenization script" )
59 po::value<std::string>()->default_value (
"stdarc"),
60 "Choose between stdarc, lexstdarc, and tuplearc (for the tropical sparse tuple arc semiring)")
62 "Tropic sparse tuple arc weights. " 63 "Comma-separated floats. This needs to be set when the option --semiring=tuplearc is chosen.")
65 "Prints output labels instead of input labels" )
67 "Prints both input and output labels" )
69 ,
"Loads file with hypotheses (input or output depending on parameter to print output labels " 70 " and generates an FSA that intersects " 71 " with input machine before dumping hypothesis. File can be either an FSA " 72 " or a plaintext file with one line per hypothesis (words must be integer mapped)" 76 }
catch ( std::exception& e ) {
77 cerr <<
"error: " << e.what() <<
"\n";
78 exit ( EXIT_FAILURE );
80 cerr <<
"Exception of unknown type!\n";
81 exit ( EXIT_FAILURE );
83 LINFO (
"Configuration loaded" );
void parseOptionsGeneric(bpo::options_description &desc, bpo::variables_map *vm, int argc, const char *argv[])
std::string const kHifstSemiring
std::string const kUniqueExtended
std::string const kNbestExtended
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...
std::string const kSentBleu
std::string const kExternalTokenizer
std::string const kIntRefs
std::string const kOutput
std::string const kRangeExtended
List of constants to be used both across program options and class runners.
std::string const kWordRefs
std::string const kPrintInputOutputLabels
std::string const kPrintOutputLabelsExtended
std::string const kWeightExtended
std::string const kLibLinRankFormat
std::string const kWeightPrecision
std::string const kTupleArcWeights
std::string const kLabelMapExtended
std::string const kSuppress
std::string const kSparseDotProduct
std::string const kSparseFormat
std::string const kIntersectionWithHypothesesLoad