Cambridge SMT System
main.lexmap.init_param_options.hpp
Go to the documentation of this file.
1 #ifndef MAIN_NWCP_INITPARAMOPTIONS_HPP
2 #define MAIN_NWCP_INITPARAMOPTIONS_HPP
3 
10 namespace ucam {
11 namespace util {
12 namespace po = boost::program_options;
13 
27 inline void init_param_options ( int argc, const char* argv[],
28  po::variables_map *vm ) {
29  try {
30  po::options_description desc ( "Command-line/configuration file options" );
31  desc.add_options()
32  ( HifstConstants::kRangeExtended.c_str(), po::value<std::string>(),
33  "Indices of sentences to translate" )
35  po::value<std::string>()->default_value ("-"),
36  "Read original lattice from [file]" )
38  po::value<std::string>()->default_value ("-"), "Write result" )
39  ( HifstConstants::kAction.c_str(),
40  po::value<std::string>()->default_value ("projectweight2"),
41  "Action to perform. Choose between projectweight2 (default), std2lex, lex2std" )
42  ;
43  parseOptionsGeneric (desc, vm, argc, argv);
44  } catch ( std::exception& e ) {
45  cerr << "error: " << e.what() << "\n";
46  exit ( EXIT_FAILURE );
47  } catch ( ... ) {
48  cerr << "Exception of unknown type!\n";
49  exit ( EXIT_FAILURE );
50  }
51  LINFO ( "Configuration loaded" );
52 };
53 
54 }
55 } // end namespaces
56 #endif
void parseOptionsGeneric(bpo::options_description &desc, bpo::variables_map *vm, int argc, const char *argv[])
Definition: registrypo.hpp:58
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...
#define LINFO(msg)
std::string const kOutputExtended
std::string const kRangeExtended
List of constants to be used both across program options and class runners.
std::string const kAction
std::string const kInputExtended
Definition: bleu.hpp:14