@ccmaymay/concrete 4.15.0 → 4.15.1

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.
Files changed (42) hide show
  1. package/ActiveLearnerClientService.js +249 -249
  2. package/ActiveLearnerServerService.js +642 -642
  3. package/AnnotateCommunicationService.js +696 -696
  4. package/AnnotateWithContextService.js +298 -298
  5. package/FeedbackService.js +750 -750
  6. package/FetchCommunicationService.js +709 -709
  7. package/README.md +125 -0
  8. package/ResultsServerService.js +2138 -2138
  9. package/SearchProxyService.js +962 -962
  10. package/SearchService.js +685 -685
  11. package/Service.js +373 -373
  12. package/StoreCommunicationService.js +255 -255
  13. package/SummarizationService.js +479 -479
  14. package/access_types.js +168 -168
  15. package/annotate_types.js +26 -26
  16. package/audio_types.js +110 -110
  17. package/cluster_types.js +398 -398
  18. package/communication_fu.js +432 -432
  19. package/communication_types.js +845 -845
  20. package/concrete.js +64 -64
  21. package/context_types.js +65 -65
  22. package/email_types.js +477 -477
  23. package/entities_types.js +658 -658
  24. package/ex_types.js +82 -82
  25. package/language_types.js +123 -123
  26. package/learn_types.js +207 -207
  27. package/linking_types.js +286 -286
  28. package/metadata_types.js +926 -926
  29. package/nitf_types.js +1005 -1005
  30. package/package.json +26 -5
  31. package/results_types.js +18 -18
  32. package/search_types.js +661 -661
  33. package/services_types.js +384 -384
  34. package/situations_types.js +1268 -1268
  35. package/spans_types.js +151 -151
  36. package/structure_types.js +2311 -2311
  37. package/summarization_types.js +433 -433
  38. package/tokenization_fu.js +33 -33
  39. package/tokentagging_fu.js +241 -241
  40. package/twitter_types.js +1553 -1553
  41. package/util.js +117 -117
  42. package/uuid_types.js +67 -67
