Fixed Makefile to compile program using shared library
[svmtool++.git] / src / tagger.h
blob01d082024934bb57d49a1ec29f2874ca5c6b6d9b
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 #ifndef TAGGER_H
21 struct models_t{
22 weightRepository *wr,*wr2,*wrUnk,*wrUnk2;
23 //hash_t *bias,*bias2,*biasUnk,*biasUnk2;
24 simpleList featureList;
25 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);
61 int taggerRightSenseSpecialForUnknown();
62 int taggerLeftSenseSpecialForUnknown();
63 void taggerDoNormal(int *numWords, int *numSentences);
64 void taggerDoSpecialForUnknown(int *numWords, int *numSentences);
65 void taggerDoNTimes(int *numWords, int *numSentences,int laps);
67 public:
68 void taggerRun();
69 void taggerLoadModelsForTagging();
70 void taggerPutFlow(char *inFlow);
71 void taggerPutBackupDictionary(char *dictName);
72 void taggerPutStrategy(int num);
73 void taggerPutWinLength(int l);
74 void taggerPutWinIndex(int i);
75 void taggerPutKWeightFilter(float kfilter);
76 void taggerPutUWeightFilter(float ufilter);
77 void taggerInit();
78 tagger(char *model);
79 ~tagger();
83 #define TAGGER_H
84 #endif