hce-node application  1.4.3
HCE Hierarchical Cluster Engine node application
 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 
28 {
33  POS,
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 
53 {
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 
100 {
101  ENGLISH = 0,
109 };
110 
111 
113 {
114  LM_NONE = 0,
115 
123  LM_THAI = 1 << THAI,
124 
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 
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 
207 {
211  //MethodQuality _methodQuality;
212  typedef void(TPlugin::*FP)(LCoreData&);
217  //static const std::string PTdescription[];
219  {
222  _languageMask = LM_NONE; //UNKNOWN_LANGUAGE
223  _methodAddress = 0;
224  _object = 0;
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_ */