@@ -1,433 +1,433 @@
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 communication_ttypes = require('./communication_types');
13
- const services_ttypes = require('./services_types');
14
- const structure_ttypes = require('./structure_types');
15
- const uuid_ttypes = require('./uuid_types');
16
-
17
-
18
- const ttypes = module.exports = {};
19
- ttypes.SummarySourceType = {
20
- 'DOCUMENT' : 0,
21
- 'TOKENIZATION' : 1,
22
- 'ENTITY' : 2
23
- };
24
- const SummarizationRequest = module.exports.SummarizationRequest = class {
25
- constructor(args) {
26
- this.queryTerms = null;
27
- this.maximumTokens = null;
28
- this.maximumCharacters = null;
29
- this.sourceType = null;
30
- this.sourceIds = null;
31
- this.sourceCommunication = null;
32
- if (args) {
33
- if (args.queryTerms !== undefined && args.queryTerms !== null) {
34
- this.queryTerms = Thrift.copyList(args.queryTerms, [null]);
35
- }
36
- if (args.maximumTokens !== undefined && args.maximumTokens !== null) {
37
- this.maximumTokens = args.maximumTokens;
38
- }
39
- if (args.maximumCharacters !== undefined && args.maximumCharacters !== null) {
40
- this.maximumCharacters = args.maximumCharacters;
41
- }
42
- if (args.sourceType !== undefined && args.sourceType !== null) {
43
- this.sourceType = args.sourceType;
44
- }
45
- if (args.sourceIds !== undefined && args.sourceIds !== null) {
46
- this.sourceIds = Thrift.copyList(args.sourceIds, [uuid_ttypes.UUID]);
47
- }
48
- if (args.sourceCommunication !== undefined && args.sourceCommunication !== null) {
49
- this.sourceCommunication = new communication_ttypes.Communication(args.sourceCommunication);
50
- }
51
- }
52
- }
53
-
54
- read (input) {
55
- input.readStructBegin();
56
- while (true) {
57
- const ret = input.readFieldBegin();
58
- const ftype = ret.ftype;
59
- const fid = ret.fid;
60
- if (ftype == Thrift.Type.STOP) {
61
- break;
62
- }
63
- switch (fid) {
64
- case 1:
65
- if (ftype == Thrift.Type.LIST) {
66
- this.queryTerms = [];
67
- const _rtmp31 = input.readListBegin();
68
- const _size0 = _rtmp31.size || 0;
69
- for (let _i2 = 0; _i2 < _size0; ++_i2) {
70
- let elem3 = null;
71
- elem3 = input.readString();
72
- this.queryTerms.push(elem3);
73
- }
74
- input.readListEnd();
75
- } else {
76
- input.skip(ftype);
77
- }
78
- break;
79
- case 2:
80
- if (ftype == Thrift.Type.I32) {
81
- this.maximumTokens = input.readI32();
82
- } else {
83
- input.skip(ftype);
84
- }
85
- break;
86
- case 3:
87
- if (ftype == Thrift.Type.I32) {
88
- this.maximumCharacters = input.readI32();
89
- } else {
90
- input.skip(ftype);
91
- }
92
- break;
93
- case 4:
94
- if (ftype == Thrift.Type.I32) {
95
- this.sourceType = input.readI32();
96
- } else {
97
- input.skip(ftype);
98
- }
99
- break;
100
- case 5:
101
- if (ftype == Thrift.Type.LIST) {
102
- this.sourceIds = [];
103
- const _rtmp35 = input.readListBegin();
104
- const _size4 = _rtmp35.size || 0;
105
- for (let _i6 = 0; _i6 < _size4; ++_i6) {
106
- let elem7 = null;
107
- elem7 = new uuid_ttypes.UUID();
108
- elem7.read(input);
109
- this.sourceIds.push(elem7);
110
- }
111
- input.readListEnd();
112
- } else {
113
- input.skip(ftype);
114
- }
115
- break;
116
- case 6:
117
- if (ftype == Thrift.Type.STRUCT) {
118
- this.sourceCommunication = new communication_ttypes.Communication();
119
- this.sourceCommunication.read(input);
120
- } else {
121
- input.skip(ftype);
122
- }
123
- break;
124
- default:
125
- input.skip(ftype);
126
- }
127
- input.readFieldEnd();
128
- }
129
- input.readStructEnd();
130
- return;
131
- }
132
-
133
- write (output) {
134
- output.writeStructBegin('SummarizationRequest');
135
- if (this.queryTerms !== null && this.queryTerms !== undefined) {
136
- output.writeFieldBegin('queryTerms', Thrift.Type.LIST, 1);
137
- output.writeListBegin(Thrift.Type.STRING, this.queryTerms.length);
138
- for (let iter8 in this.queryTerms) {
139
- if (this.queryTerms.hasOwnProperty(iter8)) {
140
- iter8 = this.queryTerms[iter8];
141
- output.writeString(iter8);
142
- }
143
- }
144
- output.writeListEnd();
145
- output.writeFieldEnd();
146
- }
147
- if (this.maximumTokens !== null && this.maximumTokens !== undefined) {
148
- output.writeFieldBegin('maximumTokens', Thrift.Type.I32, 2);
149
- output.writeI32(this.maximumTokens);
150
- output.writeFieldEnd();
151
- }
152
- if (this.maximumCharacters !== null && this.maximumCharacters !== undefined) {
153
- output.writeFieldBegin('maximumCharacters', Thrift.Type.I32, 3);
154
- output.writeI32(this.maximumCharacters);
155
- output.writeFieldEnd();
156
- }
157
- if (this.sourceType !== null && this.sourceType !== undefined) {
158
- output.writeFieldBegin('sourceType', Thrift.Type.I32, 4);
159
- output.writeI32(this.sourceType);
160
- output.writeFieldEnd();
161
- }
162
- if (this.sourceIds !== null && this.sourceIds !== undefined) {
163
- output.writeFieldBegin('sourceIds', Thrift.Type.LIST, 5);
164
- output.writeListBegin(Thrift.Type.STRUCT, this.sourceIds.length);
165
- for (let iter9 in this.sourceIds) {
166
- if (this.sourceIds.hasOwnProperty(iter9)) {
167
- iter9 = this.sourceIds[iter9];
168
- iter9.write(output);
169
- }
170
- }
171
- output.writeListEnd();
172
- output.writeFieldEnd();
173
- }
174
- if (this.sourceCommunication !== null && this.sourceCommunication !== undefined) {
175
- output.writeFieldBegin('sourceCommunication', Thrift.Type.STRUCT, 6);
176
- this.sourceCommunication.write(output);
177
- output.writeFieldEnd();
178
- }
179
- output.writeFieldStop();
180
- output.writeStructEnd();
181
- return;
182
- }
183
-
184
- };
185
- const SummaryConcept = module.exports.SummaryConcept = class {
186
- constructor(args) {
187
- this.tokens = null;
188
- this.concept = null;
189
- this.confidence = 1;
190
- this.utility = 1;
191
- if (args) {
192
- if (args.tokens !== undefined && args.tokens !== null) {
193
- this.tokens = new structure_ttypes.TokenRefSequence(args.tokens);
194
- }
195
- if (args.concept !== undefined && args.concept !== null) {
196
- this.concept = args.concept;
197
- }
198
- if (args.confidence !== undefined && args.confidence !== null) {
199
- this.confidence = args.confidence;
200
- }
201
- if (args.utility !== undefined && args.utility !== null) {
202
- this.utility = args.utility;
203
- }
204
- }
205
- }
206
-
207
- read (input) {
208
- input.readStructBegin();
209
- while (true) {
210
- const ret = input.readFieldBegin();
211
- const ftype = ret.ftype;
212
- const fid = ret.fid;
213
- if (ftype == Thrift.Type.STOP) {
214
- break;
215
- }
216
- switch (fid) {
217
- case 1:
218
- if (ftype == Thrift.Type.STRUCT) {
219
- this.tokens = new structure_ttypes.TokenRefSequence();
220
- this.tokens.read(input);
221
- } else {
222
- input.skip(ftype);
223
- }
224
- break;
225
- case 2:
226
- if (ftype == Thrift.Type.STRING) {
227
- this.concept = input.readString();
228
- } else {
229
- input.skip(ftype);
230
- }
231
- break;
232
- case 3:
233
- if (ftype == Thrift.Type.DOUBLE) {
234
- this.confidence = input.readDouble();
235
- } else {
236
- input.skip(ftype);
237
- }
238
- break;
239
- case 4:
240
- if (ftype == Thrift.Type.DOUBLE) {
241
- this.utility = input.readDouble();
242
- } else {
243
- input.skip(ftype);
244
- }
245
- break;
246
- default:
247
- input.skip(ftype);
248
- }
249
- input.readFieldEnd();
250
- }
251
- input.readStructEnd();
252
- return;
253
- }
254
-
255
- write (output) {
256
- output.writeStructBegin('SummaryConcept');
257
- if (this.tokens !== null && this.tokens !== undefined) {
258
- output.writeFieldBegin('tokens', Thrift.Type.STRUCT, 1);
259
- this.tokens.write(output);
260
- output.writeFieldEnd();
261
- }
262
- if (this.concept !== null && this.concept !== undefined) {
263
- output.writeFieldBegin('concept', Thrift.Type.STRING, 2);
264
- output.writeString(this.concept);
265
- output.writeFieldEnd();
266
- }
267
- if (this.confidence !== null && this.confidence !== undefined) {
268
- output.writeFieldBegin('confidence', Thrift.Type.DOUBLE, 3);
269
- output.writeDouble(this.confidence);
270
- output.writeFieldEnd();
271
- }
272
- if (this.utility !== null && this.utility !== undefined) {
273
- output.writeFieldBegin('utility', Thrift.Type.DOUBLE, 4);
274
- output.writeDouble(this.utility);
275
- output.writeFieldEnd();
276
- }
277
- output.writeFieldStop();
278
- output.writeStructEnd();
279
- return;
280
- }
281
-
282
- };
283
- const Summary = module.exports.Summary = class {
284
- constructor(args) {
285
- this.summaryCommunication = null;
286
- this.concepts = null;
287
- if (args) {
288
- if (args.summaryCommunication !== undefined && args.summaryCommunication !== null) {
289
- this.summaryCommunication = new communication_ttypes.Communication(args.summaryCommunication);
290
- }
291
- if (args.concepts !== undefined && args.concepts !== null) {
292
- this.concepts = Thrift.copyList(args.concepts, [ttypes.SummaryConcept]);
293
- }
294
- }
295
- }
296
-
297
- read (input) {
298
- input.readStructBegin();
299
- while (true) {
300
- const ret = input.readFieldBegin();
301
- const ftype = ret.ftype;
302
- const fid = ret.fid;
303
- if (ftype == Thrift.Type.STOP) {
304
- break;
305
- }
306
- switch (fid) {
307
- case 1:
308
- if (ftype == Thrift.Type.STRUCT) {
309
- this.summaryCommunication = new communication_ttypes.Communication();
310
- this.summaryCommunication.read(input);
311
- } else {
312
- input.skip(ftype);
313
- }
314
- break;
315
- case 2:
316
- if (ftype == Thrift.Type.LIST) {
317
- this.concepts = [];
318
- const _rtmp311 = input.readListBegin();
319
- const _size10 = _rtmp311.size || 0;
320
- for (let _i12 = 0; _i12 < _size10; ++_i12) {
321
- let elem13 = null;
322
- elem13 = new ttypes.SummaryConcept();
323
- elem13.read(input);
324
- this.concepts.push(elem13);
325
- }
326
- input.readListEnd();
327
- } else {
328
- input.skip(ftype);
329
- }
330
- break;
331
- default:
332
- input.skip(ftype);
333
- }
334
- input.readFieldEnd();
335
- }
336
- input.readStructEnd();
337
- return;
338
- }
339
-
340
- write (output) {
341
- output.writeStructBegin('Summary');
342
- if (this.summaryCommunication !== null && this.summaryCommunication !== undefined) {
343
- output.writeFieldBegin('summaryCommunication', Thrift.Type.STRUCT, 1);
344
- this.summaryCommunication.write(output);
345
- output.writeFieldEnd();
346
- }
347
- if (this.concepts !== null && this.concepts !== undefined) {
348
- output.writeFieldBegin('concepts', Thrift.Type.LIST, 2);
349
- output.writeListBegin(Thrift.Type.STRUCT, this.concepts.length);
350
- for (let iter14 in this.concepts) {
351
- if (this.concepts.hasOwnProperty(iter14)) {
352
- iter14 = this.concepts[iter14];
353
- iter14.write(output);
354
- }
355
- }
356
- output.writeListEnd();
357
- output.writeFieldEnd();
358
- }
359
- output.writeFieldStop();
360
- output.writeStructEnd();
361
- return;
362
- }
363
-
364
- };
365
- const SummarizationCapability = module.exports.SummarizationCapability = class {
366
- constructor(args) {
367
- this.type = null;
368
- this.lang = null;
369
- if (args) {
370
- if (args.type !== undefined && args.type !== null) {
371
- this.type = args.type;
372
- } else {
373
- throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field type is unset!');
374
- }
375
- if (args.lang !== undefined && args.lang !== null) {
376
- this.lang = args.lang;
377
- } else {
378
- throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field lang is unset!');
379
- }
380
- }
381
- }
382
-
383
- read (input) {
384
- input.readStructBegin();
385
- while (true) {
386
- const ret = input.readFieldBegin();
387
- const ftype = ret.ftype;
388
- const fid = ret.fid;
389
- if (ftype == Thrift.Type.STOP) {
390
- break;
391
- }
392
- switch (fid) {
393
- case 1:
394
- if (ftype == Thrift.Type.I32) {
395
- this.type = input.readI32();
396
- } else {
397
- input.skip(ftype);
398
- }
399
- break;
400
- case 2:
401
- if (ftype == Thrift.Type.STRING) {
402
- this.lang = input.readString();
403
- } else {
404
- input.skip(ftype);
405
- }
406
- break;
407
- default:
408
- input.skip(ftype);
409
- }
410
- input.readFieldEnd();
411
- }
412
- input.readStructEnd();
413
- return;
414
- }
415
-
416
- write (output) {
417
- output.writeStructBegin('SummarizationCapability');
418
- if (this.type !== null && this.type !== undefined) {
419
- output.writeFieldBegin('type', Thrift.Type.I32, 1);
420
- output.writeI32(this.type);
421
- output.writeFieldEnd();
422
- }
423
- if (this.lang !== null && this.lang !== undefined) {
424
- output.writeFieldBegin('lang', Thrift.Type.STRING, 2);
425
- output.writeString(this.lang);
426
- output.writeFieldEnd();
427
- }
428
- output.writeFieldStop();
429
- output.writeStructEnd();
430
- return;
431
- }
432
-
433
- };
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 communication_ttypes = require('./communication_types');
13
+ const services_ttypes = require('./services_types');
14
+ const structure_ttypes = require('./structure_types');
15
+ const uuid_ttypes = require('./uuid_types');
16
+
17
+
18
+ const ttypes = module.exports = {};
19
+ ttypes.SummarySourceType = {
20
+ 'DOCUMENT' : 0,
21
+ 'TOKENIZATION' : 1,
22
+ 'ENTITY' : 2
23
+ };
24
+ const SummarizationRequest = module.exports.SummarizationRequest = class {
25
+ constructor(args) {
26
+ this.queryTerms = null;
27
+ this.maximumTokens = null;
28
+ this.maximumCharacters = null;
29
+ this.sourceType = null;
30
+ this.sourceIds = null;
31
+ this.sourceCommunication = null;
32
+ if (args) {
33
+ if (args.queryTerms !== undefined && args.queryTerms !== null) {
34
+ this.queryTerms = Thrift.copyList(args.queryTerms, [null]);
35
+ }
36
+ if (args.maximumTokens !== undefined && args.maximumTokens !== null) {
37
+ this.maximumTokens = args.maximumTokens;
38
+ }
39
+ if (args.maximumCharacters !== undefined && args.maximumCharacters !== null) {
40
+ this.maximumCharacters = args.maximumCharacters;
41
+ }
42
+ if (args.sourceType !== undefined && args.sourceType !== null) {
43
+ this.sourceType = args.sourceType;
44
+ }
45
+ if (args.sourceIds !== undefined && args.sourceIds !== null) {
46
+ this.sourceIds = Thrift.copyList(args.sourceIds, [uuid_ttypes.UUID]);
47
+ }
48
+ if (args.sourceCommunication !== undefined && args.sourceCommunication !== null) {
49
+ this.sourceCommunication = new communication_ttypes.Communication(args.sourceCommunication);
50
+ }
51
+ }
52
+ }
53
+
54
+ read (input) {
55
+ input.readStructBegin();
56
+ while (true) {
57
+ const ret = input.readFieldBegin();
58
+ const ftype = ret.ftype;
59
+ const fid = ret.fid;
60
+ if (ftype == Thrift.Type.STOP) {
61
+ break;
62
+ }
63
+ switch (fid) {
64
+ case 1:
65
+ if (ftype == Thrift.Type.LIST) {
66
+ this.queryTerms = [];
67
+ const _rtmp31 = input.readListBegin();
68
+ const _size0 = _rtmp31.size || 0;
69
+ for (let _i2 = 0; _i2 < _size0; ++_i2) {
70
+ let elem3 = null;
71
+ elem3 = input.readString();
72
+ this.queryTerms.push(elem3);
73
+ }
74
+ input.readListEnd();
75
+ } else {
76
+ input.skip(ftype);
77
+ }
78
+ break;
79
+ case 2:
80
+ if (ftype == Thrift.Type.I32) {
81
+ this.maximumTokens = input.readI32();
82
+ } else {
83
+ input.skip(ftype);
84
+ }
85
+ break;
86
+ case 3:
87
+ if (ftype == Thrift.Type.I32) {
88
+ this.maximumCharacters = input.readI32();
89
+ } else {
90
+ input.skip(ftype);
91
+ }
92
+ break;
93
+ case 4:
94
+ if (ftype == Thrift.Type.I32) {
95
+ this.sourceType = input.readI32();
96
+ } else {
97
+ input.skip(ftype);
98
+ }
99
+ break;
100
+ case 5:
101
+ if (ftype == Thrift.Type.LIST) {
102
+ this.sourceIds = [];
103
+ const _rtmp35 = input.readListBegin();
104
+ const _size4 = _rtmp35.size || 0;
105
+ for (let _i6 = 0; _i6 < _size4; ++_i6) {
106
+ let elem7 = null;
107
+ elem7 = new uuid_ttypes.UUID();
108
+ elem7.read(input);
109
+ this.sourceIds.push(elem7);
110
+ }
111
+ input.readListEnd();
112
+ } else {
113
+ input.skip(ftype);
114
+ }
115
+ break;
116
+ case 6:
117
+ if (ftype == Thrift.Type.STRUCT) {
118
+ this.sourceCommunication = new communication_ttypes.Communication();
119
+ this.sourceCommunication.read(input);
120
+ } else {
121
+ input.skip(ftype);
122
+ }
123
+ break;
124
+ default:
125
+ input.skip(ftype);
126
+ }
127
+ input.readFieldEnd();
128
+ }
129
+ input.readStructEnd();
130
+ return;
131
+ }
132
+
133
+ write (output) {
134
+ output.writeStructBegin('SummarizationRequest');
135
+ if (this.queryTerms !== null && this.queryTerms !== undefined) {
136
+ output.writeFieldBegin('queryTerms', Thrift.Type.LIST, 1);
137
+ output.writeListBegin(Thrift.Type.STRING, this.queryTerms.length);
138
+ for (let iter8 in this.queryTerms) {
139
+ if (this.queryTerms.hasOwnProperty(iter8)) {
140
+ iter8 = this.queryTerms[iter8];
141
+ output.writeString(iter8);
142
+ }
143
+ }
144
+ output.writeListEnd();
145
+ output.writeFieldEnd();
146
+ }
147
+ if (this.maximumTokens !== null && this.maximumTokens !== undefined) {
148
+ output.writeFieldBegin('maximumTokens', Thrift.Type.I32, 2);
149
+ output.writeI32(this.maximumTokens);
150
+ output.writeFieldEnd();
151
+ }
152
+ if (this.maximumCharacters !== null && this.maximumCharacters !== undefined) {
153
+ output.writeFieldBegin('maximumCharacters', Thrift.Type.I32, 3);
154
+ output.writeI32(this.maximumCharacters);
155
+ output.writeFieldEnd();
156
+ }
157
+ if (this.sourceType !== null && this.sourceType !== undefined) {
158
+ output.writeFieldBegin('sourceType', Thrift.Type.I32, 4);
159
+ output.writeI32(this.sourceType);
160
+ output.writeFieldEnd();
161
+ }
162
+ if (this.sourceIds !== null && this.sourceIds !== undefined) {
163
+ output.writeFieldBegin('sourceIds', Thrift.Type.LIST, 5);
164
+ output.writeListBegin(Thrift.Type.STRUCT, this.sourceIds.length);
165
+ for (let iter9 in this.sourceIds) {
166
+ if (this.sourceIds.hasOwnProperty(iter9)) {
167
+ iter9 = this.sourceIds[iter9];
168
+ iter9.write(output);
169
+ }
170
+ }
171
+ output.writeListEnd();
172
+ output.writeFieldEnd();
173
+ }
174
+ if (this.sourceCommunication !== null && this.sourceCommunication !== undefined) {
175
+ output.writeFieldBegin('sourceCommunication', Thrift.Type.STRUCT, 6);
176
+ this.sourceCommunication.write(output);
177
+ output.writeFieldEnd();
178
+ }
179
+ output.writeFieldStop();
180
+ output.writeStructEnd();
181
+ return;
182
+ }
183
+
184
+ };
185
+ const SummaryConcept = module.exports.SummaryConcept = class {
186
+ constructor(args) {
187
+ this.tokens = null;
188
+ this.concept = null;
189
+ this.confidence = 1;
190
+ this.utility = 1;
191
+ if (args) {
192
+ if (args.tokens !== undefined && args.tokens !== null) {
193
+ this.tokens = new structure_ttypes.TokenRefSequence(args.tokens);
194
+ }
195
+ if (args.concept !== undefined && args.concept !== null) {
196
+ this.concept = args.concept;
197
+ }
198
+ if (args.confidence !== undefined && args.confidence !== null) {
199
+ this.confidence = args.confidence;
200
+ }
201
+ if (args.utility !== undefined && args.utility !== null) {
202
+ this.utility = args.utility;
203
+ }
204
+ }
205
+ }
206
+
207
+ read (input) {
208
+ input.readStructBegin();
209
+ while (true) {
210
+ const ret = input.readFieldBegin();
211
+ const ftype = ret.ftype;
212
+ const fid = ret.fid;
213
+ if (ftype == Thrift.Type.STOP) {
214
+ break;
215
+ }
216
+ switch (fid) {
217
+ case 1:
218
+ if (ftype == Thrift.Type.STRUCT) {
219
+ this.tokens = new structure_ttypes.TokenRefSequence();
220
+ this.tokens.read(input);
221
+ } else {
222
+ input.skip(ftype);
223
+ }
224
+ break;
225
+ case 2:
226
+ if (ftype == Thrift.Type.STRING) {
227
+ this.concept = input.readString();
228
+ } else {
229
+ input.skip(ftype);
230
+ }
231
+ break;
232
+ case 3:
233
+ if (ftype == Thrift.Type.DOUBLE) {
234
+ this.confidence = input.readDouble();
235
+ } else {
236
+ input.skip(ftype);
237
+ }
238
+ break;
239
+ case 4:
240
+ if (ftype == Thrift.Type.DOUBLE) {
241
+ this.utility = input.readDouble();
242
+ } else {
243
+ input.skip(ftype);
244
+ }
245
+ break;
246
+ default:
247
+ input.skip(ftype);
248
+ }
249
+ input.readFieldEnd();
250
+ }
251
+ input.readStructEnd();
252
+ return;
253
+ }
254
+
255
+ write (output) {
256
+ output.writeStructBegin('SummaryConcept');
257
+ if (this.tokens !== null && this.tokens !== undefined) {
258
+ output.writeFieldBegin('tokens', Thrift.Type.STRUCT, 1);
259
+ this.tokens.write(output);
260
+ output.writeFieldEnd();
261
+ }
262
+ if (this.concept !== null && this.concept !== undefined) {
263
+ output.writeFieldBegin('concept', Thrift.Type.STRING, 2);
264
+ output.writeString(this.concept);
265
+ output.writeFieldEnd();
266
+ }
267
+ if (this.confidence !== null && this.confidence !== undefined) {
268
+ output.writeFieldBegin('confidence', Thrift.Type.DOUBLE, 3);
269
+ output.writeDouble(this.confidence);
270
+ output.writeFieldEnd();
271
+ }
272
+ if (this.utility !== null && this.utility !== undefined) {
273
+ output.writeFieldBegin('utility', Thrift.Type.DOUBLE, 4);
274
+ output.writeDouble(this.utility);
275
+ output.writeFieldEnd();
276
+ }
277
+ output.writeFieldStop();
278
+ output.writeStructEnd();
279
+ return;
280
+ }
281
+
282
+ };
283
+ const Summary = module.exports.Summary = class {
284
+ constructor(args) {
285
+ this.summaryCommunication = null;
286
+ this.concepts = null;
287
+ if (args) {
288
+ if (args.summaryCommunication !== undefined && args.summaryCommunication !== null) {
289
+ this.summaryCommunication = new communication_ttypes.Communication(args.summaryCommunication);
290
+ }
291
+ if (args.concepts !== undefined && args.concepts !== null) {
292
+ this.concepts = Thrift.copyList(args.concepts, [ttypes.SummaryConcept]);
293
+ }
294
+ }
295
+ }
296
+
297
+ read (input) {
298
+ input.readStructBegin();
299
+ while (true) {
300
+ const ret = input.readFieldBegin();
301
+ const ftype = ret.ftype;
302
+ const fid = ret.fid;
303
+ if (ftype == Thrift.Type.STOP) {
304
+ break;
305
+ }
306
+ switch (fid) {
307
+ case 1:
308
+ if (ftype == Thrift.Type.STRUCT) {
309
+ this.summaryCommunication = new communication_ttypes.Communication();
310
+ this.summaryCommunication.read(input);
311
+ } else {
312
+ input.skip(ftype);
313
+ }
314
+ break;
315
+ case 2:
316
+ if (ftype == Thrift.Type.LIST) {
317
+ this.concepts = [];
318
+ const _rtmp311 = input.readListBegin();
319
+ const _size10 = _rtmp311.size || 0;
320
+ for (let _i12 = 0; _i12 < _size10; ++_i12) {
321
+ let elem13 = null;
322
+ elem13 = new ttypes.SummaryConcept();
323
+ elem13.read(input);
324
+ this.concepts.push(elem13);
325
+ }
326
+ input.readListEnd();
327
+ } else {
328
+ input.skip(ftype);
329
+ }
330
+ break;
331
+ default:
332
+ input.skip(ftype);
333
+ }
334
+ input.readFieldEnd();
335
+ }
336
+ input.readStructEnd();
337
+ return;
338
+ }
339
+
340
+ write (output) {
341
+ output.writeStructBegin('Summary');
342
+ if (this.summaryCommunication !== null && this.summaryCommunication !== undefined) {
343
+ output.writeFieldBegin('summaryCommunication', Thrift.Type.STRUCT, 1);
344
+ this.summaryCommunication.write(output);
345
+ output.writeFieldEnd();
346
+ }
347
+ if (this.concepts !== null && this.concepts !== undefined) {
348
+ output.writeFieldBegin('concepts', Thrift.Type.LIST, 2);
349
+ output.writeListBegin(Thrift.Type.STRUCT, this.concepts.length);
350
+ for (let iter14 in this.concepts) {
351
+ if (this.concepts.hasOwnProperty(iter14)) {
352
+ iter14 = this.concepts[iter14];
353
+ iter14.write(output);
354
+ }
355
+ }
356
+ output.writeListEnd();
357
+ output.writeFieldEnd();
358
+ }
359
+ output.writeFieldStop();
360
+ output.writeStructEnd();
361
+ return;
362
+ }
363
+
364
+ };
365
+ const SummarizationCapability = module.exports.SummarizationCapability = class {
366
+ constructor(args) {
367
+ this.type = null;
368
+ this.lang = null;
369
+ if (args) {
370
+ if (args.type !== undefined && args.type !== null) {
371
+ this.type = args.type;
372
+ } else {
373
+ throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field type is unset!');
374
+ }
375
+ if (args.lang !== undefined && args.lang !== null) {
376
+ this.lang = args.lang;
377
+ } else {
378
+ throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field lang is unset!');
379
+ }
380
+ }
381
+ }
382
+
383
+ read (input) {
384
+ input.readStructBegin();
385
+ while (true) {
386
+ const ret = input.readFieldBegin();
387
+ const ftype = ret.ftype;
388
+ const fid = ret.fid;
389
+ if (ftype == Thrift.Type.STOP) {
390
+ break;
391
+ }
392
+ switch (fid) {
393
+ case 1:
394
+ if (ftype == Thrift.Type.I32) {
395
+ this.type = input.readI32();
396
+ } else {
397
+ input.skip(ftype);
398
+ }
399
+ break;
400
+ case 2:
401
+ if (ftype == Thrift.Type.STRING) {
402
+ this.lang = input.readString();
403
+ } else {
404
+ input.skip(ftype);
405
+ }
406
+ break;
407
+ default:
408
+ input.skip(ftype);
409
+ }
410
+ input.readFieldEnd();
411
+ }
412
+ input.readStructEnd();
413
+ return;
414
+ }
415
+
416
+ write (output) {
417
+ output.writeStructBegin('SummarizationCapability');
418
+ if (this.type !== null && this.type !== undefined) {
419
+ output.writeFieldBegin('type', Thrift.Type.I32, 1);
420
+ output.writeI32(this.type);
421
+ output.writeFieldEnd();
422
+ }
423
+ if (this.lang !== null && this.lang !== undefined) {
424
+ output.writeFieldBegin('lang', Thrift.Type.STRING, 2);
425
+ output.writeString(this.lang);
426
+ output.writeFieldEnd();
427
+ }
428
+ output.writeFieldStop();
429
+ output.writeStructEnd();
430
+ return;
431
+ }
432
+
433
+ };