Reordered files
[svmtool++.git] / include / swindow.h
blob4e5baac77e1f648f1224a6bda5cf3019fab7cef9
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 SWINDOW_H
21 #include "common.h"
23 #define CHAR_NULL '~'
24 #define EMPTY_WORD "_"
25 #define EMPTY_POS "??"
26 #define EMPTY ""
27 #define LEFT_TO_RIGHT 1
28 #define RIGHT_TO_LEFT 2
29 #define PUT_MAX 0
30 #define RESET_VALUES 1
31 #define PUT_OLD 2
33 #define COUNTING_FROM_END 111
34 #define COUNTING_FROM_BEGIN 222
36 struct nodo
38 int ord;
39 char wrd[TAM_WORD];
40 char realWrd[TAM_WORD];
41 char comment[TAM_LINE];
42 char pos[TAM_POS],posOld[TAM_POS];
43 long double weight,weightOld;
44 struct stack_t *stackScores;
45 nodo *next;
46 nodo *previous;
49 class swindow
51 private:
52 FILE *input;
53 //List Control
54 nodo *first;
55 nodo *last;
56 int numObj;
58 //Window Control
59 nodo *index,*beginWin,*endWin;
60 int lengthWin,posIndex,posBegin,posEnd;
62 void init();
63 int iniList();
65 int readSentence();
66 int readInput();
67 int readInput_old();
68 int winAdd(char *wrd, char *pos);
70 int winLookRegExp2(void *er,char *str);
71 void winCompRegExp();
72 void winFreeRegExp();
74 public:
75 int winLookRegExp(char *m);
76 int winMaterializePOSValues(int action);
78 ~swindow();
79 swindow(FILE *input);
80 swindow(FILE *input,int number, int position);
81 swindow(FILE *input,int number);
82 int next();
83 int previous();
84 nodo *getIndex();
85 nodo *get(int position,int direction);
86 int show();
88 void putLengthWin(int l);
89 void putIndex(int i);
91 int sentenceLength();
93 int winExistUnkWord(int direction, dictionary *d);
95 void winPushWordFeature(void *ptr,dictionary *d, struct stack_t *pila,int direction);
96 void winPushPosFeature(void *ptr,dictionary *d, struct stack_t *pila,int direction);
97 void winPushAmbiguityFeature(void *ptr,dictionary *d, struct stack_t *pila,int direction);
98 void winPushMFTFeature(void *ptr,dictionary *d, struct stack_t *pila,int direction);
99 void winPushMaybeFeature(void *ptr,dictionary *d, struct stack_t *pila,int direction);
100 void winPushSwnFeature(struct stack_t *pila);
101 void winPushUnknownFeatures(char *str, struct stack_t *pila);
103 void winPushSuffixFeature(char *wrd, struct stack_t *pila,int longitud);
104 void winPushPrefixFeature(char *wrd, struct stack_t *pila,int longitud);
105 //void winPushStartCapFeature(char *wrd, struct stack_t *pila);
106 void winPushAllUpFeature(char *wrd,stack_t *pila);
107 void winPushAllLowFeature(char *wrd,stack_t *pila);
108 void winPushContainCapFeature(char *wrd, stack_t *pila);
109 void winPushContainCapsFeature(char *wrd, stack_t *pila);
110 void winPushContainPeriodFeature(char *wrd, stack_t *pila);
111 void winPushContainCommaFeature(char *wrd, stack_t *pila);
112 void winPushContainNumFeature(char *wrd, stack_t *pila);
113 void winPushMultiwordFeature(char *wrd, stack_t *pila);
114 void winPushLetterFeature(char *, stack_t *, int, int );
115 void winPushLenghtFeature(char *wrd, stack_t *pila);
116 void winPushStartWithCapFeature(char *,stack_t *);
117 void winPushStartWithLowerFeature(char *,stack_t *);
118 void winPushStartWithNumberFeature(char *,stack_t *);
119 int iniGeneric();
120 void deleteList();
123 #define SWINDOW_W
124 #endif