Reordered files
[svmtool++.git] / src / bin / SVMTlearn.cc
blobadcb1aa610d7f71294f8f1485c2e9c26bd9b62b7
1 /*
2 * Copyright (C) 2004 Jesus Gimenez, Lluis Marquez and Senen Moya
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 #include <stdio.h>
20 #include <stdlib.h>
21 #include <string.h>
22 #include "hash.h"
23 #include "list.h"
24 #include "dict.h"
25 #include "weight.h"
26 #include "swindow.h"
27 #include "mapping.h"
28 #include "learner.h"
29 #include "er.h"
30 #include "common.h"
32 extern int verbose_svmtool;
34 void printHelp()
36 fprintf(stderr,"\n\nSVMTool++ v 1.1.2 - SVMTLearner\n\n");
37 fprintf(stderr,"\nUsage : SVMTlearn [options] <model> <config-file>");
38 fprintf(stderr,"\noptions:\n");
39 fprintf(stderr,"\n\t-V or -v:\tverbose");
40 fprintf(stderr,"\n\nExample: SVMTlearn -V config.svmt\n\n");
44 int options(int argc,char *argv[])
47 if ( argc < 2 ) return -1;
49 for (int i=1;i<argc-1;i++)
51 if (strcmp(argv[i],"-v")!=0 || strcmp(argv[i],"-V")!=0)
53 verbose_svmtool = TRUE;
54 return 1;
56 else return -1;
59 return 0;
63 int main(int argc, char *argv[])
65 verbose_svmtool = FALSE;
67 erCompRegExp();
69 int ret = options(argc,argv);
70 if ( ret < 0 )
72 printHelp();
73 return -1;
76 learner L;
77 L.learnerRun(argv[argc-1]);
78 erFreeRegExp();
79 return 0;