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
30 #define EMPTY_WORD "_"
31 #define EMPTY_POS "??"
33 #define LEFT_TO_RIGHT 1
34 #define RIGHT_TO_LEFT 2
36 #define RESET_VALUES 1
39 #define COUNTING_FROM_END 111
40 #define COUNTING_FROM_BEGIN 222
49 std::ostream
* m_output
;
58 nodo
*index
,*beginWin
,*endWin
;
59 int lengthWin
,posIndex
,posBegin
,posEnd
;
61 //User window: this allows users to specify their own windows
62 std::vector
<nodo
*> user_window
;
64 void init(dictionary
* dic
/*= 0*/);
65 int iniList(dictionary
* dic
/*= 0*/);
67 int readSentence(dictionary
* dic
/*= 0*/);
68 int readInput(dictionary
* dic
);
69 void winAdd(nodo
* node
);
71 int winLookRegExp2(void *er
,const std::string
& str
);
76 int winLookRegExp(const std::string
& m
);
77 int winMaterializePOSValues(int action
);
80 swindow(std::istream
& input
, std::ostream
* output
, dictionary
* dic
/*= 0*/);
81 swindow(std::istream
& input
,int number
, int position
, std::ostream
* output
, dictionary
* dic
/*= 0*/);
82 swindow(std::istream
& input
,int number
, std::ostream
* output
, dictionary
* dic
/*= 0*/);
83 swindow(int lengthWin
, dictionary
*dic
);
87 nodo
*get(int position
,int direction
);
88 nodo
*get_user(int position
);
90 nodo
*get_intern(int position
);
91 int show(int showScoresFlag
, int showComments
);
93 void putLengthWin(int l
);
98 void setWindow(const std::vector
<nodo
*>&);
100 int winExistUnkWord(int direction
, dictionary
*d
);
102 void winPushWordFeature(void* ptr
, dictionary
* d
, stack
< string
>& pila
, int direction
);
103 void winPushPosFeature(void *ptr
,dictionary
*d
, std::stack
<std::string
>& pila
,int direction
);
104 void winPushAmbiguityFeature(void *ptr
,dictionary
*d
, std::stack
<std::string
>& pila
,int direction
);
105 void winPushMFTFeature(void *ptr
,dictionary
*d
, std::stack
<std::string
>& pila
,int direction
);
106 void winPushMaybeFeature(void *ptr
,dictionary
*d
, std::stack
<std::string
>& pila
,int direction
);
107 void winPushSwnFeature(std::stack
<std::string
>& pila
);
109 void winPushSuffixFeature(const std::string
& wrd
, std::stack
<std::string
>& pila
,int longitud
);
110 void winPushPrefixFeature(const std::string
& wrd
, std::stack
<std::string
>& pila
,int longitud
);
111 //void winPushStartCapFeature(const std::string& wrd, struct std::stack *pila);
112 void winPushAllUpFeature(const std::string
& wrd
, std::stack
<std::string
>& pila
);
113 void winPushAllLowFeature(const std::string
& wrd
, std::stack
<std::string
>& pila
);
114 void winPushContainCapFeature(const std::string
& wrd
, std::stack
<std::string
>& pila
);
115 void winPushContainCapsFeature(const std::string
& wrd
, std::stack
<std::string
>& pila
);
116 void winPushContainPeriodFeature(const std::string
& wrd
, std::stack
<std::string
>& pila
);
117 void winPushContainCommaFeature(const std::string
& wrd
, std::stack
<std::string
>& pila
);
118 void winPushContainNumFeature(const std::string
& wrd
, std::stack
<std::string
>& pila
);
119 void winPushMultiwordFeature(const std::string
& wrd
, std::stack
<std::string
>& pila
);
120 void winPushLetterFeature(const std::string
& wrd
, std::stack
<std::string
>& pila
, int where
, int position
);
121 void winPushLenghtFeature(const std::string
& wrd
, std::stack
<std::string
>& pila
);
122 void winPushStartWithCapFeature(const std::string
& wrd
, std::stack
<std::string
>& pila
);
123 void winPushStartWithLowerFeature(const std::string
& wrd
, std::stack
<std::string
>& pila
);
124 void winPushStartWithNumberFeature(const std::string
& wrd
, std::stack
<std::string
>& pila
);
125 int iniGeneric(dictionary
* dic
/*= 0*/);