Fixed mods to 644 again
[svmtool++.git] / src / bin / SVMTlearn.cc
blob773c3b007cf51e1599376db855bb72a9d42d4f89
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.
8 *
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 int verbose = FALSE;
34 void printHelp(char *progname)
36 fprintf(stderr,"\n\nSVMTool++ v 1.1.6 - SVMTLearner\n\n");
37 fprintf(stderr,"\nUsage : %s [options] <model> <config-file>", progname);
38 fprintf(stderr,"\noptions:\n");
39 fprintf(stderr,"\n\t-V or -v:\tverbose");
40 fprintf(stderr,"\n\nExample: %s -V config.svmt\n\n", progname);
43 int options(int argc,char *argv[])
46 if ( argc < 2 ) return -1;
48 for (int i=1;i<argc-1;i++)
50 if (strcmp(argv[i],"-v")!=0 || strcmp(argv[i],"-V")!=0)
52 verbose = TRUE;
53 return 1;
55 else return -1;
58 return 0;
61 int main(int argc, char *argv[])
63 erCompRegExp();
65 int ret = options(argc,argv);
66 if ( ret < 0 )
68 printHelp(argv[0]);
69 return -1;
72 learner L;
73 L.learnerRun(argv[argc-1]);
74 erFreeRegExp();
75 return 0;