More code cleanup
[svmtool++.git] / src / tagger.h
blobc714aa5456769d1aa20419c759ef70f2031e1ae6
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 #ifndef TAGGER_H
21 struct models_t
23 weightRepository *wr,*wr2,*wrUnk,*wrUnk2;
24 //hash_t *bias,*bias2,*biasUnk,*biasUnk2;
25 simpleList featureList;
26 simpleList featureListUnk;
29 class tagger
31 private:
32 //Flow Control
33 char flow[10];
34 int taggerStrategy,taggerNumLaps,taggerWinIndex,taggerWinLength;
35 float taggerKFilter,taggerUFilter;
36 char taggerBackupDict[150],taggerModelName[150];
38 struct stack_t *stk;
39 models_t *taggerModelList;
40 models_t *taggerModelRunning;
41 dictionary *d;
42 swindow *sw;
43 weight_node_t *weightUnk;
45 int taggerRightSense();
46 int taggerLeftSense();
48 void taggerSumWeight(weightRepository *wRep,hash_t *bias,weight_node_t *weight,int numMaybe, int *max);
49 void taggerGenerateScore(nodo *elem,int direction);
51 weight_node_t *taggerCreateWeightNodeArray(int numMaybe,int index);
52 weight_node_t *taggerInitializeWeightNodeArray(int numMaybe,weight_node_t *w);
53 weight_node_t *taggerCreateWeightUnkArray(char *name);
54 hash_t *taggerCreateBiasHash(char *name);
55 void taggerLoadModels(models_t *model, int taggerNumModel);
57 void taggerStadistics(int numWords, int numSentences, double realTime,double usrTime, double sysTime);
58 void taggerShowVerbose(int num,int isEnd);
60 int taggerRightSenseSpecialForUnknown();
61 int taggerLeftSenseSpecialForUnknown();
62 void taggerDoNormal(int *numWords, int *numSentences);
63 void taggerDoSpecialForUnknown(int *numWords, int *numSentences);
64 void taggerDoNTimes(int *numWords, int *numSentences,int laps);
66 public:
67 void taggerRun();
68 void taggerLoadModelsForTagging();
69 void taggerPutFlow(char *inFlow);
70 void taggerPutBackupDictionary(char *dictName);
71 void taggerPutStrategy(int num);
72 void taggerPutWinLength(int l);
73 void taggerPutWinIndex(int i);
74 void taggerPutKWeightFilter(float kfilter);
75 void taggerPutUWeightFilter(float ufilter);
76 void taggerInit();
77 tagger(char *model);
78 ~tagger();
81 #define TAGGER_H
82 #endif