@ccmaymay/concrete 4.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ActiveLearnerClientService.js +249 -0
- package/ActiveLearnerServerService.js +642 -0
- package/AnnotateCommunicationService.js +696 -0
- package/AnnotateWithContextService.js +298 -0
- package/FeedbackService.js +750 -0
- package/FetchCommunicationService.js +709 -0
- package/LICENSE +31 -0
- package/ResultsServerService.js +2138 -0
- package/SearchProxyService.js +962 -0
- package/SearchService.js +685 -0
- package/Service.js +373 -0
- package/StoreCommunicationService.js +255 -0
- package/SummarizationService.js +479 -0
- package/access_types.js +168 -0
- package/annotate_types.js +26 -0
- package/audio_types.js +110 -0
- package/cluster_types.js +398 -0
- package/communication_fu.js +432 -0
- package/communication_types.js +845 -0
- package/concrete.js +65 -0
- package/context_types.js +65 -0
- package/email_types.js +477 -0
- package/entities_types.js +658 -0
- package/ex_types.js +82 -0
- package/language_types.js +123 -0
- package/learn_types.js +207 -0
- package/linking_types.js +286 -0
- package/metadata_types.js +926 -0
- package/nitf_types.js +1005 -0
- package/package.json +23 -0
- package/results_types.js +18 -0
- package/search_types.js +661 -0
- package/services_types.js +384 -0
- package/situations_types.js +1268 -0
- package/spans_types.js +151 -0
- package/structure_types.js +2311 -0
- package/summarization_types.js +433 -0
- package/tokenization_fu.js +33 -0
- package/tokentagging_fu.js +241 -0
- package/twitter_types.js +1553 -0
- package/util.js +118 -0
- package/uuid_types.js +67 -0
@@ -0,0 +1,658 @@
|
|
1
|
+
//
|
2
|
+
// Autogenerated by Thrift Compiler (0.15.0)
|
3
|
+
//
|
4
|
+
// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
|
5
|
+
//
|
6
|
+
"use strict";
|
7
|
+
|
8
|
+
const thrift = require('thrift');
|
9
|
+
const Thrift = thrift.Thrift;
|
10
|
+
const Int64 = require('node-int64');
|
11
|
+
|
12
|
+
const structure_ttypes = require('./structure_types');
|
13
|
+
const metadata_ttypes = require('./metadata_types');
|
14
|
+
const uuid_ttypes = require('./uuid_types');
|
15
|
+
const linking_ttypes = require('./linking_types');
|
16
|
+
|
17
|
+
|
18
|
+
const ttypes = module.exports = {};
|
19
|
+
const Entity = module.exports.Entity = class {
|
20
|
+
constructor(args) {
|
21
|
+
this.uuid = null;
|
22
|
+
this.id = null;
|
23
|
+
this.mentionIdList = null;
|
24
|
+
this.rawMentionList = null;
|
25
|
+
this.type = null;
|
26
|
+
this.confidence = null;
|
27
|
+
this.canonicalName = null;
|
28
|
+
if (args) {
|
29
|
+
if (args.uuid !== undefined && args.uuid !== null) {
|
30
|
+
this.uuid = new uuid_ttypes.UUID(args.uuid);
|
31
|
+
} else {
|
32
|
+
throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field uuid is unset!');
|
33
|
+
}
|
34
|
+
if (args.id !== undefined && args.id !== null) {
|
35
|
+
this.id = args.id;
|
36
|
+
}
|
37
|
+
if (args.mentionIdList !== undefined && args.mentionIdList !== null) {
|
38
|
+
this.mentionIdList = Thrift.copyList(args.mentionIdList, [uuid_ttypes.UUID]);
|
39
|
+
} else {
|
40
|
+
throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field mentionIdList is unset!');
|
41
|
+
}
|
42
|
+
if (args.rawMentionList !== undefined && args.rawMentionList !== null) {
|
43
|
+
this.rawMentionList = Thrift.copyList(args.rawMentionList, [structure_ttypes.TokenRefSequence]);
|
44
|
+
}
|
45
|
+
if (args.type !== undefined && args.type !== null) {
|
46
|
+
this.type = args.type;
|
47
|
+
}
|
48
|
+
if (args.confidence !== undefined && args.confidence !== null) {
|
49
|
+
this.confidence = args.confidence;
|
50
|
+
}
|
51
|
+
if (args.canonicalName !== undefined && args.canonicalName !== null) {
|
52
|
+
this.canonicalName = args.canonicalName;
|
53
|
+
}
|
54
|
+
}
|
55
|
+
}
|
56
|
+
|
57
|
+
read (input) {
|
58
|
+
input.readStructBegin();
|
59
|
+
while (true) {
|
60
|
+
const ret = input.readFieldBegin();
|
61
|
+
const ftype = ret.ftype;
|
62
|
+
const fid = ret.fid;
|
63
|
+
if (ftype == Thrift.Type.STOP) {
|
64
|
+
break;
|
65
|
+
}
|
66
|
+
switch (fid) {
|
67
|
+
case 1:
|
68
|
+
if (ftype == Thrift.Type.STRUCT) {
|
69
|
+
this.uuid = new uuid_ttypes.UUID();
|
70
|
+
this.uuid.read(input);
|
71
|
+
} else {
|
72
|
+
input.skip(ftype);
|
73
|
+
}
|
74
|
+
break;
|
75
|
+
case 6:
|
76
|
+
if (ftype == Thrift.Type.STRING) {
|
77
|
+
this.id = input.readString();
|
78
|
+
} else {
|
79
|
+
input.skip(ftype);
|
80
|
+
}
|
81
|
+
break;
|
82
|
+
case 2:
|
83
|
+
if (ftype == Thrift.Type.LIST) {
|
84
|
+
this.mentionIdList = [];
|
85
|
+
const _rtmp31 = input.readListBegin();
|
86
|
+
const _size0 = _rtmp31.size || 0;
|
87
|
+
for (let _i2 = 0; _i2 < _size0; ++_i2) {
|
88
|
+
let elem3 = null;
|
89
|
+
elem3 = new uuid_ttypes.UUID();
|
90
|
+
elem3.read(input);
|
91
|
+
this.mentionIdList.push(elem3);
|
92
|
+
}
|
93
|
+
input.readListEnd();
|
94
|
+
} else {
|
95
|
+
input.skip(ftype);
|
96
|
+
}
|
97
|
+
break;
|
98
|
+
case 7:
|
99
|
+
if (ftype == Thrift.Type.LIST) {
|
100
|
+
this.rawMentionList = [];
|
101
|
+
const _rtmp35 = input.readListBegin();
|
102
|
+
const _size4 = _rtmp35.size || 0;
|
103
|
+
for (let _i6 = 0; _i6 < _size4; ++_i6) {
|
104
|
+
let elem7 = null;
|
105
|
+
elem7 = new structure_ttypes.TokenRefSequence();
|
106
|
+
elem7.read(input);
|
107
|
+
this.rawMentionList.push(elem7);
|
108
|
+
}
|
109
|
+
input.readListEnd();
|
110
|
+
} else {
|
111
|
+
input.skip(ftype);
|
112
|
+
}
|
113
|
+
break;
|
114
|
+
case 3:
|
115
|
+
if (ftype == Thrift.Type.STRING) {
|
116
|
+
this.type = input.readString();
|
117
|
+
} else {
|
118
|
+
input.skip(ftype);
|
119
|
+
}
|
120
|
+
break;
|
121
|
+
case 4:
|
122
|
+
if (ftype == Thrift.Type.DOUBLE) {
|
123
|
+
this.confidence = input.readDouble();
|
124
|
+
} else {
|
125
|
+
input.skip(ftype);
|
126
|
+
}
|
127
|
+
break;
|
128
|
+
case 5:
|
129
|
+
if (ftype == Thrift.Type.STRING) {
|
130
|
+
this.canonicalName = input.readString();
|
131
|
+
} else {
|
132
|
+
input.skip(ftype);
|
133
|
+
}
|
134
|
+
break;
|
135
|
+
default:
|
136
|
+
input.skip(ftype);
|
137
|
+
}
|
138
|
+
input.readFieldEnd();
|
139
|
+
}
|
140
|
+
input.readStructEnd();
|
141
|
+
return;
|
142
|
+
}
|
143
|
+
|
144
|
+
write (output) {
|
145
|
+
output.writeStructBegin('Entity');
|
146
|
+
if (this.uuid !== null && this.uuid !== undefined) {
|
147
|
+
output.writeFieldBegin('uuid', Thrift.Type.STRUCT, 1);
|
148
|
+
this.uuid.write(output);
|
149
|
+
output.writeFieldEnd();
|
150
|
+
}
|
151
|
+
if (this.id !== null && this.id !== undefined) {
|
152
|
+
output.writeFieldBegin('id', Thrift.Type.STRING, 6);
|
153
|
+
output.writeString(this.id);
|
154
|
+
output.writeFieldEnd();
|
155
|
+
}
|
156
|
+
if (this.mentionIdList !== null && this.mentionIdList !== undefined) {
|
157
|
+
output.writeFieldBegin('mentionIdList', Thrift.Type.LIST, 2);
|
158
|
+
output.writeListBegin(Thrift.Type.STRUCT, this.mentionIdList.length);
|
159
|
+
for (let iter8 in this.mentionIdList) {
|
160
|
+
if (this.mentionIdList.hasOwnProperty(iter8)) {
|
161
|
+
iter8 = this.mentionIdList[iter8];
|
162
|
+
iter8.write(output);
|
163
|
+
}
|
164
|
+
}
|
165
|
+
output.writeListEnd();
|
166
|
+
output.writeFieldEnd();
|
167
|
+
}
|
168
|
+
if (this.rawMentionList !== null && this.rawMentionList !== undefined) {
|
169
|
+
output.writeFieldBegin('rawMentionList', Thrift.Type.LIST, 7);
|
170
|
+
output.writeListBegin(Thrift.Type.STRUCT, this.rawMentionList.length);
|
171
|
+
for (let iter9 in this.rawMentionList) {
|
172
|
+
if (this.rawMentionList.hasOwnProperty(iter9)) {
|
173
|
+
iter9 = this.rawMentionList[iter9];
|
174
|
+
iter9.write(output);
|
175
|
+
}
|
176
|
+
}
|
177
|
+
output.writeListEnd();
|
178
|
+
output.writeFieldEnd();
|
179
|
+
}
|
180
|
+
if (this.type !== null && this.type !== undefined) {
|
181
|
+
output.writeFieldBegin('type', Thrift.Type.STRING, 3);
|
182
|
+
output.writeString(this.type);
|
183
|
+
output.writeFieldEnd();
|
184
|
+
}
|
185
|
+
if (this.confidence !== null && this.confidence !== undefined) {
|
186
|
+
output.writeFieldBegin('confidence', Thrift.Type.DOUBLE, 4);
|
187
|
+
output.writeDouble(this.confidence);
|
188
|
+
output.writeFieldEnd();
|
189
|
+
}
|
190
|
+
if (this.canonicalName !== null && this.canonicalName !== undefined) {
|
191
|
+
output.writeFieldBegin('canonicalName', Thrift.Type.STRING, 5);
|
192
|
+
output.writeString(this.canonicalName);
|
193
|
+
output.writeFieldEnd();
|
194
|
+
}
|
195
|
+
output.writeFieldStop();
|
196
|
+
output.writeStructEnd();
|
197
|
+
return;
|
198
|
+
}
|
199
|
+
|
200
|
+
};
|
201
|
+
const EntitySet = module.exports.EntitySet = class {
|
202
|
+
constructor(args) {
|
203
|
+
this.uuid = null;
|
204
|
+
this.metadata = null;
|
205
|
+
this.entityList = null;
|
206
|
+
this.linkingList = null;
|
207
|
+
this.mentionSetId = null;
|
208
|
+
if (args) {
|
209
|
+
if (args.uuid !== undefined && args.uuid !== null) {
|
210
|
+
this.uuid = new uuid_ttypes.UUID(args.uuid);
|
211
|
+
} else {
|
212
|
+
throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field uuid is unset!');
|
213
|
+
}
|
214
|
+
if (args.metadata !== undefined && args.metadata !== null) {
|
215
|
+
this.metadata = new metadata_ttypes.AnnotationMetadata(args.metadata);
|
216
|
+
} else {
|
217
|
+
throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field metadata is unset!');
|
218
|
+
}
|
219
|
+
if (args.entityList !== undefined && args.entityList !== null) {
|
220
|
+
this.entityList = Thrift.copyList(args.entityList, [ttypes.Entity]);
|
221
|
+
} else {
|
222
|
+
throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field entityList is unset!');
|
223
|
+
}
|
224
|
+
if (args.linkingList !== undefined && args.linkingList !== null) {
|
225
|
+
this.linkingList = Thrift.copyList(args.linkingList, [linking_ttypes.Linking]);
|
226
|
+
}
|
227
|
+
if (args.mentionSetId !== undefined && args.mentionSetId !== null) {
|
228
|
+
this.mentionSetId = new uuid_ttypes.UUID(args.mentionSetId);
|
229
|
+
}
|
230
|
+
}
|
231
|
+
}
|
232
|
+
|
233
|
+
read (input) {
|
234
|
+
input.readStructBegin();
|
235
|
+
while (true) {
|
236
|
+
const ret = input.readFieldBegin();
|
237
|
+
const ftype = ret.ftype;
|
238
|
+
const fid = ret.fid;
|
239
|
+
if (ftype == Thrift.Type.STOP) {
|
240
|
+
break;
|
241
|
+
}
|
242
|
+
switch (fid) {
|
243
|
+
case 1:
|
244
|
+
if (ftype == Thrift.Type.STRUCT) {
|
245
|
+
this.uuid = new uuid_ttypes.UUID();
|
246
|
+
this.uuid.read(input);
|
247
|
+
} else {
|
248
|
+
input.skip(ftype);
|
249
|
+
}
|
250
|
+
break;
|
251
|
+
case 2:
|
252
|
+
if (ftype == Thrift.Type.STRUCT) {
|
253
|
+
this.metadata = new metadata_ttypes.AnnotationMetadata();
|
254
|
+
this.metadata.read(input);
|
255
|
+
} else {
|
256
|
+
input.skip(ftype);
|
257
|
+
}
|
258
|
+
break;
|
259
|
+
case 3:
|
260
|
+
if (ftype == Thrift.Type.LIST) {
|
261
|
+
this.entityList = [];
|
262
|
+
const _rtmp311 = input.readListBegin();
|
263
|
+
const _size10 = _rtmp311.size || 0;
|
264
|
+
for (let _i12 = 0; _i12 < _size10; ++_i12) {
|
265
|
+
let elem13 = null;
|
266
|
+
elem13 = new ttypes.Entity();
|
267
|
+
elem13.read(input);
|
268
|
+
this.entityList.push(elem13);
|
269
|
+
}
|
270
|
+
input.readListEnd();
|
271
|
+
} else {
|
272
|
+
input.skip(ftype);
|
273
|
+
}
|
274
|
+
break;
|
275
|
+
case 4:
|
276
|
+
if (ftype == Thrift.Type.LIST) {
|
277
|
+
this.linkingList = [];
|
278
|
+
const _rtmp315 = input.readListBegin();
|
279
|
+
const _size14 = _rtmp315.size || 0;
|
280
|
+
for (let _i16 = 0; _i16 < _size14; ++_i16) {
|
281
|
+
let elem17 = null;
|
282
|
+
elem17 = new linking_ttypes.Linking();
|
283
|
+
elem17.read(input);
|
284
|
+
this.linkingList.push(elem17);
|
285
|
+
}
|
286
|
+
input.readListEnd();
|
287
|
+
} else {
|
288
|
+
input.skip(ftype);
|
289
|
+
}
|
290
|
+
break;
|
291
|
+
case 5:
|
292
|
+
if (ftype == Thrift.Type.STRUCT) {
|
293
|
+
this.mentionSetId = new uuid_ttypes.UUID();
|
294
|
+
this.mentionSetId.read(input);
|
295
|
+
} else {
|
296
|
+
input.skip(ftype);
|
297
|
+
}
|
298
|
+
break;
|
299
|
+
default:
|
300
|
+
input.skip(ftype);
|
301
|
+
}
|
302
|
+
input.readFieldEnd();
|
303
|
+
}
|
304
|
+
input.readStructEnd();
|
305
|
+
return;
|
306
|
+
}
|
307
|
+
|
308
|
+
write (output) {
|
309
|
+
output.writeStructBegin('EntitySet');
|
310
|
+
if (this.uuid !== null && this.uuid !== undefined) {
|
311
|
+
output.writeFieldBegin('uuid', Thrift.Type.STRUCT, 1);
|
312
|
+
this.uuid.write(output);
|
313
|
+
output.writeFieldEnd();
|
314
|
+
}
|
315
|
+
if (this.metadata !== null && this.metadata !== undefined) {
|
316
|
+
output.writeFieldBegin('metadata', Thrift.Type.STRUCT, 2);
|
317
|
+
this.metadata.write(output);
|
318
|
+
output.writeFieldEnd();
|
319
|
+
}
|
320
|
+
if (this.entityList !== null && this.entityList !== undefined) {
|
321
|
+
output.writeFieldBegin('entityList', Thrift.Type.LIST, 3);
|
322
|
+
output.writeListBegin(Thrift.Type.STRUCT, this.entityList.length);
|
323
|
+
for (let iter18 in this.entityList) {
|
324
|
+
if (this.entityList.hasOwnProperty(iter18)) {
|
325
|
+
iter18 = this.entityList[iter18];
|
326
|
+
iter18.write(output);
|
327
|
+
}
|
328
|
+
}
|
329
|
+
output.writeListEnd();
|
330
|
+
output.writeFieldEnd();
|
331
|
+
}
|
332
|
+
if (this.linkingList !== null && this.linkingList !== undefined) {
|
333
|
+
output.writeFieldBegin('linkingList', Thrift.Type.LIST, 4);
|
334
|
+
output.writeListBegin(Thrift.Type.STRUCT, this.linkingList.length);
|
335
|
+
for (let iter19 in this.linkingList) {
|
336
|
+
if (this.linkingList.hasOwnProperty(iter19)) {
|
337
|
+
iter19 = this.linkingList[iter19];
|
338
|
+
iter19.write(output);
|
339
|
+
}
|
340
|
+
}
|
341
|
+
output.writeListEnd();
|
342
|
+
output.writeFieldEnd();
|
343
|
+
}
|
344
|
+
if (this.mentionSetId !== null && this.mentionSetId !== undefined) {
|
345
|
+
output.writeFieldBegin('mentionSetId', Thrift.Type.STRUCT, 5);
|
346
|
+
this.mentionSetId.write(output);
|
347
|
+
output.writeFieldEnd();
|
348
|
+
}
|
349
|
+
output.writeFieldStop();
|
350
|
+
output.writeStructEnd();
|
351
|
+
return;
|
352
|
+
}
|
353
|
+
|
354
|
+
};
|
355
|
+
const EntityMention = module.exports.EntityMention = class {
|
356
|
+
constructor(args) {
|
357
|
+
this.uuid = null;
|
358
|
+
this.tokens = null;
|
359
|
+
this.entityType = null;
|
360
|
+
this.phraseType = null;
|
361
|
+
this.confidence = null;
|
362
|
+
this.text = null;
|
363
|
+
this.childMentionIdList = null;
|
364
|
+
if (args) {
|
365
|
+
if (args.uuid !== undefined && args.uuid !== null) {
|
366
|
+
this.uuid = new uuid_ttypes.UUID(args.uuid);
|
367
|
+
} else {
|
368
|
+
throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field uuid is unset!');
|
369
|
+
}
|
370
|
+
if (args.tokens !== undefined && args.tokens !== null) {
|
371
|
+
this.tokens = new structure_ttypes.TokenRefSequence(args.tokens);
|
372
|
+
} else {
|
373
|
+
throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field tokens is unset!');
|
374
|
+
}
|
375
|
+
if (args.entityType !== undefined && args.entityType !== null) {
|
376
|
+
this.entityType = args.entityType;
|
377
|
+
}
|
378
|
+
if (args.phraseType !== undefined && args.phraseType !== null) {
|
379
|
+
this.phraseType = args.phraseType;
|
380
|
+
}
|
381
|
+
if (args.confidence !== undefined && args.confidence !== null) {
|
382
|
+
this.confidence = args.confidence;
|
383
|
+
}
|
384
|
+
if (args.text !== undefined && args.text !== null) {
|
385
|
+
this.text = args.text;
|
386
|
+
}
|
387
|
+
if (args.childMentionIdList !== undefined && args.childMentionIdList !== null) {
|
388
|
+
this.childMentionIdList = Thrift.copyList(args.childMentionIdList, [uuid_ttypes.UUID]);
|
389
|
+
}
|
390
|
+
}
|
391
|
+
}
|
392
|
+
|
393
|
+
read (input) {
|
394
|
+
input.readStructBegin();
|
395
|
+
while (true) {
|
396
|
+
const ret = input.readFieldBegin();
|
397
|
+
const ftype = ret.ftype;
|
398
|
+
const fid = ret.fid;
|
399
|
+
if (ftype == Thrift.Type.STOP) {
|
400
|
+
break;
|
401
|
+
}
|
402
|
+
switch (fid) {
|
403
|
+
case 1:
|
404
|
+
if (ftype == Thrift.Type.STRUCT) {
|
405
|
+
this.uuid = new uuid_ttypes.UUID();
|
406
|
+
this.uuid.read(input);
|
407
|
+
} else {
|
408
|
+
input.skip(ftype);
|
409
|
+
}
|
410
|
+
break;
|
411
|
+
case 2:
|
412
|
+
if (ftype == Thrift.Type.STRUCT) {
|
413
|
+
this.tokens = new structure_ttypes.TokenRefSequence();
|
414
|
+
this.tokens.read(input);
|
415
|
+
} else {
|
416
|
+
input.skip(ftype);
|
417
|
+
}
|
418
|
+
break;
|
419
|
+
case 3:
|
420
|
+
if (ftype == Thrift.Type.STRING) {
|
421
|
+
this.entityType = input.readString();
|
422
|
+
} else {
|
423
|
+
input.skip(ftype);
|
424
|
+
}
|
425
|
+
break;
|
426
|
+
case 4:
|
427
|
+
if (ftype == Thrift.Type.STRING) {
|
428
|
+
this.phraseType = input.readString();
|
429
|
+
} else {
|
430
|
+
input.skip(ftype);
|
431
|
+
}
|
432
|
+
break;
|
433
|
+
case 5:
|
434
|
+
if (ftype == Thrift.Type.DOUBLE) {
|
435
|
+
this.confidence = input.readDouble();
|
436
|
+
} else {
|
437
|
+
input.skip(ftype);
|
438
|
+
}
|
439
|
+
break;
|
440
|
+
case 6:
|
441
|
+
if (ftype == Thrift.Type.STRING) {
|
442
|
+
this.text = input.readString();
|
443
|
+
} else {
|
444
|
+
input.skip(ftype);
|
445
|
+
}
|
446
|
+
break;
|
447
|
+
case 7:
|
448
|
+
if (ftype == Thrift.Type.LIST) {
|
449
|
+
this.childMentionIdList = [];
|
450
|
+
const _rtmp321 = input.readListBegin();
|
451
|
+
const _size20 = _rtmp321.size || 0;
|
452
|
+
for (let _i22 = 0; _i22 < _size20; ++_i22) {
|
453
|
+
let elem23 = null;
|
454
|
+
elem23 = new uuid_ttypes.UUID();
|
455
|
+
elem23.read(input);
|
456
|
+
this.childMentionIdList.push(elem23);
|
457
|
+
}
|
458
|
+
input.readListEnd();
|
459
|
+
} else {
|
460
|
+
input.skip(ftype);
|
461
|
+
}
|
462
|
+
break;
|
463
|
+
default:
|
464
|
+
input.skip(ftype);
|
465
|
+
}
|
466
|
+
input.readFieldEnd();
|
467
|
+
}
|
468
|
+
input.readStructEnd();
|
469
|
+
return;
|
470
|
+
}
|
471
|
+
|
472
|
+
write (output) {
|
473
|
+
output.writeStructBegin('EntityMention');
|
474
|
+
if (this.uuid !== null && this.uuid !== undefined) {
|
475
|
+
output.writeFieldBegin('uuid', Thrift.Type.STRUCT, 1);
|
476
|
+
this.uuid.write(output);
|
477
|
+
output.writeFieldEnd();
|
478
|
+
}
|
479
|
+
if (this.tokens !== null && this.tokens !== undefined) {
|
480
|
+
output.writeFieldBegin('tokens', Thrift.Type.STRUCT, 2);
|
481
|
+
this.tokens.write(output);
|
482
|
+
output.writeFieldEnd();
|
483
|
+
}
|
484
|
+
if (this.entityType !== null && this.entityType !== undefined) {
|
485
|
+
output.writeFieldBegin('entityType', Thrift.Type.STRING, 3);
|
486
|
+
output.writeString(this.entityType);
|
487
|
+
output.writeFieldEnd();
|
488
|
+
}
|
489
|
+
if (this.phraseType !== null && this.phraseType !== undefined) {
|
490
|
+
output.writeFieldBegin('phraseType', Thrift.Type.STRING, 4);
|
491
|
+
output.writeString(this.phraseType);
|
492
|
+
output.writeFieldEnd();
|
493
|
+
}
|
494
|
+
if (this.confidence !== null && this.confidence !== undefined) {
|
495
|
+
output.writeFieldBegin('confidence', Thrift.Type.DOUBLE, 5);
|
496
|
+
output.writeDouble(this.confidence);
|
497
|
+
output.writeFieldEnd();
|
498
|
+
}
|
499
|
+
if (this.text !== null && this.text !== undefined) {
|
500
|
+
output.writeFieldBegin('text', Thrift.Type.STRING, 6);
|
501
|
+
output.writeString(this.text);
|
502
|
+
output.writeFieldEnd();
|
503
|
+
}
|
504
|
+
if (this.childMentionIdList !== null && this.childMentionIdList !== undefined) {
|
505
|
+
output.writeFieldBegin('childMentionIdList', Thrift.Type.LIST, 7);
|
506
|
+
output.writeListBegin(Thrift.Type.STRUCT, this.childMentionIdList.length);
|
507
|
+
for (let iter24 in this.childMentionIdList) {
|
508
|
+
if (this.childMentionIdList.hasOwnProperty(iter24)) {
|
509
|
+
iter24 = this.childMentionIdList[iter24];
|
510
|
+
iter24.write(output);
|
511
|
+
}
|
512
|
+
}
|
513
|
+
output.writeListEnd();
|
514
|
+
output.writeFieldEnd();
|
515
|
+
}
|
516
|
+
output.writeFieldStop();
|
517
|
+
output.writeStructEnd();
|
518
|
+
return;
|
519
|
+
}
|
520
|
+
|
521
|
+
};
|
522
|
+
const EntityMentionSet = module.exports.EntityMentionSet = class {
|
523
|
+
constructor(args) {
|
524
|
+
this.uuid = null;
|
525
|
+
this.metadata = null;
|
526
|
+
this.mentionList = null;
|
527
|
+
this.linkingList = null;
|
528
|
+
if (args) {
|
529
|
+
if (args.uuid !== undefined && args.uuid !== null) {
|
530
|
+
this.uuid = new uuid_ttypes.UUID(args.uuid);
|
531
|
+
} else {
|
532
|
+
throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field uuid is unset!');
|
533
|
+
}
|
534
|
+
if (args.metadata !== undefined && args.metadata !== null) {
|
535
|
+
this.metadata = new metadata_ttypes.AnnotationMetadata(args.metadata);
|
536
|
+
} else {
|
537
|
+
throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field metadata is unset!');
|
538
|
+
}
|
539
|
+
if (args.mentionList !== undefined && args.mentionList !== null) {
|
540
|
+
this.mentionList = Thrift.copyList(args.mentionList, [ttypes.EntityMention]);
|
541
|
+
} else {
|
542
|
+
throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field mentionList is unset!');
|
543
|
+
}
|
544
|
+
if (args.linkingList !== undefined && args.linkingList !== null) {
|
545
|
+
this.linkingList = Thrift.copyList(args.linkingList, [linking_ttypes.Linking]);
|
546
|
+
}
|
547
|
+
}
|
548
|
+
}
|
549
|
+
|
550
|
+
read (input) {
|
551
|
+
input.readStructBegin();
|
552
|
+
while (true) {
|
553
|
+
const ret = input.readFieldBegin();
|
554
|
+
const ftype = ret.ftype;
|
555
|
+
const fid = ret.fid;
|
556
|
+
if (ftype == Thrift.Type.STOP) {
|
557
|
+
break;
|
558
|
+
}
|
559
|
+
switch (fid) {
|
560
|
+
case 1:
|
561
|
+
if (ftype == Thrift.Type.STRUCT) {
|
562
|
+
this.uuid = new uuid_ttypes.UUID();
|
563
|
+
this.uuid.read(input);
|
564
|
+
} else {
|
565
|
+
input.skip(ftype);
|
566
|
+
}
|
567
|
+
break;
|
568
|
+
case 2:
|
569
|
+
if (ftype == Thrift.Type.STRUCT) {
|
570
|
+
this.metadata = new metadata_ttypes.AnnotationMetadata();
|
571
|
+
this.metadata.read(input);
|
572
|
+
} else {
|
573
|
+
input.skip(ftype);
|
574
|
+
}
|
575
|
+
break;
|
576
|
+
case 3:
|
577
|
+
if (ftype == Thrift.Type.LIST) {
|
578
|
+
this.mentionList = [];
|
579
|
+
const _rtmp326 = input.readListBegin();
|
580
|
+
const _size25 = _rtmp326.size || 0;
|
581
|
+
for (let _i27 = 0; _i27 < _size25; ++_i27) {
|
582
|
+
let elem28 = null;
|
583
|
+
elem28 = new ttypes.EntityMention();
|
584
|
+
elem28.read(input);
|
585
|
+
this.mentionList.push(elem28);
|
586
|
+
}
|
587
|
+
input.readListEnd();
|
588
|
+
} else {
|
589
|
+
input.skip(ftype);
|
590
|
+
}
|
591
|
+
break;
|
592
|
+
case 4:
|
593
|
+
if (ftype == Thrift.Type.LIST) {
|
594
|
+
this.linkingList = [];
|
595
|
+
const _rtmp330 = input.readListBegin();
|
596
|
+
const _size29 = _rtmp330.size || 0;
|
597
|
+
for (let _i31 = 0; _i31 < _size29; ++_i31) {
|
598
|
+
let elem32 = null;
|
599
|
+
elem32 = new linking_ttypes.Linking();
|
600
|
+
elem32.read(input);
|
601
|
+
this.linkingList.push(elem32);
|
602
|
+
}
|
603
|
+
input.readListEnd();
|
604
|
+
} else {
|
605
|
+
input.skip(ftype);
|
606
|
+
}
|
607
|
+
break;
|
608
|
+
default:
|
609
|
+
input.skip(ftype);
|
610
|
+
}
|
611
|
+
input.readFieldEnd();
|
612
|
+
}
|
613
|
+
input.readStructEnd();
|
614
|
+
return;
|
615
|
+
}
|
616
|
+
|
617
|
+
write (output) {
|
618
|
+
output.writeStructBegin('EntityMentionSet');
|
619
|
+
if (this.uuid !== null && this.uuid !== undefined) {
|
620
|
+
output.writeFieldBegin('uuid', Thrift.Type.STRUCT, 1);
|
621
|
+
this.uuid.write(output);
|
622
|
+
output.writeFieldEnd();
|
623
|
+
}
|
624
|
+
if (this.metadata !== null && this.metadata !== undefined) {
|
625
|
+
output.writeFieldBegin('metadata', Thrift.Type.STRUCT, 2);
|
626
|
+
this.metadata.write(output);
|
627
|
+
output.writeFieldEnd();
|
628
|
+
}
|
629
|
+
if (this.mentionList !== null && this.mentionList !== undefined) {
|
630
|
+
output.writeFieldBegin('mentionList', Thrift.Type.LIST, 3);
|
631
|
+
output.writeListBegin(Thrift.Type.STRUCT, this.mentionList.length);
|
632
|
+
for (let iter33 in this.mentionList) {
|
633
|
+
if (this.mentionList.hasOwnProperty(iter33)) {
|
634
|
+
iter33 = this.mentionList[iter33];
|
635
|
+
iter33.write(output);
|
636
|
+
}
|
637
|
+
}
|
638
|
+
output.writeListEnd();
|
639
|
+
output.writeFieldEnd();
|
640
|
+
}
|
641
|
+
if (this.linkingList !== null && this.linkingList !== undefined) {
|
642
|
+
output.writeFieldBegin('linkingList', Thrift.Type.LIST, 4);
|
643
|
+
output.writeListBegin(Thrift.Type.STRUCT, this.linkingList.length);
|
644
|
+
for (let iter34 in this.linkingList) {
|
645
|
+
if (this.linkingList.hasOwnProperty(iter34)) {
|
646
|
+
iter34 = this.linkingList[iter34];
|
647
|
+
iter34.write(output);
|
648
|
+
}
|
649
|
+
}
|
650
|
+
output.writeListEnd();
|
651
|
+
output.writeFieldEnd();
|
652
|
+
}
|
653
|
+
output.writeFieldStop();
|
654
|
+
output.writeStructEnd();
|
655
|
+
return;
|
656
|
+
}
|
657
|
+
|
658
|
+
};
|