@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,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
|
+
};
|