hce-node application
1.4.3
HCE Hierarchical Cluster Engine node application
Main Page
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
ProcessInfo.hpp
Go to the documentation of this file.
1
6
#ifndef PROCESS_INFO_HPP
7
#define PROCESS_INFO_HPP
8
9
#include <vector>
10
#include <cld/compact_lang_det.h>
11
12
#include "
Defs.hpp
"
13
14
namespace
HCE
15
{
16
17
namespace
component
18
{
19
20
class
TPlugin;
21
class
LCoreData;
22
23
27
enum
MethodType
28
{
29
MT_NONE
,
30
SPLIT
,
31
LDET
,
32
NORM
,
33
POS
,
34
TAGS
,
35
HCRC
,
36
WTYPE
37
};
38
static
SSTRING
MTdescription[] =
39
{
40
"Unknown method"
,
41
"Split method"
,
42
"Language detect method"
,
43
"Normalize method"
,
44
"pos method"
,
45
"Tag reduce method"
,
46
"HCRC method"
47
};
48
52
enum
PluginType
53
{
54
PT_NONE
,
55
DEFAULT
,
56
SNOWBALL_NORM
,
57
ICU_BOUNDARIES
,
58
BOOST_SPLIT
,
59
BOOST_TOKENIZER
,
60
POCO_TOKENIZER
,
61
CHROMIUM_LDET
,
62
TAG_REDUCE
,
63
MECAB_NORM
,
64
TURGLEM_POS
,
65
FAKE_HCRC
,
66
MECAB_WTYPE
67
,
MECAB_TOKENIZE
68
};
69
70
static
SSTRING
PTdescription[] =
71
{
72
"Unknown plugin"
,
73
"Default plugin"
,
74
"Snowball normalization plugin"
,
75
"Icu boundaries plugin"
,
76
"Boost split plugin"
,
77
"Boost tokenizer plugin"
,
78
"Poco tokinizer plugin"
,
79
"Chromium language detector plugin"
,
80
"Tag reduce plugin"
,
81
"Mecab norm plugin"
,
82
"Turglem pos plugin"
,
83
"HCRC plugin"
84
,
"Mecab word type detector plugin"
85
,
"Mecab tokenizer plugin"
86
};
87
88
//enum MethodQuality { MQ_NONE, COMMON_QUALITY, LOW_QUALITY, BOOST_SPLIT, POCO_TOKENIZER, ICU_BOUNDARIES };
89
90
91
//enum LanguageMask { LM_NONE, LM_ALL, LM_JAPANESE };
92
93
typedef
unsigned
int
LanguageMask
;
94
95
99
enum
Language_enum
100
{
101
ENGLISH
= 0,
102
JAPANESE
,
103
RUSSIAN
,
104
UKRAINIAN
,
105
BYELORUSSIAN
=
UKRAINIAN
,
106
GERMAN
,
107
FRENCH
,
108
THAI
109
};
110
111
112
enum
LanguageMask_enum
113
{
114
LM_NONE
= 0,
115
116
LM_ENGLISH
= 1 <<
ENGLISH
,
117
LM_JAPANESE
= 1 <<
JAPANESE
,
118
LM_RUSSIAN
= 1 <<
RUSSIAN
,
119
LM_UKRAINIAN
= 1 <<
UKRAINIAN
,
120
LM_BYELORUSSIAN
= 1 <<
BYELORUSSIAN
,
121
LM_GERMAN
= 1 <<
GERMAN
,
122
LM_FRENCH
= 1 <<
FRENCH
,
123
LM_THAI
= 1 <<
THAI
,
124
125
LM_ALL
= (
LanguageMask
) (-1)
126
};
127
128
/*
132
enum POS_enum
133
{
134
POS_NOUN = 0,
135
POS_ADJ_FULL = 1,
136
POS_VERB = 2,
137
POS_VBE = 3,
138
POS_MOD = 4,
139
POS_NUMERAL = 5,
140
POS_CONJ = 6,
141
POS_INTERJ = 7,
142
POS_PREP = 8,
143
POS_PARTICLE = 9,
144
POS_ART = 10,
145
POS_ADV = 11,
146
POS_PN = 12,
147
POS_ORDNUM = 13,
148
POS_PRON = 14,
149
POS_POSS = 15,
150
POS_PN_ADJ = 16
152
};
153
154
155
enum POS_Mask
156
{
157
PM_NOUN = 1 << POS_NOUN,
158
PM_ADJ_FULL = 1 << POS_ADJ_FULL,
159
PM_VERB = 1 << POS_VERB,
160
PM_VBE = 1 << POS_VBE,
161
PM_MOD = 1 << POS_MOD,
162
PM_NUMERAL = 1 << POS_NUMERAL,
163
PM_CONJ = 1 << POS_CONJ,
164
PM_INTERJ = 1 << POS_INTERJ,
165
PM_PREP = 1 << POS_PREP,
166
PM_PARTICLE = 1 << POS_PARTICLE,
167
PM_ART = 1 << POS_ART,
168
PM_ADV = 1 << POS_ADV,
169
PM_PN = 1 << POS_PN,
170
PM_ORDNUM = 1 << POS_ORDNUM,
171
PM_PRON = 1 << POS_PRON,
172
PM_POSS = 1 << POS_POSS,
173
PM_PN_ADJ = 1 << POS_PN_ADJ
174
};
175
*/
176
177
static
SSTRING
LMdescription[] =
178
{
179
"Unknown language"
,
180
"All language"
181
};
182
183
enum
Status
{
METHOD_FOUND
,
METHOD_NOT_FOUND
,
PLUGIN_NOT_FOUND
};
184
static
SSTRING
Sdescription[] =
185
{
186
"Method found"
,
187
"Method not found"
,
188
"Plugin not found"
189
};
190
191
192
#define SET_PROCESS_INFO_L(processInfo, _mType, _pType, _lMask) { processInfo._methodType = _mType; \
193
processInfo._pluginType = _pType; \
194
processInfo._languageMask = _lMask; \
195
processInfo._about = HCE::component::PTdescription[_pType]; }
196
197
198
#define SET_PROCESS_INFO_P(processInfo, _mType, _pType, _lMask,
/*_mQuality,*/
_mAddr, _mObj) { processInfo._methodType = _mType; \
199
processInfo._pluginType = _pType; \
200
processInfo._languageMask = _lMask; \
201
/*processInfo._methodQuality = _mQuality;*/
\
202
processInfo._methodAddress = _mAddr; \
203
processInfo._object = _mObj; }
204
205
206
struct
ProcessInfo
207
{
208
MethodType
_methodType
;
209
PluginType
_pluginType
;
210
LanguageMask
_languageMask
;
211
//MethodQuality _methodQuality;
212
typedef
void(
TPlugin
::*
FP
)(
LCoreData
&);
213
FP
_methodAddress
;
214
TPlugin
*
_object
;
215
Status
_status
;
216
SSTRING
_about
;
217
//static const std::string PTdescription[];
218
ProcessInfo
()
219
{
220
_methodType
=
MT_NONE
;
221
_pluginType
=
PT_NONE
;
222
_languageMask
=
LM_NONE
;
//UNKNOWN_LANGUAGE
223
_methodAddress
= 0;
224
_object
= 0;
225
_status
=
METHOD_NOT_FOUND
;
226
_about
= PTdescription[0];
227
}
228
bool
compare
(
const
ProcessInfo
& processInfo )
const
229
{
230
return
(
_methodType
== processInfo.
_methodType
&& \
231
_pluginType
== processInfo.
_pluginType
&& \
232
/*_methodQuality == processInfo._methodQuality &&*/
\
233
_languageMask
== processInfo.
_languageMask
);
234
}
235
};
236
237
}
/* namespace component */
238
239
}
/* namespace HCE */
240
241
242
#endif
/* PROCESS_INFO_H_ */
sources
utils
refine
src
ProcessInfo.hpp
Generated on Tue Jun 30 2015 19:42:16 for hce-node application by
1.8.1.2