trainer.cpp
Go to the documentation of this file.
1 
19 #include <boost/program_options.hpp>
20 #include <string>
21 
22 using namespace ISM;
23 using namespace std;
24 namespace po = boost::program_options;
25 
26 int main (int argc, char** argv) {
27  po::options_description desc("Allowed options");
28  desc.add_options()
29  ("help,h", "produce help message")
30  ("database-file,d", po::value<string>()->default_value("record.sqlite"), "database file to use")
31  ("pattern-name,p", po::value<vector<string> >(), "patters to train instead of all")
32  ("skip-count,s", po::value<int>(), "skip number of training sets after every trained set")
33  ;
34 
35  po::variables_map vm;
36  po::store(po::parse_command_line(argc, argv, desc), vm);
37  po::notify(vm);
38 
39  if (vm.count("help")) {
40  cout << desc << "\n";
41  return 1;
42  }
43 
44  string filename = vm["database-file"].as<string>();
45 
46  Trainer t(filename);
47  if (vm.count("skip-count")) {
48  t.setSkipsPerCycle(vm["skip-count"].as<int>());
49  }
50  std::string patternName(argv[2]);
51  if (vm.count("pattern-name")) {
52  vector<string> names = vm["pattern-name"].as<vector<string> >();
53  for (string& patternName : names) {
54  std::cout<<"training pattern "<<patternName<<" from file "<<filename<<std::endl;
55  t.trainPattern(patternName);
56  }
57  } else {
58  t.trainPattern();
59  }
60 }
std::string patternName
int main(int argc, char **argv)
Definition: trainer.cpp:26
this namespace contains all generally usable classes.


asr_lib_ism
Author(s): Hanselmann Fabian, Heller Florian, Heizmann Heinrich, Kübler Marcel, Mehlhaus Jonas, Meißner Pascal, Qattan Mohamad, Reckling Reno, Stroh Daniel
autogenerated on Wed Jan 8 2020 04:02:41