19 #include <boost/program_options.hpp> 24 namespace po = boost::program_options;
26 int main (
int argc,
char** argv) {
27 po::options_description desc(
"Allowed 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")
36 po::store(po::parse_command_line(argc, argv, desc), vm);
39 if (vm.count(
"help")) {
44 string filename = vm[
"database-file"].as<
string>();
47 if (vm.count(
"skip-count")) {
48 t.setSkipsPerCycle(vm[
"skip-count"].as<int>());
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);
int main(int argc, char **argv)
this namespace contains all generally usable classes.