@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,249 +1,249 @@
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 services_ttypes = require('./services_types');
13
- const uuid_ttypes = require('./uuid_types');
14
- const communication_ttypes = require('./communication_types');
15
-
16
-
17
- const Service = require('./Service');
18
- const ServiceClient = Service.Client;
19
- const ServiceProcessor = Service.Processor;
20
- const ttypes = require('./learn_types');
21
- //HELPER FUNCTIONS AND STRUCTURES
22
-
23
- const ActiveLearnerClientService_submitSort_args = class {
24
- constructor(args) {
25
- this.sessionId = null;
26
- this.unitIds = null;
27
- if (args) {
28
- if (args.sessionId !== undefined && args.sessionId !== null) {
29
- this.sessionId = new uuid_ttypes.UUID(args.sessionId);
30
- }
31
- if (args.unitIds !== undefined && args.unitIds !== null) {
32
- this.unitIds = Thrift.copyList(args.unitIds, [services_ttypes.AnnotationUnitIdentifier]);
33
- }
34
- }
35
- }
36
-
37
- read (input) {
38
- input.readStructBegin();
39
- while (true) {
40
- const ret = input.readFieldBegin();
41
- const ftype = ret.ftype;
42
- const fid = ret.fid;
43
- if (ftype == Thrift.Type.STOP) {
44
- break;
45
- }
46
- switch (fid) {
47
- case 1:
48
- if (ftype == Thrift.Type.STRUCT) {
49
- this.sessionId = new uuid_ttypes.UUID();
50
- this.sessionId.read(input);
51
- } else {
52
- input.skip(ftype);
53
- }
54
- break;
55
- case 2:
56
- if (ftype == Thrift.Type.LIST) {
57
- this.unitIds = [];
58
- const _rtmp311 = input.readListBegin();
59
- const _size10 = _rtmp311.size || 0;
60
- for (let _i12 = 0; _i12 < _size10; ++_i12) {
61
- let elem13 = null;
62
- elem13 = new services_ttypes.AnnotationUnitIdentifier();
63
- elem13.read(input);
64
- this.unitIds.push(elem13);
65
- }
66
- input.readListEnd();
67
- } else {
68
- input.skip(ftype);
69
- }
70
- break;
71
- default:
72
- input.skip(ftype);
73
- }
74
- input.readFieldEnd();
75
- }
76
- input.readStructEnd();
77
- return;
78
- }
79
-
80
- write (output) {
81
- output.writeStructBegin('ActiveLearnerClientService_submitSort_args');
82
- if (this.sessionId !== null && this.sessionId !== undefined) {
83
- output.writeFieldBegin('sessionId', Thrift.Type.STRUCT, 1);
84
- this.sessionId.write(output);
85
- output.writeFieldEnd();
86
- }
87
- if (this.unitIds !== null && this.unitIds !== undefined) {
88
- output.writeFieldBegin('unitIds', Thrift.Type.LIST, 2);
89
- output.writeListBegin(Thrift.Type.STRUCT, this.unitIds.length);
90
- for (let iter14 in this.unitIds) {
91
- if (this.unitIds.hasOwnProperty(iter14)) {
92
- iter14 = this.unitIds[iter14];
93
- iter14.write(output);
94
- }
95
- }
96
- output.writeListEnd();
97
- output.writeFieldEnd();
98
- }
99
- output.writeFieldStop();
100
- output.writeStructEnd();
101
- return;
102
- }
103
-
104
- };
105
- const ActiveLearnerClientService_submitSort_result = class {
106
- constructor(args) {
107
- }
108
-
109
- read (input) {
110
- input.readStructBegin();
111
- while (true) {
112
- const ret = input.readFieldBegin();
113
- const ftype = ret.ftype;
114
- if (ftype == Thrift.Type.STOP) {
115
- break;
116
- }
117
- input.skip(ftype);
118
- input.readFieldEnd();
119
- }
120
- input.readStructEnd();
121
- return;
122
- }
123
-
124
- write (output) {
125
- output.writeStructBegin('ActiveLearnerClientService_submitSort_result');
126
- output.writeFieldStop();
127
- output.writeStructEnd();
128
- return;
129
- }
130
-
131
- };
132
- const ActiveLearnerClientServiceClient = exports.Client = class ActiveLearnerClientServiceClient extends ServiceClient {
133
- constructor(output, pClass) {
134
- super(output, pClass);
135
- this.output = output;
136
- this.pClass = pClass;
137
- this._seqid = 0;
138
- this._reqs = {};
139
- }
140
- seqid () { return this._seqid; }
141
- new_seqid () { return this._seqid += 1; }
142
-
143
- submitSort (sessionId, unitIds) {
144
- this._seqid = this.new_seqid();
145
- const self = this;
146
- return new Promise((resolve, reject) => {
147
- self._reqs[self.seqid()] = (error, result) => {
148
- return error ? reject(error) : resolve(result);
149
- };
150
- self.send_submitSort(sessionId, unitIds);
151
- });
152
- }
153
-
154
- send_submitSort (sessionId, unitIds) {
155
- const output = new this.pClass(this.output);
156
- const params = {
157
- sessionId: sessionId,
158
- unitIds: unitIds
159
- };
160
- const args = new ActiveLearnerClientService_submitSort_args(params);
161
- try {
162
- output.writeMessageBegin('submitSort', Thrift.MessageType.CALL, this.seqid());
163
- args.write(output);
164
- output.writeMessageEnd();
165
- return this.output.flush();
166
- }
167
- catch (e) {
168
- delete this._reqs[this.seqid()];
169
- if (typeof output.reset === 'function') {
170
- output.reset();
171
- }
172
- throw e;
173
- }
174
- }
175
-
176
- recv_submitSort (input, mtype, rseqid) {
177
- const callback = this._reqs[rseqid] || function() {};
178
- delete this._reqs[rseqid];
179
- if (mtype == Thrift.MessageType.EXCEPTION) {
180
- const x = new Thrift.TApplicationException();
181
- x.read(input);
182
- input.readMessageEnd();
183
- return callback(x);
184
- }
185
- const result = new ActiveLearnerClientService_submitSort_result();
186
- result.read(input);
187
- input.readMessageEnd();
188
-
189
- callback(null);
190
- }
191
- };
192
- const ActiveLearnerClientServiceProcessor = exports.Processor = class ActiveLearnerClientServiceProcessor extends ServiceProcessor {
193
- constructor(handler) {
194
- super(handler);
195
- this._handler = handler;
196
- }
197
- process (input, output) {
198
- const r = input.readMessageBegin();
199
- if (this['process_' + r.fname]) {
200
- return this['process_' + r.fname].call(this, r.rseqid, input, output);
201
- } else {
202
- input.skip(Thrift.Type.STRUCT);
203
- input.readMessageEnd();
204
- const x = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN_METHOD, 'Unknown function ' + r.fname);
205
- output.writeMessageBegin(r.fname, Thrift.MessageType.EXCEPTION, r.rseqid);
206
- x.write(output);
207
- output.writeMessageEnd();
208
- output.flush();
209
- }
210
- }
211
- process_submitSort (seqid, input, output) {
212
- const args = new ActiveLearnerClientService_submitSort_args();
213
- args.read(input);
214
- input.readMessageEnd();
215
- if (this._handler.submitSort.length === 2) {
216
- Promise.resolve(this._handler.submitSort.bind(this._handler)(
217
- args.sessionId,
218
- args.unitIds
219
- )).then(result => {
220
- const result_obj = new ActiveLearnerClientService_submitSort_result({success: result});
221
- output.writeMessageBegin("submitSort", Thrift.MessageType.REPLY, seqid);
222
- result_obj.write(output);
223
- output.writeMessageEnd();
224
- output.flush();
225
- }).catch(err => {
226
- let result;
227
- result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message);
228
- output.writeMessageBegin("submitSort", Thrift.MessageType.EXCEPTION, seqid);
229
- result.write(output);
230
- output.writeMessageEnd();
231
- output.flush();
232
- });
233
- } else {
234
- this._handler.submitSort(args.sessionId, args.unitIds, (err, result) => {
235
- let result_obj;
236
- if ((err === null || typeof err === 'undefined')) {
237
- result_obj = new ActiveLearnerClientService_submitSort_result((err !== null || typeof err === 'undefined') ? err : {success: result});
238
- output.writeMessageBegin("submitSort", Thrift.MessageType.REPLY, seqid);
239
- } else {
240
- result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message);
241
- output.writeMessageBegin("submitSort", Thrift.MessageType.EXCEPTION, seqid);
242
- }
243
- result_obj.write(output);
244
- output.writeMessageEnd();
245
- output.flush();
246
- });
247
- }
248
- }
249
- };
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 services_ttypes = require('./services_types');
13
+ const uuid_ttypes = require('./uuid_types');
14
+ const communication_ttypes = require('./communication_types');
15
+
16
+
17
+ const Service = require('./Service');
18
+ const ServiceClient = Service.Client;
19
+ const ServiceProcessor = Service.Processor;
20
+ const ttypes = require('./learn_types');
21
+ //HELPER FUNCTIONS AND STRUCTURES
22
+
23
+ const ActiveLearnerClientService_submitSort_args = class {
24
+ constructor(args) {
25
+ this.sessionId = null;
26
+ this.unitIds = null;
27
+ if (args) {
28
+ if (args.sessionId !== undefined && args.sessionId !== null) {
29
+ this.sessionId = new uuid_ttypes.UUID(args.sessionId);
30
+ }
31
+ if (args.unitIds !== undefined && args.unitIds !== null) {
32
+ this.unitIds = Thrift.copyList(args.unitIds, [services_ttypes.AnnotationUnitIdentifier]);
33
+ }
34
+ }
35
+ }
36
+
37
+ read (input) {
38
+ input.readStructBegin();
39
+ while (true) {
40
+ const ret = input.readFieldBegin();
41
+ const ftype = ret.ftype;
42
+ const fid = ret.fid;
43
+ if (ftype == Thrift.Type.STOP) {
44
+ break;
45
+ }
46
+ switch (fid) {
47
+ case 1:
48
+ if (ftype == Thrift.Type.STRUCT) {
49
+ this.sessionId = new uuid_ttypes.UUID();
50
+ this.sessionId.read(input);
51
+ } else {
52
+ input.skip(ftype);
53
+ }
54
+ break;
55
+ case 2:
56
+ if (ftype == Thrift.Type.LIST) {
57
+ this.unitIds = [];
58
+ const _rtmp311 = input.readListBegin();
59
+ const _size10 = _rtmp311.size || 0;
60
+ for (let _i12 = 0; _i12 < _size10; ++_i12) {
61
+ let elem13 = null;
62
+ elem13 = new services_ttypes.AnnotationUnitIdentifier();
63
+ elem13.read(input);
64
+ this.unitIds.push(elem13);
65
+ }
66
+ input.readListEnd();
67
+ } else {
68
+ input.skip(ftype);
69
+ }
70
+ break;
71
+ default:
72
+ input.skip(ftype);
73
+ }
74
+ input.readFieldEnd();
75
+ }
76
+ input.readStructEnd();
77
+ return;
78
+ }
79
+
80
+ write (output) {
81
+ output.writeStructBegin('ActiveLearnerClientService_submitSort_args');
82
+ if (this.sessionId !== null && this.sessionId !== undefined) {
83
+ output.writeFieldBegin('sessionId', Thrift.Type.STRUCT, 1);
84
+ this.sessionId.write(output);
85
+ output.writeFieldEnd();
86
+ }
87
+ if (this.unitIds !== null && this.unitIds !== undefined) {
88
+ output.writeFieldBegin('unitIds', Thrift.Type.LIST, 2);
89
+ output.writeListBegin(Thrift.Type.STRUCT, this.unitIds.length);
90
+ for (let iter14 in this.unitIds) {
91
+ if (this.unitIds.hasOwnProperty(iter14)) {
92
+ iter14 = this.unitIds[iter14];
93
+ iter14.write(output);
94
+ }
95
+ }
96
+ output.writeListEnd();
97
+ output.writeFieldEnd();
98
+ }
99
+ output.writeFieldStop();
100
+ output.writeStructEnd();
101
+ return;
102
+ }
103
+
104
+ };
105
+ const ActiveLearnerClientService_submitSort_result = class {
106
+ constructor(args) {
107
+ }
108
+
109
+ read (input) {
110
+ input.readStructBegin();
111
+ while (true) {
112
+ const ret = input.readFieldBegin();
113
+ const ftype = ret.ftype;
114
+ if (ftype == Thrift.Type.STOP) {
115
+ break;
116
+ }
117
+ input.skip(ftype);
118
+ input.readFieldEnd();
119
+ }
120
+ input.readStructEnd();
121
+ return;
122
+ }
123
+
124
+ write (output) {
125
+ output.writeStructBegin('ActiveLearnerClientService_submitSort_result');
126
+ output.writeFieldStop();
127
+ output.writeStructEnd();
128
+ return;
129
+ }
130
+
131
+ };
132
+ const ActiveLearnerClientServiceClient = exports.Client = class ActiveLearnerClientServiceClient extends ServiceClient {
133
+ constructor(output, pClass) {
134
+ super(output, pClass);
135
+ this.output = output;
136
+ this.pClass = pClass;
137
+ this._seqid = 0;
138
+ this._reqs = {};
139
+ }
140
+ seqid () { return this._seqid; }
141
+ new_seqid () { return this._seqid += 1; }
142
+
143
+ submitSort (sessionId, unitIds) {
144
+ this._seqid = this.new_seqid();
145
+ const self = this;
146
+ return new Promise((resolve, reject) => {
147
+ self._reqs[self.seqid()] = (error, result) => {
148
+ return error ? reject(error) : resolve(result);
149
+ };
150
+ self.send_submitSort(sessionId, unitIds);
151
+ });
152
+ }
153
+
154
+ send_submitSort (sessionId, unitIds) {
155
+ const output = new this.pClass(this.output);
156
+ const params = {
157
+ sessionId: sessionId,
158
+ unitIds: unitIds
159
+ };
160
+ const args = new ActiveLearnerClientService_submitSort_args(params);
161
+ try {
162
+ output.writeMessageBegin('submitSort', Thrift.MessageType.CALL, this.seqid());
163
+ args.write(output);
164
+ output.writeMessageEnd();
165
+ return this.output.flush();
166
+ }
167
+ catch (e) {
168
+ delete this._reqs[this.seqid()];
169
+ if (typeof output.reset === 'function') {
170
+ output.reset();
171
+ }
172
+ throw e;
173
+ }
174
+ }
175
+
176
+ recv_submitSort (input, mtype, rseqid) {
177
+ const callback = this._reqs[rseqid] || function() {};
178
+ delete this._reqs[rseqid];
179
+ if (mtype == Thrift.MessageType.EXCEPTION) {
180
+ const x = new Thrift.TApplicationException();
181
+ x.read(input);
182
+ input.readMessageEnd();
183
+ return callback(x);
184
+ }
185
+ const result = new ActiveLearnerClientService_submitSort_result();
186
+ result.read(input);
187
+ input.readMessageEnd();
188
+
189
+ callback(null);
190
+ }
191
+ };
192
+ const ActiveLearnerClientServiceProcessor = exports.Processor = class ActiveLearnerClientServiceProcessor extends ServiceProcessor {
193
+ constructor(handler) {
194
+ super(handler);
195
+ this._handler = handler;
196
+ }
197
+ process (input, output) {
198
+ const r = input.readMessageBegin();
199
+ if (this['process_' + r.fname]) {
200
+ return this['process_' + r.fname].call(this, r.rseqid, input, output);
201
+ } else {
202
+ input.skip(Thrift.Type.STRUCT);
203
+ input.readMessageEnd();
204
+ const x = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN_METHOD, 'Unknown function ' + r.fname);
205
+ output.writeMessageBegin(r.fname, Thrift.MessageType.EXCEPTION, r.rseqid);
206
+ x.write(output);
207
+ output.writeMessageEnd();
208
+ output.flush();
209
+ }
210
+ }
211
+ process_submitSort (seqid, input, output) {
212
+ const args = new ActiveLearnerClientService_submitSort_args();
213
+ args.read(input);
214
+ input.readMessageEnd();
215
+ if (this._handler.submitSort.length === 2) {
216
+ Promise.resolve(this._handler.submitSort.bind(this._handler)(
217
+ args.sessionId,
218
+ args.unitIds
219
+ )).then(result => {
220
+ const result_obj = new ActiveLearnerClientService_submitSort_result({success: result});
221
+ output.writeMessageBegin("submitSort", Thrift.MessageType.REPLY, seqid);
222
+ result_obj.write(output);
223
+ output.writeMessageEnd();
224
+ output.flush();
225
+ }).catch(err => {
226
+ let result;
227
+ result = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message);
228
+ output.writeMessageBegin("submitSort", Thrift.MessageType.EXCEPTION, seqid);
229
+ result.write(output);
230
+ output.writeMessageEnd();
231
+ output.flush();
232
+ });
233
+ } else {
234
+ this._handler.submitSort(args.sessionId, args.unitIds, (err, result) => {
235
+ let result_obj;
236
+ if ((err === null || typeof err === 'undefined')) {
237
+ result_obj = new ActiveLearnerClientService_submitSort_result((err !== null || typeof err === 'undefined') ? err : {success: result});
238
+ output.writeMessageBegin("submitSort", Thrift.MessageType.REPLY, seqid);
239
+ } else {
240
+ result_obj = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN, err.message);
241
+ output.writeMessageBegin("submitSort", Thrift.MessageType.EXCEPTION, seqid);
242
+ }
243
+ result_obj.write(output);
244
+ output.writeMessageEnd();
245
+ output.flush();
246
+ });
247
+ }
248
+ }
249
+ };