Poc més
[apertium.git] / apertium-unicode / apertium / tagger.h
blob0b16ee8765a50f4b79ff6617c4032579059543b4
1 /*
2 * Copyright (C) 2005 Universitat d'Alacant / Universidad de Alicante
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License as
6 * published by the Free Software Foundation; either version 2 of the
7 * License, or (at your option) any later version.
9 * This program is distributed in the hope that it will be useful, but
10 * WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
17 * 02111-1307, USA.
19 #ifndef __TAGGER_
20 #define __TAGGER_
22 #include <cstdio>
23 #include <fstream>
24 #include <map>
25 #include <set>
27 #include <apertium/constant_manager.h>
28 #include <apertium/tagger_data.h>
29 #include <apertium/ttag.h>
31 using namespace std;
33 class Tagger
35 private:
36 enum Mode{UNKNOWN_MODE,
37 TRAIN_MODE,
38 TAGGER_MODE,
39 RETRAIN_MODE,
40 TAGGER_SUPERVISED_MODE,
41 TRAIN_SUPERVISED_MODE,
42 RETRAIN_SUPERVISED_MODE,
43 TAGGER_EVAL_MODE,
44 TAGGER_FIRST_MODE};
46 vector<string> filenames;
47 int nit;
48 string name;
49 bool debug;
51 int getMode(int argc, char *argv[]);
52 void tagger(bool model_first=false);
53 void train();
54 void retrain();
55 void trainSupervised();
56 void help();
57 void filerror(string const &filename);
58 bool isNumber(const char *str);
59 public:
60 Tagger();
61 void main(int argc, char *argv[]);
64 #endif