@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,2311 +1,2311 @@
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 metadata_ttypes = require('./metadata_types');
13
- const spans_ttypes = require('./spans_types');
14
- const uuid_ttypes = require('./uuid_types');
15
- const language_ttypes = require('./language_types');
16
-
17
-
18
- const ttypes = module.exports = {};
19
- ttypes.TokenizationKind = {
20
- 'TOKEN_LIST' : 1,
21
- 'TOKEN_LATTICE' : 2
22
- };
23
- const Constituent = module.exports.Constituent = class {
24
- constructor(args) {
25
- this.id = null;
26
- this.tag = null;
27
- this.childList = null;
28
- this.headChildIndex = -1;
29
- this.start = null;
30
- this.ending = null;
31
- if (args) {
32
- if (args.id !== undefined && args.id !== null) {
33
- this.id = args.id;
34
- } else {
35
- throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field id is unset!');
36
- }
37
- if (args.tag !== undefined && args.tag !== null) {
38
- this.tag = args.tag;
39
- }
40
- if (args.childList !== undefined && args.childList !== null) {
41
- this.childList = Thrift.copyList(args.childList, [null]);
42
- } else {
43
- throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field childList is unset!');
44
- }
45
- if (args.headChildIndex !== undefined && args.headChildIndex !== null) {
46
- this.headChildIndex = args.headChildIndex;
47
- }
48
- if (args.start !== undefined && args.start !== null) {
49
- this.start = args.start;
50
- }
51
- if (args.ending !== undefined && args.ending !== null) {
52
- this.ending = args.ending;
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.I32) {
69
- this.id = input.readI32();
70
- } else {
71
- input.skip(ftype);
72
- }
73
- break;
74
- case 2:
75
- if (ftype == Thrift.Type.STRING) {
76
- this.tag = input.readString();
77
- } else {
78
- input.skip(ftype);
79
- }
80
- break;
81
- case 3:
82
- if (ftype == Thrift.Type.LIST) {
83
- this.childList = [];
84
- const _rtmp31 = input.readListBegin();
85
- const _size0 = _rtmp31.size || 0;
86
- for (let _i2 = 0; _i2 < _size0; ++_i2) {
87
- let elem3 = null;
88
- elem3 = input.readI32();
89
- this.childList.push(elem3);
90
- }
91
- input.readListEnd();
92
- } else {
93
- input.skip(ftype);
94
- }
95
- break;
96
- case 4:
97
- if (ftype == Thrift.Type.I32) {
98
- this.headChildIndex = input.readI32();
99
- } else {
100
- input.skip(ftype);
101
- }
102
- break;
103
- case 5:
104
- if (ftype == Thrift.Type.I32) {
105
- this.start = input.readI32();
106
- } else {
107
- input.skip(ftype);
108
- }
109
- break;
110
- case 6:
111
- if (ftype == Thrift.Type.I32) {
112
- this.ending = input.readI32();
113
- } else {
114
- input.skip(ftype);
115
- }
116
- break;
117
- default:
118
- input.skip(ftype);
119
- }
120
- input.readFieldEnd();
121
- }
122
- input.readStructEnd();
123
- return;
124
- }
125
-
126
- write (output) {
127
- output.writeStructBegin('Constituent');
128
- if (this.id !== null && this.id !== undefined) {
129
- output.writeFieldBegin('id', Thrift.Type.I32, 1);
130
- output.writeI32(this.id);
131
- output.writeFieldEnd();
132
- }
133
- if (this.tag !== null && this.tag !== undefined) {
134
- output.writeFieldBegin('tag', Thrift.Type.STRING, 2);
135
- output.writeString(this.tag);
136
- output.writeFieldEnd();
137
- }
138
- if (this.childList !== null && this.childList !== undefined) {
139
- output.writeFieldBegin('childList', Thrift.Type.LIST, 3);
140
- output.writeListBegin(Thrift.Type.I32, this.childList.length);
141
- for (let iter4 in this.childList) {
142
- if (this.childList.hasOwnProperty(iter4)) {
143
- iter4 = this.childList[iter4];
144
- output.writeI32(iter4);
145
- }
146
- }
147
- output.writeListEnd();
148
- output.writeFieldEnd();
149
- }
150
- if (this.headChildIndex !== null && this.headChildIndex !== undefined) {
151
- output.writeFieldBegin('headChildIndex', Thrift.Type.I32, 4);
152
- output.writeI32(this.headChildIndex);
153
- output.writeFieldEnd();
154
- }
155
- if (this.start !== null && this.start !== undefined) {
156
- output.writeFieldBegin('start', Thrift.Type.I32, 5);
157
- output.writeI32(this.start);
158
- output.writeFieldEnd();
159
- }
160
- if (this.ending !== null && this.ending !== undefined) {
161
- output.writeFieldBegin('ending', Thrift.Type.I32, 6);
162
- output.writeI32(this.ending);
163
- output.writeFieldEnd();
164
- }
165
- output.writeFieldStop();
166
- output.writeStructEnd();
167
- return;
168
- }
169
-
170
- };
171
- const Parse = module.exports.Parse = class {
172
- constructor(args) {
173
- this.uuid = null;
174
- this.metadata = null;
175
- this.constituentList = null;
176
- if (args) {
177
- if (args.uuid !== undefined && args.uuid !== null) {
178
- this.uuid = new uuid_ttypes.UUID(args.uuid);
179
- } else {
180
- throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field uuid is unset!');
181
- }
182
- if (args.metadata !== undefined && args.metadata !== null) {
183
- this.metadata = new metadata_ttypes.AnnotationMetadata(args.metadata);
184
- } else {
185
- throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field metadata is unset!');
186
- }
187
- if (args.constituentList !== undefined && args.constituentList !== null) {
188
- this.constituentList = Thrift.copyList(args.constituentList, [ttypes.Constituent]);
189
- } else {
190
- throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field constituentList is unset!');
191
- }
192
- }
193
- }
194
-
195
- read (input) {
196
- input.readStructBegin();
197
- while (true) {
198
- const ret = input.readFieldBegin();
199
- const ftype = ret.ftype;
200
- const fid = ret.fid;
201
- if (ftype == Thrift.Type.STOP) {
202
- break;
203
- }
204
- switch (fid) {
205
- case 1:
206
- if (ftype == Thrift.Type.STRUCT) {
207
- this.uuid = new uuid_ttypes.UUID();
208
- this.uuid.read(input);
209
- } else {
210
- input.skip(ftype);
211
- }
212
- break;
213
- case 2:
214
- if (ftype == Thrift.Type.STRUCT) {
215
- this.metadata = new metadata_ttypes.AnnotationMetadata();
216
- this.metadata.read(input);
217
- } else {
218
- input.skip(ftype);
219
- }
220
- break;
221
- case 3:
222
- if (ftype == Thrift.Type.LIST) {
223
- this.constituentList = [];
224
- const _rtmp36 = input.readListBegin();
225
- const _size5 = _rtmp36.size || 0;
226
- for (let _i7 = 0; _i7 < _size5; ++_i7) {
227
- let elem8 = null;
228
- elem8 = new ttypes.Constituent();
229
- elem8.read(input);
230
- this.constituentList.push(elem8);
231
- }
232
- input.readListEnd();
233
- } else {
234
- input.skip(ftype);
235
- }
236
- break;
237
- default:
238
- input.skip(ftype);
239
- }
240
- input.readFieldEnd();
241
- }
242
- input.readStructEnd();
243
- return;
244
- }
245
-
246
- write (output) {
247
- output.writeStructBegin('Parse');
248
- if (this.uuid !== null && this.uuid !== undefined) {
249
- output.writeFieldBegin('uuid', Thrift.Type.STRUCT, 1);
250
- this.uuid.write(output);
251
- output.writeFieldEnd();
252
- }
253
- if (this.metadata !== null && this.metadata !== undefined) {
254
- output.writeFieldBegin('metadata', Thrift.Type.STRUCT, 2);
255
- this.metadata.write(output);
256
- output.writeFieldEnd();
257
- }
258
- if (this.constituentList !== null && this.constituentList !== undefined) {
259
- output.writeFieldBegin('constituentList', Thrift.Type.LIST, 3);
260
- output.writeListBegin(Thrift.Type.STRUCT, this.constituentList.length);
261
- for (let iter9 in this.constituentList) {
262
- if (this.constituentList.hasOwnProperty(iter9)) {
263
- iter9 = this.constituentList[iter9];
264
- iter9.write(output);
265
- }
266
- }
267
- output.writeListEnd();
268
- output.writeFieldEnd();
269
- }
270
- output.writeFieldStop();
271
- output.writeStructEnd();
272
- return;
273
- }
274
-
275
- };
276
- const ConstituentRef = module.exports.ConstituentRef = class {
277
- constructor(args) {
278
- this.parseId = null;
279
- this.constituentIndex = null;
280
- if (args) {
281
- if (args.parseId !== undefined && args.parseId !== null) {
282
- this.parseId = new uuid_ttypes.UUID(args.parseId);
283
- } else {
284
- throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field parseId is unset!');
285
- }
286
- if (args.constituentIndex !== undefined && args.constituentIndex !== null) {
287
- this.constituentIndex = args.constituentIndex;
288
- } else {
289
- throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field constituentIndex is unset!');
290
- }
291
- }
292
- }
293
-
294
- read (input) {
295
- input.readStructBegin();
296
- while (true) {
297
- const ret = input.readFieldBegin();
298
- const ftype = ret.ftype;
299
- const fid = ret.fid;
300
- if (ftype == Thrift.Type.STOP) {
301
- break;
302
- }
303
- switch (fid) {
304
- case 1:
305
- if (ftype == Thrift.Type.STRUCT) {
306
- this.parseId = new uuid_ttypes.UUID();
307
- this.parseId.read(input);
308
- } else {
309
- input.skip(ftype);
310
- }
311
- break;
312
- case 2:
313
- if (ftype == Thrift.Type.I32) {
314
- this.constituentIndex = input.readI32();
315
- } else {
316
- input.skip(ftype);
317
- }
318
- break;
319
- default:
320
- input.skip(ftype);
321
- }
322
- input.readFieldEnd();
323
- }
324
- input.readStructEnd();
325
- return;
326
- }
327
-
328
- write (output) {
329
- output.writeStructBegin('ConstituentRef');
330
- if (this.parseId !== null && this.parseId !== undefined) {
331
- output.writeFieldBegin('parseId', Thrift.Type.STRUCT, 1);
332
- this.parseId.write(output);
333
- output.writeFieldEnd();
334
- }
335
- if (this.constituentIndex !== null && this.constituentIndex !== undefined) {
336
- output.writeFieldBegin('constituentIndex', Thrift.Type.I32, 2);
337
- output.writeI32(this.constituentIndex);
338
- output.writeFieldEnd();
339
- }
340
- output.writeFieldStop();
341
- output.writeStructEnd();
342
- return;
343
- }
344
-
345
- };
346
- const Dependency = module.exports.Dependency = class {
347
- constructor(args) {
348
- this.gov = -1;
349
- this.dep = null;
350
- this.edgeType = null;
351
- if (args) {
352
- if (args.gov !== undefined && args.gov !== null) {
353
- this.gov = args.gov;
354
- }
355
- if (args.dep !== undefined && args.dep !== null) {
356
- this.dep = args.dep;
357
- } else {
358
- throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field dep is unset!');
359
- }
360
- if (args.edgeType !== undefined && args.edgeType !== null) {
361
- this.edgeType = args.edgeType;
362
- }
363
- }
364
- }
365
-
366
- read (input) {
367
- input.readStructBegin();
368
- while (true) {
369
- const ret = input.readFieldBegin();
370
- const ftype = ret.ftype;
371
- const fid = ret.fid;
372
- if (ftype == Thrift.Type.STOP) {
373
- break;
374
- }
375
- switch (fid) {
376
- case 1:
377
- if (ftype == Thrift.Type.I32) {
378
- this.gov = input.readI32();
379
- } else {
380
- input.skip(ftype);
381
- }
382
- break;
383
- case 2:
384
- if (ftype == Thrift.Type.I32) {
385
- this.dep = input.readI32();
386
- } else {
387
- input.skip(ftype);
388
- }
389
- break;
390
- case 3:
391
- if (ftype == Thrift.Type.STRING) {
392
- this.edgeType = input.readString();
393
- } else {
394
- input.skip(ftype);
395
- }
396
- break;
397
- default:
398
- input.skip(ftype);
399
- }
400
- input.readFieldEnd();
401
- }
402
- input.readStructEnd();
403
- return;
404
- }
405
-
406
- write (output) {
407
- output.writeStructBegin('Dependency');
408
- if (this.gov !== null && this.gov !== undefined) {
409
- output.writeFieldBegin('gov', Thrift.Type.I32, 1);
410
- output.writeI32(this.gov);
411
- output.writeFieldEnd();
412
- }
413
- if (this.dep !== null && this.dep !== undefined) {
414
- output.writeFieldBegin('dep', Thrift.Type.I32, 2);
415
- output.writeI32(this.dep);
416
- output.writeFieldEnd();
417
- }
418
- if (this.edgeType !== null && this.edgeType !== undefined) {
419
- output.writeFieldBegin('edgeType', Thrift.Type.STRING, 3);
420
- output.writeString(this.edgeType);
421
- output.writeFieldEnd();
422
- }
423
- output.writeFieldStop();
424
- output.writeStructEnd();
425
- return;
426
- }
427
-
428
- };
429
- const DependencyParseStructure = module.exports.DependencyParseStructure = class {
430
- constructor(args) {
431
- this.isAcyclic = null;
432
- this.isConnected = null;
433
- this.isSingleHeaded = null;
434
- this.isProjective = null;
435
- if (args) {
436
- if (args.isAcyclic !== undefined && args.isAcyclic !== null) {
437
- this.isAcyclic = args.isAcyclic;
438
- } else {
439
- throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field isAcyclic is unset!');
440
- }
441
- if (args.isConnected !== undefined && args.isConnected !== null) {
442
- this.isConnected = args.isConnected;
443
- } else {
444
- throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field isConnected is unset!');
445
- }
446
- if (args.isSingleHeaded !== undefined && args.isSingleHeaded !== null) {
447
- this.isSingleHeaded = args.isSingleHeaded;
448
- } else {
449
- throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field isSingleHeaded is unset!');
450
- }
451
- if (args.isProjective !== undefined && args.isProjective !== null) {
452
- this.isProjective = args.isProjective;
453
- } else {
454
- throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field isProjective is unset!');
455
- }
456
- }
457
- }
458
-
459
- read (input) {
460
- input.readStructBegin();
461
- while (true) {
462
- const ret = input.readFieldBegin();
463
- const ftype = ret.ftype;
464
- const fid = ret.fid;
465
- if (ftype == Thrift.Type.STOP) {
466
- break;
467
- }
468
- switch (fid) {
469
- case 1:
470
- if (ftype == Thrift.Type.BOOL) {
471
- this.isAcyclic = input.readBool();
472
- } else {
473
- input.skip(ftype);
474
- }
475
- break;
476
- case 2:
477
- if (ftype == Thrift.Type.BOOL) {
478
- this.isConnected = input.readBool();
479
- } else {
480
- input.skip(ftype);
481
- }
482
- break;
483
- case 3:
484
- if (ftype == Thrift.Type.BOOL) {
485
- this.isSingleHeaded = input.readBool();
486
- } else {
487
- input.skip(ftype);
488
- }
489
- break;
490
- case 4:
491
- if (ftype == Thrift.Type.BOOL) {
492
- this.isProjective = input.readBool();
493
- } else {
494
- input.skip(ftype);
495
- }
496
- break;
497
- default:
498
- input.skip(ftype);
499
- }
500
- input.readFieldEnd();
501
- }
502
- input.readStructEnd();
503
- return;
504
- }
505
-
506
- write (output) {
507
- output.writeStructBegin('DependencyParseStructure');
508
- if (this.isAcyclic !== null && this.isAcyclic !== undefined) {
509
- output.writeFieldBegin('isAcyclic', Thrift.Type.BOOL, 1);
510
- output.writeBool(this.isAcyclic);
511
- output.writeFieldEnd();
512
- }
513
- if (this.isConnected !== null && this.isConnected !== undefined) {
514
- output.writeFieldBegin('isConnected', Thrift.Type.BOOL, 2);
515
- output.writeBool(this.isConnected);
516
- output.writeFieldEnd();
517
- }
518
- if (this.isSingleHeaded !== null && this.isSingleHeaded !== undefined) {
519
- output.writeFieldBegin('isSingleHeaded', Thrift.Type.BOOL, 3);
520
- output.writeBool(this.isSingleHeaded);
521
- output.writeFieldEnd();
522
- }
523
- if (this.isProjective !== null && this.isProjective !== undefined) {
524
- output.writeFieldBegin('isProjective', Thrift.Type.BOOL, 4);
525
- output.writeBool(this.isProjective);
526
- output.writeFieldEnd();
527
- }
528
- output.writeFieldStop();
529
- output.writeStructEnd();
530
- return;
531
- }
532
-
533
- };
534
- const DependencyParse = module.exports.DependencyParse = class {
535
- constructor(args) {
536
- this.uuid = null;
537
- this.metadata = null;
538
- this.dependencyList = null;
539
- this.structureInformation = null;
540
- if (args) {
541
- if (args.uuid !== undefined && args.uuid !== null) {
542
- this.uuid = new uuid_ttypes.UUID(args.uuid);
543
- } else {
544
- throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field uuid is unset!');
545
- }
546
- if (args.metadata !== undefined && args.metadata !== null) {
547
- this.metadata = new metadata_ttypes.AnnotationMetadata(args.metadata);
548
- } else {
549
- throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field metadata is unset!');
550
- }
551
- if (args.dependencyList !== undefined && args.dependencyList !== null) {
552
- this.dependencyList = Thrift.copyList(args.dependencyList, [ttypes.Dependency]);
553
- } else {
554
- throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field dependencyList is unset!');
555
- }
556
- if (args.structureInformation !== undefined && args.structureInformation !== null) {
557
- this.structureInformation = new ttypes.DependencyParseStructure(args.structureInformation);
558
- }
559
- }
560
- }
561
-
562
- read (input) {
563
- input.readStructBegin();
564
- while (true) {
565
- const ret = input.readFieldBegin();
566
- const ftype = ret.ftype;
567
- const fid = ret.fid;
568
- if (ftype == Thrift.Type.STOP) {
569
- break;
570
- }
571
- switch (fid) {
572
- case 1:
573
- if (ftype == Thrift.Type.STRUCT) {
574
- this.uuid = new uuid_ttypes.UUID();
575
- this.uuid.read(input);
576
- } else {
577
- input.skip(ftype);
578
- }
579
- break;
580
- case 2:
581
- if (ftype == Thrift.Type.STRUCT) {
582
- this.metadata = new metadata_ttypes.AnnotationMetadata();
583
- this.metadata.read(input);
584
- } else {
585
- input.skip(ftype);
586
- }
587
- break;
588
- case 3:
589
- if (ftype == Thrift.Type.LIST) {
590
- this.dependencyList = [];
591
- const _rtmp311 = input.readListBegin();
592
- const _size10 = _rtmp311.size || 0;
593
- for (let _i12 = 0; _i12 < _size10; ++_i12) {
594
- let elem13 = null;
595
- elem13 = new ttypes.Dependency();
596
- elem13.read(input);
597
- this.dependencyList.push(elem13);
598
- }
599
- input.readListEnd();
600
- } else {
601
- input.skip(ftype);
602
- }
603
- break;
604
- case 4:
605
- if (ftype == Thrift.Type.STRUCT) {
606
- this.structureInformation = new ttypes.DependencyParseStructure();
607
- this.structureInformation.read(input);
608
- } else {
609
- input.skip(ftype);
610
- }
611
- break;
612
- default:
613
- input.skip(ftype);
614
- }
615
- input.readFieldEnd();
616
- }
617
- input.readStructEnd();
618
- return;
619
- }
620
-
621
- write (output) {
622
- output.writeStructBegin('DependencyParse');
623
- if (this.uuid !== null && this.uuid !== undefined) {
624
- output.writeFieldBegin('uuid', Thrift.Type.STRUCT, 1);
625
- this.uuid.write(output);
626
- output.writeFieldEnd();
627
- }
628
- if (this.metadata !== null && this.metadata !== undefined) {
629
- output.writeFieldBegin('metadata', Thrift.Type.STRUCT, 2);
630
- this.metadata.write(output);
631
- output.writeFieldEnd();
632
- }
633
- if (this.dependencyList !== null && this.dependencyList !== undefined) {
634
- output.writeFieldBegin('dependencyList', Thrift.Type.LIST, 3);
635
- output.writeListBegin(Thrift.Type.STRUCT, this.dependencyList.length);
636
- for (let iter14 in this.dependencyList) {
637
- if (this.dependencyList.hasOwnProperty(iter14)) {
638
- iter14 = this.dependencyList[iter14];
639
- iter14.write(output);
640
- }
641
- }
642
- output.writeListEnd();
643
- output.writeFieldEnd();
644
- }
645
- if (this.structureInformation !== null && this.structureInformation !== undefined) {
646
- output.writeFieldBegin('structureInformation', Thrift.Type.STRUCT, 4);
647
- this.structureInformation.write(output);
648
- output.writeFieldEnd();
649
- }
650
- output.writeFieldStop();
651
- output.writeStructEnd();
652
- return;
653
- }
654
-
655
- };
656
- const Token = module.exports.Token = class {
657
- constructor(args) {
658
- this.tokenIndex = null;
659
- this.text = null;
660
- this.textSpan = null;
661
- this.rawTextSpan = null;
662
- this.audioSpan = null;
663
- if (args) {
664
- if (args.tokenIndex !== undefined && args.tokenIndex !== null) {
665
- this.tokenIndex = args.tokenIndex;
666
- } else {
667
- throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field tokenIndex is unset!');
668
- }
669
- if (args.text !== undefined && args.text !== null) {
670
- this.text = args.text;
671
- }
672
- if (args.textSpan !== undefined && args.textSpan !== null) {
673
- this.textSpan = new spans_ttypes.TextSpan(args.textSpan);
674
- }
675
- if (args.rawTextSpan !== undefined && args.rawTextSpan !== null) {
676
- this.rawTextSpan = new spans_ttypes.TextSpan(args.rawTextSpan);
677
- }
678
- if (args.audioSpan !== undefined && args.audioSpan !== null) {
679
- this.audioSpan = new spans_ttypes.AudioSpan(args.audioSpan);
680
- }
681
- }
682
- }
683
-
684
- read (input) {
685
- input.readStructBegin();
686
- while (true) {
687
- const ret = input.readFieldBegin();
688
- const ftype = ret.ftype;
689
- const fid = ret.fid;
690
- if (ftype == Thrift.Type.STOP) {
691
- break;
692
- }
693
- switch (fid) {
694
- case 1:
695
- if (ftype == Thrift.Type.I32) {
696
- this.tokenIndex = input.readI32();
697
- } else {
698
- input.skip(ftype);
699
- }
700
- break;
701
- case 2:
702
- if (ftype == Thrift.Type.STRING) {
703
- this.text = input.readString();
704
- } else {
705
- input.skip(ftype);
706
- }
707
- break;
708
- case 3:
709
- if (ftype == Thrift.Type.STRUCT) {
710
- this.textSpan = new spans_ttypes.TextSpan();
711
- this.textSpan.read(input);
712
- } else {
713
- input.skip(ftype);
714
- }
715
- break;
716
- case 4:
717
- if (ftype == Thrift.Type.STRUCT) {
718
- this.rawTextSpan = new spans_ttypes.TextSpan();
719
- this.rawTextSpan.read(input);
720
- } else {
721
- input.skip(ftype);
722
- }
723
- break;
724
- case 5:
725
- if (ftype == Thrift.Type.STRUCT) {
726
- this.audioSpan = new spans_ttypes.AudioSpan();
727
- this.audioSpan.read(input);
728
- } else {
729
- input.skip(ftype);
730
- }
731
- break;
732
- default:
733
- input.skip(ftype);
734
- }
735
- input.readFieldEnd();
736
- }
737
- input.readStructEnd();
738
- return;
739
- }
740
-
741
- write (output) {
742
- output.writeStructBegin('Token');
743
- if (this.tokenIndex !== null && this.tokenIndex !== undefined) {
744
- output.writeFieldBegin('tokenIndex', Thrift.Type.I32, 1);
745
- output.writeI32(this.tokenIndex);
746
- output.writeFieldEnd();
747
- }
748
- if (this.text !== null && this.text !== undefined) {
749
- output.writeFieldBegin('text', Thrift.Type.STRING, 2);
750
- output.writeString(this.text);
751
- output.writeFieldEnd();
752
- }
753
- if (this.textSpan !== null && this.textSpan !== undefined) {
754
- output.writeFieldBegin('textSpan', Thrift.Type.STRUCT, 3);
755
- this.textSpan.write(output);
756
- output.writeFieldEnd();
757
- }
758
- if (this.rawTextSpan !== null && this.rawTextSpan !== undefined) {
759
- output.writeFieldBegin('rawTextSpan', Thrift.Type.STRUCT, 4);
760
- this.rawTextSpan.write(output);
761
- output.writeFieldEnd();
762
- }
763
- if (this.audioSpan !== null && this.audioSpan !== undefined) {
764
- output.writeFieldBegin('audioSpan', Thrift.Type.STRUCT, 5);
765
- this.audioSpan.write(output);
766
- output.writeFieldEnd();
767
- }
768
- output.writeFieldStop();
769
- output.writeStructEnd();
770
- return;
771
- }
772
-
773
- };
774
- const TokenRefSequence = module.exports.TokenRefSequence = class {
775
- constructor(args) {
776
- this.tokenIndexList = null;
777
- this.anchorTokenIndex = -1;
778
- this.tokenizationId = null;
779
- this.textSpan = null;
780
- this.rawTextSpan = null;
781
- this.audioSpan = null;
782
- this.dependencies = null;
783
- this.constituent = null;
784
- if (args) {
785
- if (args.tokenIndexList !== undefined && args.tokenIndexList !== null) {
786
- this.tokenIndexList = Thrift.copyList(args.tokenIndexList, [null]);
787
- } else {
788
- throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field tokenIndexList is unset!');
789
- }
790
- if (args.anchorTokenIndex !== undefined && args.anchorTokenIndex !== null) {
791
- this.anchorTokenIndex = args.anchorTokenIndex;
792
- }
793
- if (args.tokenizationId !== undefined && args.tokenizationId !== null) {
794
- this.tokenizationId = new uuid_ttypes.UUID(args.tokenizationId);
795
- } else {
796
- throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field tokenizationId is unset!');
797
- }
798
- if (args.textSpan !== undefined && args.textSpan !== null) {
799
- this.textSpan = new spans_ttypes.TextSpan(args.textSpan);
800
- }
801
- if (args.rawTextSpan !== undefined && args.rawTextSpan !== null) {
802
- this.rawTextSpan = new spans_ttypes.TextSpan(args.rawTextSpan);
803
- }
804
- if (args.audioSpan !== undefined && args.audioSpan !== null) {
805
- this.audioSpan = new spans_ttypes.AudioSpan(args.audioSpan);
806
- }
807
- if (args.dependencies !== undefined && args.dependencies !== null) {
808
- this.dependencies = Thrift.copyList(args.dependencies, [ttypes.Dependency]);
809
- }
810
- if (args.constituent !== undefined && args.constituent !== null) {
811
- this.constituent = new ttypes.ConstituentRef(args.constituent);
812
- }
813
- }
814
- }
815
-
816
- read (input) {
817
- input.readStructBegin();
818
- while (true) {
819
- const ret = input.readFieldBegin();
820
- const ftype = ret.ftype;
821
- const fid = ret.fid;
822
- if (ftype == Thrift.Type.STOP) {
823
- break;
824
- }
825
- switch (fid) {
826
- case 1:
827
- if (ftype == Thrift.Type.LIST) {
828
- this.tokenIndexList = [];
829
- const _rtmp316 = input.readListBegin();
830
- const _size15 = _rtmp316.size || 0;
831
- for (let _i17 = 0; _i17 < _size15; ++_i17) {
832
- let elem18 = null;
833
- elem18 = input.readI32();
834
- this.tokenIndexList.push(elem18);
835
- }
836
- input.readListEnd();
837
- } else {
838
- input.skip(ftype);
839
- }
840
- break;
841
- case 2:
842
- if (ftype == Thrift.Type.I32) {
843
- this.anchorTokenIndex = input.readI32();
844
- } else {
845
- input.skip(ftype);
846
- }
847
- break;
848
- case 3:
849
- if (ftype == Thrift.Type.STRUCT) {
850
- this.tokenizationId = new uuid_ttypes.UUID();
851
- this.tokenizationId.read(input);
852
- } else {
853
- input.skip(ftype);
854
- }
855
- break;
856
- case 4:
857
- if (ftype == Thrift.Type.STRUCT) {
858
- this.textSpan = new spans_ttypes.TextSpan();
859
- this.textSpan.read(input);
860
- } else {
861
- input.skip(ftype);
862
- }
863
- break;
864
- case 5:
865
- if (ftype == Thrift.Type.STRUCT) {
866
- this.rawTextSpan = new spans_ttypes.TextSpan();
867
- this.rawTextSpan.read(input);
868
- } else {
869
- input.skip(ftype);
870
- }
871
- break;
872
- case 6:
873
- if (ftype == Thrift.Type.STRUCT) {
874
- this.audioSpan = new spans_ttypes.AudioSpan();
875
- this.audioSpan.read(input);
876
- } else {
877
- input.skip(ftype);
878
- }
879
- break;
880
- case 7:
881
- if (ftype == Thrift.Type.LIST) {
882
- this.dependencies = [];
883
- const _rtmp320 = input.readListBegin();
884
- const _size19 = _rtmp320.size || 0;
885
- for (let _i21 = 0; _i21 < _size19; ++_i21) {
886
- let elem22 = null;
887
- elem22 = new ttypes.Dependency();
888
- elem22.read(input);
889
- this.dependencies.push(elem22);
890
- }
891
- input.readListEnd();
892
- } else {
893
- input.skip(ftype);
894
- }
895
- break;
896
- case 8:
897
- if (ftype == Thrift.Type.STRUCT) {
898
- this.constituent = new ttypes.ConstituentRef();
899
- this.constituent.read(input);
900
- } else {
901
- input.skip(ftype);
902
- }
903
- break;
904
- default:
905
- input.skip(ftype);
906
- }
907
- input.readFieldEnd();
908
- }
909
- input.readStructEnd();
910
- return;
911
- }
912
-
913
- write (output) {
914
- output.writeStructBegin('TokenRefSequence');
915
- if (this.tokenIndexList !== null && this.tokenIndexList !== undefined) {
916
- output.writeFieldBegin('tokenIndexList', Thrift.Type.LIST, 1);
917
- output.writeListBegin(Thrift.Type.I32, this.tokenIndexList.length);
918
- for (let iter23 in this.tokenIndexList) {
919
- if (this.tokenIndexList.hasOwnProperty(iter23)) {
920
- iter23 = this.tokenIndexList[iter23];
921
- output.writeI32(iter23);
922
- }
923
- }
924
- output.writeListEnd();
925
- output.writeFieldEnd();
926
- }
927
- if (this.anchorTokenIndex !== null && this.anchorTokenIndex !== undefined) {
928
- output.writeFieldBegin('anchorTokenIndex', Thrift.Type.I32, 2);
929
- output.writeI32(this.anchorTokenIndex);
930
- output.writeFieldEnd();
931
- }
932
- if (this.tokenizationId !== null && this.tokenizationId !== undefined) {
933
- output.writeFieldBegin('tokenizationId', Thrift.Type.STRUCT, 3);
934
- this.tokenizationId.write(output);
935
- output.writeFieldEnd();
936
- }
937
- if (this.textSpan !== null && this.textSpan !== undefined) {
938
- output.writeFieldBegin('textSpan', Thrift.Type.STRUCT, 4);
939
- this.textSpan.write(output);
940
- output.writeFieldEnd();
941
- }
942
- if (this.rawTextSpan !== null && this.rawTextSpan !== undefined) {
943
- output.writeFieldBegin('rawTextSpan', Thrift.Type.STRUCT, 5);
944
- this.rawTextSpan.write(output);
945
- output.writeFieldEnd();
946
- }
947
- if (this.audioSpan !== null && this.audioSpan !== undefined) {
948
- output.writeFieldBegin('audioSpan', Thrift.Type.STRUCT, 6);
949
- this.audioSpan.write(output);
950
- output.writeFieldEnd();
951
- }
952
- if (this.dependencies !== null && this.dependencies !== undefined) {
953
- output.writeFieldBegin('dependencies', Thrift.Type.LIST, 7);
954
- output.writeListBegin(Thrift.Type.STRUCT, this.dependencies.length);
955
- for (let iter24 in this.dependencies) {
956
- if (this.dependencies.hasOwnProperty(iter24)) {
957
- iter24 = this.dependencies[iter24];
958
- iter24.write(output);
959
- }
960
- }
961
- output.writeListEnd();
962
- output.writeFieldEnd();
963
- }
964
- if (this.constituent !== null && this.constituent !== undefined) {
965
- output.writeFieldBegin('constituent', Thrift.Type.STRUCT, 8);
966
- this.constituent.write(output);
967
- output.writeFieldEnd();
968
- }
969
- output.writeFieldStop();
970
- output.writeStructEnd();
971
- return;
972
- }
973
-
974
- };
975
- const TaggedToken = module.exports.TaggedToken = class {
976
- constructor(args) {
977
- this.tokenIndex = null;
978
- this.tag = null;
979
- this.confidence = null;
980
- this.tagList = null;
981
- this.confidenceList = null;
982
- if (args) {
983
- if (args.tokenIndex !== undefined && args.tokenIndex !== null) {
984
- this.tokenIndex = args.tokenIndex;
985
- }
986
- if (args.tag !== undefined && args.tag !== null) {
987
- this.tag = args.tag;
988
- }
989
- if (args.confidence !== undefined && args.confidence !== null) {
990
- this.confidence = args.confidence;
991
- }
992
- if (args.tagList !== undefined && args.tagList !== null) {
993
- this.tagList = Thrift.copyList(args.tagList, [null]);
994
- }
995
- if (args.confidenceList !== undefined && args.confidenceList !== null) {
996
- this.confidenceList = Thrift.copyList(args.confidenceList, [null]);
997
- }
998
- }
999
- }
1000
-
1001
- read (input) {
1002
- input.readStructBegin();
1003
- while (true) {
1004
- const ret = input.readFieldBegin();
1005
- const ftype = ret.ftype;
1006
- const fid = ret.fid;
1007
- if (ftype == Thrift.Type.STOP) {
1008
- break;
1009
- }
1010
- switch (fid) {
1011
- case 1:
1012
- if (ftype == Thrift.Type.I32) {
1013
- this.tokenIndex = input.readI32();
1014
- } else {
1015
- input.skip(ftype);
1016
- }
1017
- break;
1018
- case 2:
1019
- if (ftype == Thrift.Type.STRING) {
1020
- this.tag = input.readString();
1021
- } else {
1022
- input.skip(ftype);
1023
- }
1024
- break;
1025
- case 3:
1026
- if (ftype == Thrift.Type.DOUBLE) {
1027
- this.confidence = input.readDouble();
1028
- } else {
1029
- input.skip(ftype);
1030
- }
1031
- break;
1032
- case 4:
1033
- if (ftype == Thrift.Type.LIST) {
1034
- this.tagList = [];
1035
- const _rtmp326 = input.readListBegin();
1036
- const _size25 = _rtmp326.size || 0;
1037
- for (let _i27 = 0; _i27 < _size25; ++_i27) {
1038
- let elem28 = null;
1039
- elem28 = input.readString();
1040
- this.tagList.push(elem28);
1041
- }
1042
- input.readListEnd();
1043
- } else {
1044
- input.skip(ftype);
1045
- }
1046
- break;
1047
- case 5:
1048
- if (ftype == Thrift.Type.LIST) {
1049
- this.confidenceList = [];
1050
- const _rtmp330 = input.readListBegin();
1051
- const _size29 = _rtmp330.size || 0;
1052
- for (let _i31 = 0; _i31 < _size29; ++_i31) {
1053
- let elem32 = null;
1054
- elem32 = input.readDouble();
1055
- this.confidenceList.push(elem32);
1056
- }
1057
- input.readListEnd();
1058
- } else {
1059
- input.skip(ftype);
1060
- }
1061
- break;
1062
- default:
1063
- input.skip(ftype);
1064
- }
1065
- input.readFieldEnd();
1066
- }
1067
- input.readStructEnd();
1068
- return;
1069
- }
1070
-
1071
- write (output) {
1072
- output.writeStructBegin('TaggedToken');
1073
- if (this.tokenIndex !== null && this.tokenIndex !== undefined) {
1074
- output.writeFieldBegin('tokenIndex', Thrift.Type.I32, 1);
1075
- output.writeI32(this.tokenIndex);
1076
- output.writeFieldEnd();
1077
- }
1078
- if (this.tag !== null && this.tag !== undefined) {
1079
- output.writeFieldBegin('tag', Thrift.Type.STRING, 2);
1080
- output.writeString(this.tag);
1081
- output.writeFieldEnd();
1082
- }
1083
- if (this.confidence !== null && this.confidence !== undefined) {
1084
- output.writeFieldBegin('confidence', Thrift.Type.DOUBLE, 3);
1085
- output.writeDouble(this.confidence);
1086
- output.writeFieldEnd();
1087
- }
1088
- if (this.tagList !== null && this.tagList !== undefined) {
1089
- output.writeFieldBegin('tagList', Thrift.Type.LIST, 4);
1090
- output.writeListBegin(Thrift.Type.STRING, this.tagList.length);
1091
- for (let iter33 in this.tagList) {
1092
- if (this.tagList.hasOwnProperty(iter33)) {
1093
- iter33 = this.tagList[iter33];
1094
- output.writeString(iter33);
1095
- }
1096
- }
1097
- output.writeListEnd();
1098
- output.writeFieldEnd();
1099
- }
1100
- if (this.confidenceList !== null && this.confidenceList !== undefined) {
1101
- output.writeFieldBegin('confidenceList', Thrift.Type.LIST, 5);
1102
- output.writeListBegin(Thrift.Type.DOUBLE, this.confidenceList.length);
1103
- for (let iter34 in this.confidenceList) {
1104
- if (this.confidenceList.hasOwnProperty(iter34)) {
1105
- iter34 = this.confidenceList[iter34];
1106
- output.writeDouble(iter34);
1107
- }
1108
- }
1109
- output.writeListEnd();
1110
- output.writeFieldEnd();
1111
- }
1112
- output.writeFieldStop();
1113
- output.writeStructEnd();
1114
- return;
1115
- }
1116
-
1117
- };
1118
- const TokenTagging = module.exports.TokenTagging = class {
1119
- constructor(args) {
1120
- this.uuid = null;
1121
- this.metadata = null;
1122
- this.taggedTokenList = null;
1123
- this.taggingType = null;
1124
- if (args) {
1125
- if (args.uuid !== undefined && args.uuid !== null) {
1126
- this.uuid = new uuid_ttypes.UUID(args.uuid);
1127
- } else {
1128
- throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field uuid is unset!');
1129
- }
1130
- if (args.metadata !== undefined && args.metadata !== null) {
1131
- this.metadata = new metadata_ttypes.AnnotationMetadata(args.metadata);
1132
- } else {
1133
- throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field metadata is unset!');
1134
- }
1135
- if (args.taggedTokenList !== undefined && args.taggedTokenList !== null) {
1136
- this.taggedTokenList = Thrift.copyList(args.taggedTokenList, [ttypes.TaggedToken]);
1137
- } else {
1138
- throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field taggedTokenList is unset!');
1139
- }
1140
- if (args.taggingType !== undefined && args.taggingType !== null) {
1141
- this.taggingType = args.taggingType;
1142
- }
1143
- }
1144
- }
1145
-
1146
- read (input) {
1147
- input.readStructBegin();
1148
- while (true) {
1149
- const ret = input.readFieldBegin();
1150
- const ftype = ret.ftype;
1151
- const fid = ret.fid;
1152
- if (ftype == Thrift.Type.STOP) {
1153
- break;
1154
- }
1155
- switch (fid) {
1156
- case 1:
1157
- if (ftype == Thrift.Type.STRUCT) {
1158
- this.uuid = new uuid_ttypes.UUID();
1159
- this.uuid.read(input);
1160
- } else {
1161
- input.skip(ftype);
1162
- }
1163
- break;
1164
- case 2:
1165
- if (ftype == Thrift.Type.STRUCT) {
1166
- this.metadata = new metadata_ttypes.AnnotationMetadata();
1167
- this.metadata.read(input);
1168
- } else {
1169
- input.skip(ftype);
1170
- }
1171
- break;
1172
- case 3:
1173
- if (ftype == Thrift.Type.LIST) {
1174
- this.taggedTokenList = [];
1175
- const _rtmp336 = input.readListBegin();
1176
- const _size35 = _rtmp336.size || 0;
1177
- for (let _i37 = 0; _i37 < _size35; ++_i37) {
1178
- let elem38 = null;
1179
- elem38 = new ttypes.TaggedToken();
1180
- elem38.read(input);
1181
- this.taggedTokenList.push(elem38);
1182
- }
1183
- input.readListEnd();
1184
- } else {
1185
- input.skip(ftype);
1186
- }
1187
- break;
1188
- case 4:
1189
- if (ftype == Thrift.Type.STRING) {
1190
- this.taggingType = input.readString();
1191
- } else {
1192
- input.skip(ftype);
1193
- }
1194
- break;
1195
- default:
1196
- input.skip(ftype);
1197
- }
1198
- input.readFieldEnd();
1199
- }
1200
- input.readStructEnd();
1201
- return;
1202
- }
1203
-
1204
- write (output) {
1205
- output.writeStructBegin('TokenTagging');
1206
- if (this.uuid !== null && this.uuid !== undefined) {
1207
- output.writeFieldBegin('uuid', Thrift.Type.STRUCT, 1);
1208
- this.uuid.write(output);
1209
- output.writeFieldEnd();
1210
- }
1211
- if (this.metadata !== null && this.metadata !== undefined) {
1212
- output.writeFieldBegin('metadata', Thrift.Type.STRUCT, 2);
1213
- this.metadata.write(output);
1214
- output.writeFieldEnd();
1215
- }
1216
- if (this.taggedTokenList !== null && this.taggedTokenList !== undefined) {
1217
- output.writeFieldBegin('taggedTokenList', Thrift.Type.LIST, 3);
1218
- output.writeListBegin(Thrift.Type.STRUCT, this.taggedTokenList.length);
1219
- for (let iter39 in this.taggedTokenList) {
1220
- if (this.taggedTokenList.hasOwnProperty(iter39)) {
1221
- iter39 = this.taggedTokenList[iter39];
1222
- iter39.write(output);
1223
- }
1224
- }
1225
- output.writeListEnd();
1226
- output.writeFieldEnd();
1227
- }
1228
- if (this.taggingType !== null && this.taggingType !== undefined) {
1229
- output.writeFieldBegin('taggingType', Thrift.Type.STRING, 4);
1230
- output.writeString(this.taggingType);
1231
- output.writeFieldEnd();
1232
- }
1233
- output.writeFieldStop();
1234
- output.writeStructEnd();
1235
- return;
1236
- }
1237
-
1238
- };
1239
- const LatticePath = module.exports.LatticePath = class {
1240
- constructor(args) {
1241
- this.weight = null;
1242
- this.tokenList = null;
1243
- if (args) {
1244
- if (args.weight !== undefined && args.weight !== null) {
1245
- this.weight = args.weight;
1246
- }
1247
- if (args.tokenList !== undefined && args.tokenList !== null) {
1248
- this.tokenList = Thrift.copyList(args.tokenList, [ttypes.Token]);
1249
- } else {
1250
- throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field tokenList is unset!');
1251
- }
1252
- }
1253
- }
1254
-
1255
- read (input) {
1256
- input.readStructBegin();
1257
- while (true) {
1258
- const ret = input.readFieldBegin();
1259
- const ftype = ret.ftype;
1260
- const fid = ret.fid;
1261
- if (ftype == Thrift.Type.STOP) {
1262
- break;
1263
- }
1264
- switch (fid) {
1265
- case 1:
1266
- if (ftype == Thrift.Type.DOUBLE) {
1267
- this.weight = input.readDouble();
1268
- } else {
1269
- input.skip(ftype);
1270
- }
1271
- break;
1272
- case 2:
1273
- if (ftype == Thrift.Type.LIST) {
1274
- this.tokenList = [];
1275
- const _rtmp341 = input.readListBegin();
1276
- const _size40 = _rtmp341.size || 0;
1277
- for (let _i42 = 0; _i42 < _size40; ++_i42) {
1278
- let elem43 = null;
1279
- elem43 = new ttypes.Token();
1280
- elem43.read(input);
1281
- this.tokenList.push(elem43);
1282
- }
1283
- input.readListEnd();
1284
- } else {
1285
- input.skip(ftype);
1286
- }
1287
- break;
1288
- default:
1289
- input.skip(ftype);
1290
- }
1291
- input.readFieldEnd();
1292
- }
1293
- input.readStructEnd();
1294
- return;
1295
- }
1296
-
1297
- write (output) {
1298
- output.writeStructBegin('LatticePath');
1299
- if (this.weight !== null && this.weight !== undefined) {
1300
- output.writeFieldBegin('weight', Thrift.Type.DOUBLE, 1);
1301
- output.writeDouble(this.weight);
1302
- output.writeFieldEnd();
1303
- }
1304
- if (this.tokenList !== null && this.tokenList !== undefined) {
1305
- output.writeFieldBegin('tokenList', Thrift.Type.LIST, 2);
1306
- output.writeListBegin(Thrift.Type.STRUCT, this.tokenList.length);
1307
- for (let iter44 in this.tokenList) {
1308
- if (this.tokenList.hasOwnProperty(iter44)) {
1309
- iter44 = this.tokenList[iter44];
1310
- iter44.write(output);
1311
- }
1312
- }
1313
- output.writeListEnd();
1314
- output.writeFieldEnd();
1315
- }
1316
- output.writeFieldStop();
1317
- output.writeStructEnd();
1318
- return;
1319
- }
1320
-
1321
- };
1322
- const Arc = module.exports.Arc = class {
1323
- constructor(args) {
1324
- this.src = null;
1325
- this.dst = null;
1326
- this.token = null;
1327
- this.weight = null;
1328
- if (args) {
1329
- if (args.src !== undefined && args.src !== null) {
1330
- this.src = args.src;
1331
- }
1332
- if (args.dst !== undefined && args.dst !== null) {
1333
- this.dst = args.dst;
1334
- }
1335
- if (args.token !== undefined && args.token !== null) {
1336
- this.token = new ttypes.Token(args.token);
1337
- }
1338
- if (args.weight !== undefined && args.weight !== null) {
1339
- this.weight = args.weight;
1340
- }
1341
- }
1342
- }
1343
-
1344
- read (input) {
1345
- input.readStructBegin();
1346
- while (true) {
1347
- const ret = input.readFieldBegin();
1348
- const ftype = ret.ftype;
1349
- const fid = ret.fid;
1350
- if (ftype == Thrift.Type.STOP) {
1351
- break;
1352
- }
1353
- switch (fid) {
1354
- case 1:
1355
- if (ftype == Thrift.Type.I32) {
1356
- this.src = input.readI32();
1357
- } else {
1358
- input.skip(ftype);
1359
- }
1360
- break;
1361
- case 2:
1362
- if (ftype == Thrift.Type.I32) {
1363
- this.dst = input.readI32();
1364
- } else {
1365
- input.skip(ftype);
1366
- }
1367
- break;
1368
- case 3:
1369
- if (ftype == Thrift.Type.STRUCT) {
1370
- this.token = new ttypes.Token();
1371
- this.token.read(input);
1372
- } else {
1373
- input.skip(ftype);
1374
- }
1375
- break;
1376
- case 4:
1377
- if (ftype == Thrift.Type.DOUBLE) {
1378
- this.weight = input.readDouble();
1379
- } else {
1380
- input.skip(ftype);
1381
- }
1382
- break;
1383
- default:
1384
- input.skip(ftype);
1385
- }
1386
- input.readFieldEnd();
1387
- }
1388
- input.readStructEnd();
1389
- return;
1390
- }
1391
-
1392
- write (output) {
1393
- output.writeStructBegin('Arc');
1394
- if (this.src !== null && this.src !== undefined) {
1395
- output.writeFieldBegin('src', Thrift.Type.I32, 1);
1396
- output.writeI32(this.src);
1397
- output.writeFieldEnd();
1398
- }
1399
- if (this.dst !== null && this.dst !== undefined) {
1400
- output.writeFieldBegin('dst', Thrift.Type.I32, 2);
1401
- output.writeI32(this.dst);
1402
- output.writeFieldEnd();
1403
- }
1404
- if (this.token !== null && this.token !== undefined) {
1405
- output.writeFieldBegin('token', Thrift.Type.STRUCT, 3);
1406
- this.token.write(output);
1407
- output.writeFieldEnd();
1408
- }
1409
- if (this.weight !== null && this.weight !== undefined) {
1410
- output.writeFieldBegin('weight', Thrift.Type.DOUBLE, 4);
1411
- output.writeDouble(this.weight);
1412
- output.writeFieldEnd();
1413
- }
1414
- output.writeFieldStop();
1415
- output.writeStructEnd();
1416
- return;
1417
- }
1418
-
1419
- };
1420
- const TokenLattice = module.exports.TokenLattice = class {
1421
- constructor(args) {
1422
- this.startState = 0;
1423
- this.endState = 0;
1424
- this.arcList = null;
1425
- this.cachedBestPath = null;
1426
- if (args) {
1427
- if (args.startState !== undefined && args.startState !== null) {
1428
- this.startState = args.startState;
1429
- }
1430
- if (args.endState !== undefined && args.endState !== null) {
1431
- this.endState = args.endState;
1432
- }
1433
- if (args.arcList !== undefined && args.arcList !== null) {
1434
- this.arcList = Thrift.copyList(args.arcList, [ttypes.Arc]);
1435
- } else {
1436
- throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field arcList is unset!');
1437
- }
1438
- if (args.cachedBestPath !== undefined && args.cachedBestPath !== null) {
1439
- this.cachedBestPath = new ttypes.LatticePath(args.cachedBestPath);
1440
- }
1441
- }
1442
- }
1443
-
1444
- read (input) {
1445
- input.readStructBegin();
1446
- while (true) {
1447
- const ret = input.readFieldBegin();
1448
- const ftype = ret.ftype;
1449
- const fid = ret.fid;
1450
- if (ftype == Thrift.Type.STOP) {
1451
- break;
1452
- }
1453
- switch (fid) {
1454
- case 1:
1455
- if (ftype == Thrift.Type.I32) {
1456
- this.startState = input.readI32();
1457
- } else {
1458
- input.skip(ftype);
1459
- }
1460
- break;
1461
- case 2:
1462
- if (ftype == Thrift.Type.I32) {
1463
- this.endState = input.readI32();
1464
- } else {
1465
- input.skip(ftype);
1466
- }
1467
- break;
1468
- case 3:
1469
- if (ftype == Thrift.Type.LIST) {
1470
- this.arcList = [];
1471
- const _rtmp346 = input.readListBegin();
1472
- const _size45 = _rtmp346.size || 0;
1473
- for (let _i47 = 0; _i47 < _size45; ++_i47) {
1474
- let elem48 = null;
1475
- elem48 = new ttypes.Arc();
1476
- elem48.read(input);
1477
- this.arcList.push(elem48);
1478
- }
1479
- input.readListEnd();
1480
- } else {
1481
- input.skip(ftype);
1482
- }
1483
- break;
1484
- case 4:
1485
- if (ftype == Thrift.Type.STRUCT) {
1486
- this.cachedBestPath = new ttypes.LatticePath();
1487
- this.cachedBestPath.read(input);
1488
- } else {
1489
- input.skip(ftype);
1490
- }
1491
- break;
1492
- default:
1493
- input.skip(ftype);
1494
- }
1495
- input.readFieldEnd();
1496
- }
1497
- input.readStructEnd();
1498
- return;
1499
- }
1500
-
1501
- write (output) {
1502
- output.writeStructBegin('TokenLattice');
1503
- if (this.startState !== null && this.startState !== undefined) {
1504
- output.writeFieldBegin('startState', Thrift.Type.I32, 1);
1505
- output.writeI32(this.startState);
1506
- output.writeFieldEnd();
1507
- }
1508
- if (this.endState !== null && this.endState !== undefined) {
1509
- output.writeFieldBegin('endState', Thrift.Type.I32, 2);
1510
- output.writeI32(this.endState);
1511
- output.writeFieldEnd();
1512
- }
1513
- if (this.arcList !== null && this.arcList !== undefined) {
1514
- output.writeFieldBegin('arcList', Thrift.Type.LIST, 3);
1515
- output.writeListBegin(Thrift.Type.STRUCT, this.arcList.length);
1516
- for (let iter49 in this.arcList) {
1517
- if (this.arcList.hasOwnProperty(iter49)) {
1518
- iter49 = this.arcList[iter49];
1519
- iter49.write(output);
1520
- }
1521
- }
1522
- output.writeListEnd();
1523
- output.writeFieldEnd();
1524
- }
1525
- if (this.cachedBestPath !== null && this.cachedBestPath !== undefined) {
1526
- output.writeFieldBegin('cachedBestPath', Thrift.Type.STRUCT, 4);
1527
- this.cachedBestPath.write(output);
1528
- output.writeFieldEnd();
1529
- }
1530
- output.writeFieldStop();
1531
- output.writeStructEnd();
1532
- return;
1533
- }
1534
-
1535
- };
1536
- const TokenList = module.exports.TokenList = class {
1537
- constructor(args) {
1538
- this.tokenList = null;
1539
- if (args) {
1540
- if (args.tokenList !== undefined && args.tokenList !== null) {
1541
- this.tokenList = Thrift.copyList(args.tokenList, [ttypes.Token]);
1542
- } else {
1543
- throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field tokenList is unset!');
1544
- }
1545
- }
1546
- }
1547
-
1548
- read (input) {
1549
- input.readStructBegin();
1550
- while (true) {
1551
- const ret = input.readFieldBegin();
1552
- const ftype = ret.ftype;
1553
- const fid = ret.fid;
1554
- if (ftype == Thrift.Type.STOP) {
1555
- break;
1556
- }
1557
- switch (fid) {
1558
- case 1:
1559
- if (ftype == Thrift.Type.LIST) {
1560
- this.tokenList = [];
1561
- const _rtmp351 = input.readListBegin();
1562
- const _size50 = _rtmp351.size || 0;
1563
- for (let _i52 = 0; _i52 < _size50; ++_i52) {
1564
- let elem53 = null;
1565
- elem53 = new ttypes.Token();
1566
- elem53.read(input);
1567
- this.tokenList.push(elem53);
1568
- }
1569
- input.readListEnd();
1570
- } else {
1571
- input.skip(ftype);
1572
- }
1573
- break;
1574
- case 0:
1575
- input.skip(ftype);
1576
- break;
1577
- default:
1578
- input.skip(ftype);
1579
- }
1580
- input.readFieldEnd();
1581
- }
1582
- input.readStructEnd();
1583
- return;
1584
- }
1585
-
1586
- write (output) {
1587
- output.writeStructBegin('TokenList');
1588
- if (this.tokenList !== null && this.tokenList !== undefined) {
1589
- output.writeFieldBegin('tokenList', Thrift.Type.LIST, 1);
1590
- output.writeListBegin(Thrift.Type.STRUCT, this.tokenList.length);
1591
- for (let iter54 in this.tokenList) {
1592
- if (this.tokenList.hasOwnProperty(iter54)) {
1593
- iter54 = this.tokenList[iter54];
1594
- iter54.write(output);
1595
- }
1596
- }
1597
- output.writeListEnd();
1598
- output.writeFieldEnd();
1599
- }
1600
- output.writeFieldStop();
1601
- output.writeStructEnd();
1602
- return;
1603
- }
1604
-
1605
- };
1606
- const SpanLink = module.exports.SpanLink = class {
1607
- constructor(args) {
1608
- this.tokens = null;
1609
- this.concreteTarget = null;
1610
- this.externalTarget = null;
1611
- this.linkType = null;
1612
- if (args) {
1613
- if (args.tokens !== undefined && args.tokens !== null) {
1614
- this.tokens = new ttypes.TokenRefSequence(args.tokens);
1615
- } else {
1616
- throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field tokens is unset!');
1617
- }
1618
- if (args.concreteTarget !== undefined && args.concreteTarget !== null) {
1619
- this.concreteTarget = new uuid_ttypes.UUID(args.concreteTarget);
1620
- }
1621
- if (args.externalTarget !== undefined && args.externalTarget !== null) {
1622
- this.externalTarget = args.externalTarget;
1623
- }
1624
- if (args.linkType !== undefined && args.linkType !== null) {
1625
- this.linkType = args.linkType;
1626
- } else {
1627
- throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field linkType is unset!');
1628
- }
1629
- }
1630
- }
1631
-
1632
- read (input) {
1633
- input.readStructBegin();
1634
- while (true) {
1635
- const ret = input.readFieldBegin();
1636
- const ftype = ret.ftype;
1637
- const fid = ret.fid;
1638
- if (ftype == Thrift.Type.STOP) {
1639
- break;
1640
- }
1641
- switch (fid) {
1642
- case 1:
1643
- if (ftype == Thrift.Type.STRUCT) {
1644
- this.tokens = new ttypes.TokenRefSequence();
1645
- this.tokens.read(input);
1646
- } else {
1647
- input.skip(ftype);
1648
- }
1649
- break;
1650
- case 2:
1651
- if (ftype == Thrift.Type.STRUCT) {
1652
- this.concreteTarget = new uuid_ttypes.UUID();
1653
- this.concreteTarget.read(input);
1654
- } else {
1655
- input.skip(ftype);
1656
- }
1657
- break;
1658
- case 3:
1659
- if (ftype == Thrift.Type.STRING) {
1660
- this.externalTarget = input.readString();
1661
- } else {
1662
- input.skip(ftype);
1663
- }
1664
- break;
1665
- case 4:
1666
- if (ftype == Thrift.Type.STRING) {
1667
- this.linkType = input.readString();
1668
- } else {
1669
- input.skip(ftype);
1670
- }
1671
- break;
1672
- default:
1673
- input.skip(ftype);
1674
- }
1675
- input.readFieldEnd();
1676
- }
1677
- input.readStructEnd();
1678
- return;
1679
- }
1680
-
1681
- write (output) {
1682
- output.writeStructBegin('SpanLink');
1683
- if (this.tokens !== null && this.tokens !== undefined) {
1684
- output.writeFieldBegin('tokens', Thrift.Type.STRUCT, 1);
1685
- this.tokens.write(output);
1686
- output.writeFieldEnd();
1687
- }
1688
- if (this.concreteTarget !== null && this.concreteTarget !== undefined) {
1689
- output.writeFieldBegin('concreteTarget', Thrift.Type.STRUCT, 2);
1690
- this.concreteTarget.write(output);
1691
- output.writeFieldEnd();
1692
- }
1693
- if (this.externalTarget !== null && this.externalTarget !== undefined) {
1694
- output.writeFieldBegin('externalTarget', Thrift.Type.STRING, 3);
1695
- output.writeString(this.externalTarget);
1696
- output.writeFieldEnd();
1697
- }
1698
- if (this.linkType !== null && this.linkType !== undefined) {
1699
- output.writeFieldBegin('linkType', Thrift.Type.STRING, 4);
1700
- output.writeString(this.linkType);
1701
- output.writeFieldEnd();
1702
- }
1703
- output.writeFieldStop();
1704
- output.writeStructEnd();
1705
- return;
1706
- }
1707
-
1708
- };
1709
- const Tokenization = module.exports.Tokenization = class {
1710
- constructor(args) {
1711
- this.uuid = null;
1712
- this.metadata = null;
1713
- this.tokenList = null;
1714
- this.lattice = null;
1715
- this.kind = null;
1716
- this.tokenTaggingList = null;
1717
- this.parseList = null;
1718
- this.dependencyParseList = null;
1719
- this.spanLinkList = null;
1720
- if (args) {
1721
- if (args.uuid !== undefined && args.uuid !== null) {
1722
- this.uuid = new uuid_ttypes.UUID(args.uuid);
1723
- } else {
1724
- throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field uuid is unset!');
1725
- }
1726
- if (args.metadata !== undefined && args.metadata !== null) {
1727
- this.metadata = new metadata_ttypes.AnnotationMetadata(args.metadata);
1728
- } else {
1729
- throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field metadata is unset!');
1730
- }
1731
- if (args.tokenList !== undefined && args.tokenList !== null) {
1732
- this.tokenList = new ttypes.TokenList(args.tokenList);
1733
- }
1734
- if (args.lattice !== undefined && args.lattice !== null) {
1735
- this.lattice = new ttypes.TokenLattice(args.lattice);
1736
- }
1737
- if (args.kind !== undefined && args.kind !== null) {
1738
- this.kind = args.kind;
1739
- } else {
1740
- throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field kind is unset!');
1741
- }
1742
- if (args.tokenTaggingList !== undefined && args.tokenTaggingList !== null) {
1743
- this.tokenTaggingList = Thrift.copyList(args.tokenTaggingList, [ttypes.TokenTagging]);
1744
- }
1745
- if (args.parseList !== undefined && args.parseList !== null) {
1746
- this.parseList = Thrift.copyList(args.parseList, [ttypes.Parse]);
1747
- }
1748
- if (args.dependencyParseList !== undefined && args.dependencyParseList !== null) {
1749
- this.dependencyParseList = Thrift.copyList(args.dependencyParseList, [ttypes.DependencyParse]);
1750
- }
1751
- if (args.spanLinkList !== undefined && args.spanLinkList !== null) {
1752
- this.spanLinkList = Thrift.copyList(args.spanLinkList, [ttypes.SpanLink]);
1753
- }
1754
- }
1755
- }
1756
-
1757
- read (input) {
1758
- input.readStructBegin();
1759
- while (true) {
1760
- const ret = input.readFieldBegin();
1761
- const ftype = ret.ftype;
1762
- const fid = ret.fid;
1763
- if (ftype == Thrift.Type.STOP) {
1764
- break;
1765
- }
1766
- switch (fid) {
1767
- case 1:
1768
- if (ftype == Thrift.Type.STRUCT) {
1769
- this.uuid = new uuid_ttypes.UUID();
1770
- this.uuid.read(input);
1771
- } else {
1772
- input.skip(ftype);
1773
- }
1774
- break;
1775
- case 2:
1776
- if (ftype == Thrift.Type.STRUCT) {
1777
- this.metadata = new metadata_ttypes.AnnotationMetadata();
1778
- this.metadata.read(input);
1779
- } else {
1780
- input.skip(ftype);
1781
- }
1782
- break;
1783
- case 3:
1784
- if (ftype == Thrift.Type.STRUCT) {
1785
- this.tokenList = new ttypes.TokenList();
1786
- this.tokenList.read(input);
1787
- } else {
1788
- input.skip(ftype);
1789
- }
1790
- break;
1791
- case 4:
1792
- if (ftype == Thrift.Type.STRUCT) {
1793
- this.lattice = new ttypes.TokenLattice();
1794
- this.lattice.read(input);
1795
- } else {
1796
- input.skip(ftype);
1797
- }
1798
- break;
1799
- case 5:
1800
- if (ftype == Thrift.Type.I32) {
1801
- this.kind = input.readI32();
1802
- } else {
1803
- input.skip(ftype);
1804
- }
1805
- break;
1806
- case 6:
1807
- if (ftype == Thrift.Type.LIST) {
1808
- this.tokenTaggingList = [];
1809
- const _rtmp356 = input.readListBegin();
1810
- const _size55 = _rtmp356.size || 0;
1811
- for (let _i57 = 0; _i57 < _size55; ++_i57) {
1812
- let elem58 = null;
1813
- elem58 = new ttypes.TokenTagging();
1814
- elem58.read(input);
1815
- this.tokenTaggingList.push(elem58);
1816
- }
1817
- input.readListEnd();
1818
- } else {
1819
- input.skip(ftype);
1820
- }
1821
- break;
1822
- case 7:
1823
- if (ftype == Thrift.Type.LIST) {
1824
- this.parseList = [];
1825
- const _rtmp360 = input.readListBegin();
1826
- const _size59 = _rtmp360.size || 0;
1827
- for (let _i61 = 0; _i61 < _size59; ++_i61) {
1828
- let elem62 = null;
1829
- elem62 = new ttypes.Parse();
1830
- elem62.read(input);
1831
- this.parseList.push(elem62);
1832
- }
1833
- input.readListEnd();
1834
- } else {
1835
- input.skip(ftype);
1836
- }
1837
- break;
1838
- case 8:
1839
- if (ftype == Thrift.Type.LIST) {
1840
- this.dependencyParseList = [];
1841
- const _rtmp364 = input.readListBegin();
1842
- const _size63 = _rtmp364.size || 0;
1843
- for (let _i65 = 0; _i65 < _size63; ++_i65) {
1844
- let elem66 = null;
1845
- elem66 = new ttypes.DependencyParse();
1846
- elem66.read(input);
1847
- this.dependencyParseList.push(elem66);
1848
- }
1849
- input.readListEnd();
1850
- } else {
1851
- input.skip(ftype);
1852
- }
1853
- break;
1854
- case 9:
1855
- if (ftype == Thrift.Type.LIST) {
1856
- this.spanLinkList = [];
1857
- const _rtmp368 = input.readListBegin();
1858
- const _size67 = _rtmp368.size || 0;
1859
- for (let _i69 = 0; _i69 < _size67; ++_i69) {
1860
- let elem70 = null;
1861
- elem70 = new ttypes.SpanLink();
1862
- elem70.read(input);
1863
- this.spanLinkList.push(elem70);
1864
- }
1865
- input.readListEnd();
1866
- } else {
1867
- input.skip(ftype);
1868
- }
1869
- break;
1870
- default:
1871
- input.skip(ftype);
1872
- }
1873
- input.readFieldEnd();
1874
- }
1875
- input.readStructEnd();
1876
- return;
1877
- }
1878
-
1879
- write (output) {
1880
- output.writeStructBegin('Tokenization');
1881
- if (this.uuid !== null && this.uuid !== undefined) {
1882
- output.writeFieldBegin('uuid', Thrift.Type.STRUCT, 1);
1883
- this.uuid.write(output);
1884
- output.writeFieldEnd();
1885
- }
1886
- if (this.metadata !== null && this.metadata !== undefined) {
1887
- output.writeFieldBegin('metadata', Thrift.Type.STRUCT, 2);
1888
- this.metadata.write(output);
1889
- output.writeFieldEnd();
1890
- }
1891
- if (this.tokenList !== null && this.tokenList !== undefined) {
1892
- output.writeFieldBegin('tokenList', Thrift.Type.STRUCT, 3);
1893
- this.tokenList.write(output);
1894
- output.writeFieldEnd();
1895
- }
1896
- if (this.lattice !== null && this.lattice !== undefined) {
1897
- output.writeFieldBegin('lattice', Thrift.Type.STRUCT, 4);
1898
- this.lattice.write(output);
1899
- output.writeFieldEnd();
1900
- }
1901
- if (this.kind !== null && this.kind !== undefined) {
1902
- output.writeFieldBegin('kind', Thrift.Type.I32, 5);
1903
- output.writeI32(this.kind);
1904
- output.writeFieldEnd();
1905
- }
1906
- if (this.tokenTaggingList !== null && this.tokenTaggingList !== undefined) {
1907
- output.writeFieldBegin('tokenTaggingList', Thrift.Type.LIST, 6);
1908
- output.writeListBegin(Thrift.Type.STRUCT, this.tokenTaggingList.length);
1909
- for (let iter71 in this.tokenTaggingList) {
1910
- if (this.tokenTaggingList.hasOwnProperty(iter71)) {
1911
- iter71 = this.tokenTaggingList[iter71];
1912
- iter71.write(output);
1913
- }
1914
- }
1915
- output.writeListEnd();
1916
- output.writeFieldEnd();
1917
- }
1918
- if (this.parseList !== null && this.parseList !== undefined) {
1919
- output.writeFieldBegin('parseList', Thrift.Type.LIST, 7);
1920
- output.writeListBegin(Thrift.Type.STRUCT, this.parseList.length);
1921
- for (let iter72 in this.parseList) {
1922
- if (this.parseList.hasOwnProperty(iter72)) {
1923
- iter72 = this.parseList[iter72];
1924
- iter72.write(output);
1925
- }
1926
- }
1927
- output.writeListEnd();
1928
- output.writeFieldEnd();
1929
- }
1930
- if (this.dependencyParseList !== null && this.dependencyParseList !== undefined) {
1931
- output.writeFieldBegin('dependencyParseList', Thrift.Type.LIST, 8);
1932
- output.writeListBegin(Thrift.Type.STRUCT, this.dependencyParseList.length);
1933
- for (let iter73 in this.dependencyParseList) {
1934
- if (this.dependencyParseList.hasOwnProperty(iter73)) {
1935
- iter73 = this.dependencyParseList[iter73];
1936
- iter73.write(output);
1937
- }
1938
- }
1939
- output.writeListEnd();
1940
- output.writeFieldEnd();
1941
- }
1942
- if (this.spanLinkList !== null && this.spanLinkList !== undefined) {
1943
- output.writeFieldBegin('spanLinkList', Thrift.Type.LIST, 9);
1944
- output.writeListBegin(Thrift.Type.STRUCT, this.spanLinkList.length);
1945
- for (let iter74 in this.spanLinkList) {
1946
- if (this.spanLinkList.hasOwnProperty(iter74)) {
1947
- iter74 = this.spanLinkList[iter74];
1948
- iter74.write(output);
1949
- }
1950
- }
1951
- output.writeListEnd();
1952
- output.writeFieldEnd();
1953
- }
1954
- output.writeFieldStop();
1955
- output.writeStructEnd();
1956
- return;
1957
- }
1958
-
1959
- };
1960
- const Sentence = module.exports.Sentence = class {
1961
- constructor(args) {
1962
- this.uuid = null;
1963
- this.tokenization = null;
1964
- this.textSpan = null;
1965
- this.rawTextSpan = null;
1966
- this.audioSpan = null;
1967
- if (args) {
1968
- if (args.uuid !== undefined && args.uuid !== null) {
1969
- this.uuid = new uuid_ttypes.UUID(args.uuid);
1970
- } else {
1971
- throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field uuid is unset!');
1972
- }
1973
- if (args.tokenization !== undefined && args.tokenization !== null) {
1974
- this.tokenization = new ttypes.Tokenization(args.tokenization);
1975
- }
1976
- if (args.textSpan !== undefined && args.textSpan !== null) {
1977
- this.textSpan = new spans_ttypes.TextSpan(args.textSpan);
1978
- }
1979
- if (args.rawTextSpan !== undefined && args.rawTextSpan !== null) {
1980
- this.rawTextSpan = new spans_ttypes.TextSpan(args.rawTextSpan);
1981
- }
1982
- if (args.audioSpan !== undefined && args.audioSpan !== null) {
1983
- this.audioSpan = new spans_ttypes.AudioSpan(args.audioSpan);
1984
- }
1985
- }
1986
- }
1987
-
1988
- read (input) {
1989
- input.readStructBegin();
1990
- while (true) {
1991
- const ret = input.readFieldBegin();
1992
- const ftype = ret.ftype;
1993
- const fid = ret.fid;
1994
- if (ftype == Thrift.Type.STOP) {
1995
- break;
1996
- }
1997
- switch (fid) {
1998
- case 1:
1999
- if (ftype == Thrift.Type.STRUCT) {
2000
- this.uuid = new uuid_ttypes.UUID();
2001
- this.uuid.read(input);
2002
- } else {
2003
- input.skip(ftype);
2004
- }
2005
- break;
2006
- case 2:
2007
- if (ftype == Thrift.Type.STRUCT) {
2008
- this.tokenization = new ttypes.Tokenization();
2009
- this.tokenization.read(input);
2010
- } else {
2011
- input.skip(ftype);
2012
- }
2013
- break;
2014
- case 3:
2015
- if (ftype == Thrift.Type.STRUCT) {
2016
- this.textSpan = new spans_ttypes.TextSpan();
2017
- this.textSpan.read(input);
2018
- } else {
2019
- input.skip(ftype);
2020
- }
2021
- break;
2022
- case 4:
2023
- if (ftype == Thrift.Type.STRUCT) {
2024
- this.rawTextSpan = new spans_ttypes.TextSpan();
2025
- this.rawTextSpan.read(input);
2026
- } else {
2027
- input.skip(ftype);
2028
- }
2029
- break;
2030
- case 5:
2031
- if (ftype == Thrift.Type.STRUCT) {
2032
- this.audioSpan = new spans_ttypes.AudioSpan();
2033
- this.audioSpan.read(input);
2034
- } else {
2035
- input.skip(ftype);
2036
- }
2037
- break;
2038
- default:
2039
- input.skip(ftype);
2040
- }
2041
- input.readFieldEnd();
2042
- }
2043
- input.readStructEnd();
2044
- return;
2045
- }
2046
-
2047
- write (output) {
2048
- output.writeStructBegin('Sentence');
2049
- if (this.uuid !== null && this.uuid !== undefined) {
2050
- output.writeFieldBegin('uuid', Thrift.Type.STRUCT, 1);
2051
- this.uuid.write(output);
2052
- output.writeFieldEnd();
2053
- }
2054
- if (this.tokenization !== null && this.tokenization !== undefined) {
2055
- output.writeFieldBegin('tokenization', Thrift.Type.STRUCT, 2);
2056
- this.tokenization.write(output);
2057
- output.writeFieldEnd();
2058
- }
2059
- if (this.textSpan !== null && this.textSpan !== undefined) {
2060
- output.writeFieldBegin('textSpan', Thrift.Type.STRUCT, 3);
2061
- this.textSpan.write(output);
2062
- output.writeFieldEnd();
2063
- }
2064
- if (this.rawTextSpan !== null && this.rawTextSpan !== undefined) {
2065
- output.writeFieldBegin('rawTextSpan', Thrift.Type.STRUCT, 4);
2066
- this.rawTextSpan.write(output);
2067
- output.writeFieldEnd();
2068
- }
2069
- if (this.audioSpan !== null && this.audioSpan !== undefined) {
2070
- output.writeFieldBegin('audioSpan', Thrift.Type.STRUCT, 5);
2071
- this.audioSpan.write(output);
2072
- output.writeFieldEnd();
2073
- }
2074
- output.writeFieldStop();
2075
- output.writeStructEnd();
2076
- return;
2077
- }
2078
-
2079
- };
2080
- const Section = module.exports.Section = class {
2081
- constructor(args) {
2082
- this.uuid = null;
2083
- this.sentenceList = null;
2084
- this.textSpan = null;
2085
- this.rawTextSpan = null;
2086
- this.audioSpan = null;
2087
- this.kind = null;
2088
- this.label = null;
2089
- this.numberList = null;
2090
- this.lidList = null;
2091
- if (args) {
2092
- if (args.uuid !== undefined && args.uuid !== null) {
2093
- this.uuid = new uuid_ttypes.UUID(args.uuid);
2094
- } else {
2095
- throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field uuid is unset!');
2096
- }
2097
- if (args.sentenceList !== undefined && args.sentenceList !== null) {
2098
- this.sentenceList = Thrift.copyList(args.sentenceList, [ttypes.Sentence]);
2099
- }
2100
- if (args.textSpan !== undefined && args.textSpan !== null) {
2101
- this.textSpan = new spans_ttypes.TextSpan(args.textSpan);
2102
- }
2103
- if (args.rawTextSpan !== undefined && args.rawTextSpan !== null) {
2104
- this.rawTextSpan = new spans_ttypes.TextSpan(args.rawTextSpan);
2105
- }
2106
- if (args.audioSpan !== undefined && args.audioSpan !== null) {
2107
- this.audioSpan = new spans_ttypes.AudioSpan(args.audioSpan);
2108
- }
2109
- if (args.kind !== undefined && args.kind !== null) {
2110
- this.kind = args.kind;
2111
- } else {
2112
- throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field kind is unset!');
2113
- }
2114
- if (args.label !== undefined && args.label !== null) {
2115
- this.label = args.label;
2116
- }
2117
- if (args.numberList !== undefined && args.numberList !== null) {
2118
- this.numberList = Thrift.copyList(args.numberList, [null]);
2119
- }
2120
- if (args.lidList !== undefined && args.lidList !== null) {
2121
- this.lidList = Thrift.copyList(args.lidList, [language_ttypes.LanguageIdentification]);
2122
- }
2123
- }
2124
- }
2125
-
2126
- read (input) {
2127
- input.readStructBegin();
2128
- while (true) {
2129
- const ret = input.readFieldBegin();
2130
- const ftype = ret.ftype;
2131
- const fid = ret.fid;
2132
- if (ftype == Thrift.Type.STOP) {
2133
- break;
2134
- }
2135
- switch (fid) {
2136
- case 1:
2137
- if (ftype == Thrift.Type.STRUCT) {
2138
- this.uuid = new uuid_ttypes.UUID();
2139
- this.uuid.read(input);
2140
- } else {
2141
- input.skip(ftype);
2142
- }
2143
- break;
2144
- case 2:
2145
- if (ftype == Thrift.Type.LIST) {
2146
- this.sentenceList = [];
2147
- const _rtmp376 = input.readListBegin();
2148
- const _size75 = _rtmp376.size || 0;
2149
- for (let _i77 = 0; _i77 < _size75; ++_i77) {
2150
- let elem78 = null;
2151
- elem78 = new ttypes.Sentence();
2152
- elem78.read(input);
2153
- this.sentenceList.push(elem78);
2154
- }
2155
- input.readListEnd();
2156
- } else {
2157
- input.skip(ftype);
2158
- }
2159
- break;
2160
- case 3:
2161
- if (ftype == Thrift.Type.STRUCT) {
2162
- this.textSpan = new spans_ttypes.TextSpan();
2163
- this.textSpan.read(input);
2164
- } else {
2165
- input.skip(ftype);
2166
- }
2167
- break;
2168
- case 4:
2169
- if (ftype == Thrift.Type.STRUCT) {
2170
- this.rawTextSpan = new spans_ttypes.TextSpan();
2171
- this.rawTextSpan.read(input);
2172
- } else {
2173
- input.skip(ftype);
2174
- }
2175
- break;
2176
- case 9:
2177
- if (ftype == Thrift.Type.STRUCT) {
2178
- this.audioSpan = new spans_ttypes.AudioSpan();
2179
- this.audioSpan.read(input);
2180
- } else {
2181
- input.skip(ftype);
2182
- }
2183
- break;
2184
- case 5:
2185
- if (ftype == Thrift.Type.STRING) {
2186
- this.kind = input.readString();
2187
- } else {
2188
- input.skip(ftype);
2189
- }
2190
- break;
2191
- case 6:
2192
- if (ftype == Thrift.Type.STRING) {
2193
- this.label = input.readString();
2194
- } else {
2195
- input.skip(ftype);
2196
- }
2197
- break;
2198
- case 7:
2199
- if (ftype == Thrift.Type.LIST) {
2200
- this.numberList = [];
2201
- const _rtmp380 = input.readListBegin();
2202
- const _size79 = _rtmp380.size || 0;
2203
- for (let _i81 = 0; _i81 < _size79; ++_i81) {
2204
- let elem82 = null;
2205
- elem82 = input.readI32();
2206
- this.numberList.push(elem82);
2207
- }
2208
- input.readListEnd();
2209
- } else {
2210
- input.skip(ftype);
2211
- }
2212
- break;
2213
- case 8:
2214
- if (ftype == Thrift.Type.LIST) {
2215
- this.lidList = [];
2216
- const _rtmp384 = input.readListBegin();
2217
- const _size83 = _rtmp384.size || 0;
2218
- for (let _i85 = 0; _i85 < _size83; ++_i85) {
2219
- let elem86 = null;
2220
- elem86 = new language_ttypes.LanguageIdentification();
2221
- elem86.read(input);
2222
- this.lidList.push(elem86);
2223
- }
2224
- input.readListEnd();
2225
- } else {
2226
- input.skip(ftype);
2227
- }
2228
- break;
2229
- default:
2230
- input.skip(ftype);
2231
- }
2232
- input.readFieldEnd();
2233
- }
2234
- input.readStructEnd();
2235
- return;
2236
- }
2237
-
2238
- write (output) {
2239
- output.writeStructBegin('Section');
2240
- if (this.uuid !== null && this.uuid !== undefined) {
2241
- output.writeFieldBegin('uuid', Thrift.Type.STRUCT, 1);
2242
- this.uuid.write(output);
2243
- output.writeFieldEnd();
2244
- }
2245
- if (this.sentenceList !== null && this.sentenceList !== undefined) {
2246
- output.writeFieldBegin('sentenceList', Thrift.Type.LIST, 2);
2247
- output.writeListBegin(Thrift.Type.STRUCT, this.sentenceList.length);
2248
- for (let iter87 in this.sentenceList) {
2249
- if (this.sentenceList.hasOwnProperty(iter87)) {
2250
- iter87 = this.sentenceList[iter87];
2251
- iter87.write(output);
2252
- }
2253
- }
2254
- output.writeListEnd();
2255
- output.writeFieldEnd();
2256
- }
2257
- if (this.textSpan !== null && this.textSpan !== undefined) {
2258
- output.writeFieldBegin('textSpan', Thrift.Type.STRUCT, 3);
2259
- this.textSpan.write(output);
2260
- output.writeFieldEnd();
2261
- }
2262
- if (this.rawTextSpan !== null && this.rawTextSpan !== undefined) {
2263
- output.writeFieldBegin('rawTextSpan', Thrift.Type.STRUCT, 4);
2264
- this.rawTextSpan.write(output);
2265
- output.writeFieldEnd();
2266
- }
2267
- if (this.audioSpan !== null && this.audioSpan !== undefined) {
2268
- output.writeFieldBegin('audioSpan', Thrift.Type.STRUCT, 9);
2269
- this.audioSpan.write(output);
2270
- output.writeFieldEnd();
2271
- }
2272
- if (this.kind !== null && this.kind !== undefined) {
2273
- output.writeFieldBegin('kind', Thrift.Type.STRING, 5);
2274
- output.writeString(this.kind);
2275
- output.writeFieldEnd();
2276
- }
2277
- if (this.label !== null && this.label !== undefined) {
2278
- output.writeFieldBegin('label', Thrift.Type.STRING, 6);
2279
- output.writeString(this.label);
2280
- output.writeFieldEnd();
2281
- }
2282
- if (this.numberList !== null && this.numberList !== undefined) {
2283
- output.writeFieldBegin('numberList', Thrift.Type.LIST, 7);
2284
- output.writeListBegin(Thrift.Type.I32, this.numberList.length);
2285
- for (let iter88 in this.numberList) {
2286
- if (this.numberList.hasOwnProperty(iter88)) {
2287
- iter88 = this.numberList[iter88];
2288
- output.writeI32(iter88);
2289
- }
2290
- }
2291
- output.writeListEnd();
2292
- output.writeFieldEnd();
2293
- }
2294
- if (this.lidList !== null && this.lidList !== undefined) {
2295
- output.writeFieldBegin('lidList', Thrift.Type.LIST, 8);
2296
- output.writeListBegin(Thrift.Type.STRUCT, this.lidList.length);
2297
- for (let iter89 in this.lidList) {
2298
- if (this.lidList.hasOwnProperty(iter89)) {
2299
- iter89 = this.lidList[iter89];
2300
- iter89.write(output);
2301
- }
2302
- }
2303
- output.writeListEnd();
2304
- output.writeFieldEnd();
2305
- }
2306
- output.writeFieldStop();
2307
- output.writeStructEnd();
2308
- return;
2309
- }
2310
-
2311
- };
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 metadata_ttypes = require('./metadata_types');
13
+ const spans_ttypes = require('./spans_types');
14
+ const uuid_ttypes = require('./uuid_types');
15
+ const language_ttypes = require('./language_types');
16
+
17
+
18
+ const ttypes = module.exports = {};
19
+ ttypes.TokenizationKind = {
20
+ 'TOKEN_LIST' : 1,
21
+ 'TOKEN_LATTICE' : 2
22
+ };
23
+ const Constituent = module.exports.Constituent = class {
24
+ constructor(args) {
25
+ this.id = null;
26
+ this.tag = null;
27
+ this.childList = null;
28
+ this.headChildIndex = -1;
29
+ this.start = null;
30
+ this.ending = null;
31
+ if (args) {
32
+ if (args.id !== undefined && args.id !== null) {
33
+ this.id = args.id;
34
+ } else {
35
+ throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field id is unset!');
36
+ }
37
+ if (args.tag !== undefined && args.tag !== null) {
38
+ this.tag = args.tag;
39
+ }
40
+ if (args.childList !== undefined && args.childList !== null) {
41
+ this.childList = Thrift.copyList(args.childList, [null]);
42
+ } else {
43
+ throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field childList is unset!');
44
+ }
45
+ if (args.headChildIndex !== undefined && args.headChildIndex !== null) {
46
+ this.headChildIndex = args.headChildIndex;
47
+ }
48
+ if (args.start !== undefined && args.start !== null) {
49
+ this.start = args.start;
50
+ }
51
+ if (args.ending !== undefined && args.ending !== null) {
52
+ this.ending = args.ending;
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.I32) {
69
+ this.id = input.readI32();
70
+ } else {
71
+ input.skip(ftype);
72
+ }
73
+ break;
74
+ case 2:
75
+ if (ftype == Thrift.Type.STRING) {
76
+ this.tag = input.readString();
77
+ } else {
78
+ input.skip(ftype);
79
+ }
80
+ break;
81
+ case 3:
82
+ if (ftype == Thrift.Type.LIST) {
83
+ this.childList = [];
84
+ const _rtmp31 = input.readListBegin();
85
+ const _size0 = _rtmp31.size || 0;
86
+ for (let _i2 = 0; _i2 < _size0; ++_i2) {
87
+ let elem3 = null;
88
+ elem3 = input.readI32();
89
+ this.childList.push(elem3);
90
+ }
91
+ input.readListEnd();
92
+ } else {
93
+ input.skip(ftype);
94
+ }
95
+ break;
96
+ case 4:
97
+ if (ftype == Thrift.Type.I32) {
98
+ this.headChildIndex = input.readI32();
99
+ } else {
100
+ input.skip(ftype);
101
+ }
102
+ break;
103
+ case 5:
104
+ if (ftype == Thrift.Type.I32) {
105
+ this.start = input.readI32();
106
+ } else {
107
+ input.skip(ftype);
108
+ }
109
+ break;
110
+ case 6:
111
+ if (ftype == Thrift.Type.I32) {
112
+ this.ending = input.readI32();
113
+ } else {
114
+ input.skip(ftype);
115
+ }
116
+ break;
117
+ default:
118
+ input.skip(ftype);
119
+ }
120
+ input.readFieldEnd();
121
+ }
122
+ input.readStructEnd();
123
+ return;
124
+ }
125
+
126
+ write (output) {
127
+ output.writeStructBegin('Constituent');
128
+ if (this.id !== null && this.id !== undefined) {
129
+ output.writeFieldBegin('id', Thrift.Type.I32, 1);
130
+ output.writeI32(this.id);
131
+ output.writeFieldEnd();
132
+ }
133
+ if (this.tag !== null && this.tag !== undefined) {
134
+ output.writeFieldBegin('tag', Thrift.Type.STRING, 2);
135
+ output.writeString(this.tag);
136
+ output.writeFieldEnd();
137
+ }
138
+ if (this.childList !== null && this.childList !== undefined) {
139
+ output.writeFieldBegin('childList', Thrift.Type.LIST, 3);
140
+ output.writeListBegin(Thrift.Type.I32, this.childList.length);
141
+ for (let iter4 in this.childList) {
142
+ if (this.childList.hasOwnProperty(iter4)) {
143
+ iter4 = this.childList[iter4];
144
+ output.writeI32(iter4);
145
+ }
146
+ }
147
+ output.writeListEnd();
148
+ output.writeFieldEnd();
149
+ }
150
+ if (this.headChildIndex !== null && this.headChildIndex !== undefined) {
151
+ output.writeFieldBegin('headChildIndex', Thrift.Type.I32, 4);
152
+ output.writeI32(this.headChildIndex);
153
+ output.writeFieldEnd();
154
+ }
155
+ if (this.start !== null && this.start !== undefined) {
156
+ output.writeFieldBegin('start', Thrift.Type.I32, 5);
157
+ output.writeI32(this.start);
158
+ output.writeFieldEnd();
159
+ }
160
+ if (this.ending !== null && this.ending !== undefined) {
161
+ output.writeFieldBegin('ending', Thrift.Type.I32, 6);
162
+ output.writeI32(this.ending);
163
+ output.writeFieldEnd();
164
+ }
165
+ output.writeFieldStop();
166
+ output.writeStructEnd();
167
+ return;
168
+ }
169
+
170
+ };
171
+ const Parse = module.exports.Parse = class {
172
+ constructor(args) {
173
+ this.uuid = null;
174
+ this.metadata = null;
175
+ this.constituentList = null;
176
+ if (args) {
177
+ if (args.uuid !== undefined && args.uuid !== null) {
178
+ this.uuid = new uuid_ttypes.UUID(args.uuid);
179
+ } else {
180
+ throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field uuid is unset!');
181
+ }
182
+ if (args.metadata !== undefined && args.metadata !== null) {
183
+ this.metadata = new metadata_ttypes.AnnotationMetadata(args.metadata);
184
+ } else {
185
+ throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field metadata is unset!');
186
+ }
187
+ if (args.constituentList !== undefined && args.constituentList !== null) {
188
+ this.constituentList = Thrift.copyList(args.constituentList, [ttypes.Constituent]);
189
+ } else {
190
+ throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field constituentList is unset!');
191
+ }
192
+ }
193
+ }
194
+
195
+ read (input) {
196
+ input.readStructBegin();
197
+ while (true) {
198
+ const ret = input.readFieldBegin();
199
+ const ftype = ret.ftype;
200
+ const fid = ret.fid;
201
+ if (ftype == Thrift.Type.STOP) {
202
+ break;
203
+ }
204
+ switch (fid) {
205
+ case 1:
206
+ if (ftype == Thrift.Type.STRUCT) {
207
+ this.uuid = new uuid_ttypes.UUID();
208
+ this.uuid.read(input);
209
+ } else {
210
+ input.skip(ftype);
211
+ }
212
+ break;
213
+ case 2:
214
+ if (ftype == Thrift.Type.STRUCT) {
215
+ this.metadata = new metadata_ttypes.AnnotationMetadata();
216
+ this.metadata.read(input);
217
+ } else {
218
+ input.skip(ftype);
219
+ }
220
+ break;
221
+ case 3:
222
+ if (ftype == Thrift.Type.LIST) {
223
+ this.constituentList = [];
224
+ const _rtmp36 = input.readListBegin();
225
+ const _size5 = _rtmp36.size || 0;
226
+ for (let _i7 = 0; _i7 < _size5; ++_i7) {
227
+ let elem8 = null;
228
+ elem8 = new ttypes.Constituent();
229
+ elem8.read(input);
230
+ this.constituentList.push(elem8);
231
+ }
232
+ input.readListEnd();
233
+ } else {
234
+ input.skip(ftype);
235
+ }
236
+ break;
237
+ default:
238
+ input.skip(ftype);
239
+ }
240
+ input.readFieldEnd();
241
+ }
242
+ input.readStructEnd();
243
+ return;
244
+ }
245
+
246
+ write (output) {
247
+ output.writeStructBegin('Parse');
248
+ if (this.uuid !== null && this.uuid !== undefined) {
249
+ output.writeFieldBegin('uuid', Thrift.Type.STRUCT, 1);
250
+ this.uuid.write(output);
251
+ output.writeFieldEnd();
252
+ }
253
+ if (this.metadata !== null && this.metadata !== undefined) {
254
+ output.writeFieldBegin('metadata', Thrift.Type.STRUCT, 2);
255
+ this.metadata.write(output);
256
+ output.writeFieldEnd();
257
+ }
258
+ if (this.constituentList !== null && this.constituentList !== undefined) {
259
+ output.writeFieldBegin('constituentList', Thrift.Type.LIST, 3);
260
+ output.writeListBegin(Thrift.Type.STRUCT, this.constituentList.length);
261
+ for (let iter9 in this.constituentList) {
262
+ if (this.constituentList.hasOwnProperty(iter9)) {
263
+ iter9 = this.constituentList[iter9];
264
+ iter9.write(output);
265
+ }
266
+ }
267
+ output.writeListEnd();
268
+ output.writeFieldEnd();
269
+ }
270
+ output.writeFieldStop();
271
+ output.writeStructEnd();
272
+ return;
273
+ }
274
+
275
+ };
276
+ const ConstituentRef = module.exports.ConstituentRef = class {
277
+ constructor(args) {
278
+ this.parseId = null;
279
+ this.constituentIndex = null;
280
+ if (args) {
281
+ if (args.parseId !== undefined && args.parseId !== null) {
282
+ this.parseId = new uuid_ttypes.UUID(args.parseId);
283
+ } else {
284
+ throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field parseId is unset!');
285
+ }
286
+ if (args.constituentIndex !== undefined && args.constituentIndex !== null) {
287
+ this.constituentIndex = args.constituentIndex;
288
+ } else {
289
+ throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field constituentIndex is unset!');
290
+ }
291
+ }
292
+ }
293
+
294
+ read (input) {
295
+ input.readStructBegin();
296
+ while (true) {
297
+ const ret = input.readFieldBegin();
298
+ const ftype = ret.ftype;
299
+ const fid = ret.fid;
300
+ if (ftype == Thrift.Type.STOP) {
301
+ break;
302
+ }
303
+ switch (fid) {
304
+ case 1:
305
+ if (ftype == Thrift.Type.STRUCT) {
306
+ this.parseId = new uuid_ttypes.UUID();
307
+ this.parseId.read(input);
308
+ } else {
309
+ input.skip(ftype);
310
+ }
311
+ break;
312
+ case 2:
313
+ if (ftype == Thrift.Type.I32) {
314
+ this.constituentIndex = input.readI32();
315
+ } else {
316
+ input.skip(ftype);
317
+ }
318
+ break;
319
+ default:
320
+ input.skip(ftype);
321
+ }
322
+ input.readFieldEnd();
323
+ }
324
+ input.readStructEnd();
325
+ return;
326
+ }
327
+
328
+ write (output) {
329
+ output.writeStructBegin('ConstituentRef');
330
+ if (this.parseId !== null && this.parseId !== undefined) {
331
+ output.writeFieldBegin('parseId', Thrift.Type.STRUCT, 1);
332
+ this.parseId.write(output);
333
+ output.writeFieldEnd();
334
+ }
335
+ if (this.constituentIndex !== null && this.constituentIndex !== undefined) {
336
+ output.writeFieldBegin('constituentIndex', Thrift.Type.I32, 2);
337
+ output.writeI32(this.constituentIndex);
338
+ output.writeFieldEnd();
339
+ }
340
+ output.writeFieldStop();
341
+ output.writeStructEnd();
342
+ return;
343
+ }
344
+
345
+ };
346
+ const Dependency = module.exports.Dependency = class {
347
+ constructor(args) {
348
+ this.gov = -1;
349
+ this.dep = null;
350
+ this.edgeType = null;
351
+ if (args) {
352
+ if (args.gov !== undefined && args.gov !== null) {
353
+ this.gov = args.gov;
354
+ }
355
+ if (args.dep !== undefined && args.dep !== null) {
356
+ this.dep = args.dep;
357
+ } else {
358
+ throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field dep is unset!');
359
+ }
360
+ if (args.edgeType !== undefined && args.edgeType !== null) {
361
+ this.edgeType = args.edgeType;
362
+ }
363
+ }
364
+ }
365
+
366
+ read (input) {
367
+ input.readStructBegin();
368
+ while (true) {
369
+ const ret = input.readFieldBegin();
370
+ const ftype = ret.ftype;
371
+ const fid = ret.fid;
372
+ if (ftype == Thrift.Type.STOP) {
373
+ break;
374
+ }
375
+ switch (fid) {
376
+ case 1:
377
+ if (ftype == Thrift.Type.I32) {
378
+ this.gov = input.readI32();
379
+ } else {
380
+ input.skip(ftype);
381
+ }
382
+ break;
383
+ case 2:
384
+ if (ftype == Thrift.Type.I32) {
385
+ this.dep = input.readI32();
386
+ } else {
387
+ input.skip(ftype);
388
+ }
389
+ break;
390
+ case 3:
391
+ if (ftype == Thrift.Type.STRING) {
392
+ this.edgeType = input.readString();
393
+ } else {
394
+ input.skip(ftype);
395
+ }
396
+ break;
397
+ default:
398
+ input.skip(ftype);
399
+ }
400
+ input.readFieldEnd();
401
+ }
402
+ input.readStructEnd();
403
+ return;
404
+ }
405
+
406
+ write (output) {
407
+ output.writeStructBegin('Dependency');
408
+ if (this.gov !== null && this.gov !== undefined) {
409
+ output.writeFieldBegin('gov', Thrift.Type.I32, 1);
410
+ output.writeI32(this.gov);
411
+ output.writeFieldEnd();
412
+ }
413
+ if (this.dep !== null && this.dep !== undefined) {
414
+ output.writeFieldBegin('dep', Thrift.Type.I32, 2);
415
+ output.writeI32(this.dep);
416
+ output.writeFieldEnd();
417
+ }
418
+ if (this.edgeType !== null && this.edgeType !== undefined) {
419
+ output.writeFieldBegin('edgeType', Thrift.Type.STRING, 3);
420
+ output.writeString(this.edgeType);
421
+ output.writeFieldEnd();
422
+ }
423
+ output.writeFieldStop();
424
+ output.writeStructEnd();
425
+ return;
426
+ }
427
+
428
+ };
429
+ const DependencyParseStructure = module.exports.DependencyParseStructure = class {
430
+ constructor(args) {
431
+ this.isAcyclic = null;
432
+ this.isConnected = null;
433
+ this.isSingleHeaded = null;
434
+ this.isProjective = null;
435
+ if (args) {
436
+ if (args.isAcyclic !== undefined && args.isAcyclic !== null) {
437
+ this.isAcyclic = args.isAcyclic;
438
+ } else {
439
+ throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field isAcyclic is unset!');
440
+ }
441
+ if (args.isConnected !== undefined && args.isConnected !== null) {
442
+ this.isConnected = args.isConnected;
443
+ } else {
444
+ throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field isConnected is unset!');
445
+ }
446
+ if (args.isSingleHeaded !== undefined && args.isSingleHeaded !== null) {
447
+ this.isSingleHeaded = args.isSingleHeaded;
448
+ } else {
449
+ throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field isSingleHeaded is unset!');
450
+ }
451
+ if (args.isProjective !== undefined && args.isProjective !== null) {
452
+ this.isProjective = args.isProjective;
453
+ } else {
454
+ throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field isProjective is unset!');
455
+ }
456
+ }
457
+ }
458
+
459
+ read (input) {
460
+ input.readStructBegin();
461
+ while (true) {
462
+ const ret = input.readFieldBegin();
463
+ const ftype = ret.ftype;
464
+ const fid = ret.fid;
465
+ if (ftype == Thrift.Type.STOP) {
466
+ break;
467
+ }
468
+ switch (fid) {
469
+ case 1:
470
+ if (ftype == Thrift.Type.BOOL) {
471
+ this.isAcyclic = input.readBool();
472
+ } else {
473
+ input.skip(ftype);
474
+ }
475
+ break;
476
+ case 2:
477
+ if (ftype == Thrift.Type.BOOL) {
478
+ this.isConnected = input.readBool();
479
+ } else {
480
+ input.skip(ftype);
481
+ }
482
+ break;
483
+ case 3:
484
+ if (ftype == Thrift.Type.BOOL) {
485
+ this.isSingleHeaded = input.readBool();
486
+ } else {
487
+ input.skip(ftype);
488
+ }
489
+ break;
490
+ case 4:
491
+ if (ftype == Thrift.Type.BOOL) {
492
+ this.isProjective = input.readBool();
493
+ } else {
494
+ input.skip(ftype);
495
+ }
496
+ break;
497
+ default:
498
+ input.skip(ftype);
499
+ }
500
+ input.readFieldEnd();
501
+ }
502
+ input.readStructEnd();
503
+ return;
504
+ }
505
+
506
+ write (output) {
507
+ output.writeStructBegin('DependencyParseStructure');
508
+ if (this.isAcyclic !== null && this.isAcyclic !== undefined) {
509
+ output.writeFieldBegin('isAcyclic', Thrift.Type.BOOL, 1);
510
+ output.writeBool(this.isAcyclic);
511
+ output.writeFieldEnd();
512
+ }
513
+ if (this.isConnected !== null && this.isConnected !== undefined) {
514
+ output.writeFieldBegin('isConnected', Thrift.Type.BOOL, 2);
515
+ output.writeBool(this.isConnected);
516
+ output.writeFieldEnd();
517
+ }
518
+ if (this.isSingleHeaded !== null && this.isSingleHeaded !== undefined) {
519
+ output.writeFieldBegin('isSingleHeaded', Thrift.Type.BOOL, 3);
520
+ output.writeBool(this.isSingleHeaded);
521
+ output.writeFieldEnd();
522
+ }
523
+ if (this.isProjective !== null && this.isProjective !== undefined) {
524
+ output.writeFieldBegin('isProjective', Thrift.Type.BOOL, 4);
525
+ output.writeBool(this.isProjective);
526
+ output.writeFieldEnd();
527
+ }
528
+ output.writeFieldStop();
529
+ output.writeStructEnd();
530
+ return;
531
+ }
532
+
533
+ };
534
+ const DependencyParse = module.exports.DependencyParse = class {
535
+ constructor(args) {
536
+ this.uuid = null;
537
+ this.metadata = null;
538
+ this.dependencyList = null;
539
+ this.structureInformation = null;
540
+ if (args) {
541
+ if (args.uuid !== undefined && args.uuid !== null) {
542
+ this.uuid = new uuid_ttypes.UUID(args.uuid);
543
+ } else {
544
+ throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field uuid is unset!');
545
+ }
546
+ if (args.metadata !== undefined && args.metadata !== null) {
547
+ this.metadata = new metadata_ttypes.AnnotationMetadata(args.metadata);
548
+ } else {
549
+ throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field metadata is unset!');
550
+ }
551
+ if (args.dependencyList !== undefined && args.dependencyList !== null) {
552
+ this.dependencyList = Thrift.copyList(args.dependencyList, [ttypes.Dependency]);
553
+ } else {
554
+ throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field dependencyList is unset!');
555
+ }
556
+ if (args.structureInformation !== undefined && args.structureInformation !== null) {
557
+ this.structureInformation = new ttypes.DependencyParseStructure(args.structureInformation);
558
+ }
559
+ }
560
+ }
561
+
562
+ read (input) {
563
+ input.readStructBegin();
564
+ while (true) {
565
+ const ret = input.readFieldBegin();
566
+ const ftype = ret.ftype;
567
+ const fid = ret.fid;
568
+ if (ftype == Thrift.Type.STOP) {
569
+ break;
570
+ }
571
+ switch (fid) {
572
+ case 1:
573
+ if (ftype == Thrift.Type.STRUCT) {
574
+ this.uuid = new uuid_ttypes.UUID();
575
+ this.uuid.read(input);
576
+ } else {
577
+ input.skip(ftype);
578
+ }
579
+ break;
580
+ case 2:
581
+ if (ftype == Thrift.Type.STRUCT) {
582
+ this.metadata = new metadata_ttypes.AnnotationMetadata();
583
+ this.metadata.read(input);
584
+ } else {
585
+ input.skip(ftype);
586
+ }
587
+ break;
588
+ case 3:
589
+ if (ftype == Thrift.Type.LIST) {
590
+ this.dependencyList = [];
591
+ const _rtmp311 = input.readListBegin();
592
+ const _size10 = _rtmp311.size || 0;
593
+ for (let _i12 = 0; _i12 < _size10; ++_i12) {
594
+ let elem13 = null;
595
+ elem13 = new ttypes.Dependency();
596
+ elem13.read(input);
597
+ this.dependencyList.push(elem13);
598
+ }
599
+ input.readListEnd();
600
+ } else {
601
+ input.skip(ftype);
602
+ }
603
+ break;
604
+ case 4:
605
+ if (ftype == Thrift.Type.STRUCT) {
606
+ this.structureInformation = new ttypes.DependencyParseStructure();
607
+ this.structureInformation.read(input);
608
+ } else {
609
+ input.skip(ftype);
610
+ }
611
+ break;
612
+ default:
613
+ input.skip(ftype);
614
+ }
615
+ input.readFieldEnd();
616
+ }
617
+ input.readStructEnd();
618
+ return;
619
+ }
620
+
621
+ write (output) {
622
+ output.writeStructBegin('DependencyParse');
623
+ if (this.uuid !== null && this.uuid !== undefined) {
624
+ output.writeFieldBegin('uuid', Thrift.Type.STRUCT, 1);
625
+ this.uuid.write(output);
626
+ output.writeFieldEnd();
627
+ }
628
+ if (this.metadata !== null && this.metadata !== undefined) {
629
+ output.writeFieldBegin('metadata', Thrift.Type.STRUCT, 2);
630
+ this.metadata.write(output);
631
+ output.writeFieldEnd();
632
+ }
633
+ if (this.dependencyList !== null && this.dependencyList !== undefined) {
634
+ output.writeFieldBegin('dependencyList', Thrift.Type.LIST, 3);
635
+ output.writeListBegin(Thrift.Type.STRUCT, this.dependencyList.length);
636
+ for (let iter14 in this.dependencyList) {
637
+ if (this.dependencyList.hasOwnProperty(iter14)) {
638
+ iter14 = this.dependencyList[iter14];
639
+ iter14.write(output);
640
+ }
641
+ }
642
+ output.writeListEnd();
643
+ output.writeFieldEnd();
644
+ }
645
+ if (this.structureInformation !== null && this.structureInformation !== undefined) {
646
+ output.writeFieldBegin('structureInformation', Thrift.Type.STRUCT, 4);
647
+ this.structureInformation.write(output);
648
+ output.writeFieldEnd();
649
+ }
650
+ output.writeFieldStop();
651
+ output.writeStructEnd();
652
+ return;
653
+ }
654
+
655
+ };
656
+ const Token = module.exports.Token = class {
657
+ constructor(args) {
658
+ this.tokenIndex = null;
659
+ this.text = null;
660
+ this.textSpan = null;
661
+ this.rawTextSpan = null;
662
+ this.audioSpan = null;
663
+ if (args) {
664
+ if (args.tokenIndex !== undefined && args.tokenIndex !== null) {
665
+ this.tokenIndex = args.tokenIndex;
666
+ } else {
667
+ throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field tokenIndex is unset!');
668
+ }
669
+ if (args.text !== undefined && args.text !== null) {
670
+ this.text = args.text;
671
+ }
672
+ if (args.textSpan !== undefined && args.textSpan !== null) {
673
+ this.textSpan = new spans_ttypes.TextSpan(args.textSpan);
674
+ }
675
+ if (args.rawTextSpan !== undefined && args.rawTextSpan !== null) {
676
+ this.rawTextSpan = new spans_ttypes.TextSpan(args.rawTextSpan);
677
+ }
678
+ if (args.audioSpan !== undefined && args.audioSpan !== null) {
679
+ this.audioSpan = new spans_ttypes.AudioSpan(args.audioSpan);
680
+ }
681
+ }
682
+ }
683
+
684
+ read (input) {
685
+ input.readStructBegin();
686
+ while (true) {
687
+ const ret = input.readFieldBegin();
688
+ const ftype = ret.ftype;
689
+ const fid = ret.fid;
690
+ if (ftype == Thrift.Type.STOP) {
691
+ break;
692
+ }
693
+ switch (fid) {
694
+ case 1:
695
+ if (ftype == Thrift.Type.I32) {
696
+ this.tokenIndex = input.readI32();
697
+ } else {
698
+ input.skip(ftype);
699
+ }
700
+ break;
701
+ case 2:
702
+ if (ftype == Thrift.Type.STRING) {
703
+ this.text = input.readString();
704
+ } else {
705
+ input.skip(ftype);
706
+ }
707
+ break;
708
+ case 3:
709
+ if (ftype == Thrift.Type.STRUCT) {
710
+ this.textSpan = new spans_ttypes.TextSpan();
711
+ this.textSpan.read(input);
712
+ } else {
713
+ input.skip(ftype);
714
+ }
715
+ break;
716
+ case 4:
717
+ if (ftype == Thrift.Type.STRUCT) {
718
+ this.rawTextSpan = new spans_ttypes.TextSpan();
719
+ this.rawTextSpan.read(input);
720
+ } else {
721
+ input.skip(ftype);
722
+ }
723
+ break;
724
+ case 5:
725
+ if (ftype == Thrift.Type.STRUCT) {
726
+ this.audioSpan = new spans_ttypes.AudioSpan();
727
+ this.audioSpan.read(input);
728
+ } else {
729
+ input.skip(ftype);
730
+ }
731
+ break;
732
+ default:
733
+ input.skip(ftype);
734
+ }
735
+ input.readFieldEnd();
736
+ }
737
+ input.readStructEnd();
738
+ return;
739
+ }
740
+
741
+ write (output) {
742
+ output.writeStructBegin('Token');
743
+ if (this.tokenIndex !== null && this.tokenIndex !== undefined) {
744
+ output.writeFieldBegin('tokenIndex', Thrift.Type.I32, 1);
745
+ output.writeI32(this.tokenIndex);
746
+ output.writeFieldEnd();
747
+ }
748
+ if (this.text !== null && this.text !== undefined) {
749
+ output.writeFieldBegin('text', Thrift.Type.STRING, 2);
750
+ output.writeString(this.text);
751
+ output.writeFieldEnd();
752
+ }
753
+ if (this.textSpan !== null && this.textSpan !== undefined) {
754
+ output.writeFieldBegin('textSpan', Thrift.Type.STRUCT, 3);
755
+ this.textSpan.write(output);
756
+ output.writeFieldEnd();
757
+ }
758
+ if (this.rawTextSpan !== null && this.rawTextSpan !== undefined) {
759
+ output.writeFieldBegin('rawTextSpan', Thrift.Type.STRUCT, 4);
760
+ this.rawTextSpan.write(output);
761
+ output.writeFieldEnd();
762
+ }
763
+ if (this.audioSpan !== null && this.audioSpan !== undefined) {
764
+ output.writeFieldBegin('audioSpan', Thrift.Type.STRUCT, 5);
765
+ this.audioSpan.write(output);
766
+ output.writeFieldEnd();
767
+ }
768
+ output.writeFieldStop();
769
+ output.writeStructEnd();
770
+ return;
771
+ }
772
+
773
+ };
774
+ const TokenRefSequence = module.exports.TokenRefSequence = class {
775
+ constructor(args) {
776
+ this.tokenIndexList = null;
777
+ this.anchorTokenIndex = -1;
778
+ this.tokenizationId = null;
779
+ this.textSpan = null;
780
+ this.rawTextSpan = null;
781
+ this.audioSpan = null;
782
+ this.dependencies = null;
783
+ this.constituent = null;
784
+ if (args) {
785
+ if (args.tokenIndexList !== undefined && args.tokenIndexList !== null) {
786
+ this.tokenIndexList = Thrift.copyList(args.tokenIndexList, [null]);
787
+ } else {
788
+ throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field tokenIndexList is unset!');
789
+ }
790
+ if (args.anchorTokenIndex !== undefined && args.anchorTokenIndex !== null) {
791
+ this.anchorTokenIndex = args.anchorTokenIndex;
792
+ }
793
+ if (args.tokenizationId !== undefined && args.tokenizationId !== null) {
794
+ this.tokenizationId = new uuid_ttypes.UUID(args.tokenizationId);
795
+ } else {
796
+ throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field tokenizationId is unset!');
797
+ }
798
+ if (args.textSpan !== undefined && args.textSpan !== null) {
799
+ this.textSpan = new spans_ttypes.TextSpan(args.textSpan);
800
+ }
801
+ if (args.rawTextSpan !== undefined && args.rawTextSpan !== null) {
802
+ this.rawTextSpan = new spans_ttypes.TextSpan(args.rawTextSpan);
803
+ }
804
+ if (args.audioSpan !== undefined && args.audioSpan !== null) {
805
+ this.audioSpan = new spans_ttypes.AudioSpan(args.audioSpan);
806
+ }
807
+ if (args.dependencies !== undefined && args.dependencies !== null) {
808
+ this.dependencies = Thrift.copyList(args.dependencies, [ttypes.Dependency]);
809
+ }
810
+ if (args.constituent !== undefined && args.constituent !== null) {
811
+ this.constituent = new ttypes.ConstituentRef(args.constituent);
812
+ }
813
+ }
814
+ }
815
+
816
+ read (input) {
817
+ input.readStructBegin();
818
+ while (true) {
819
+ const ret = input.readFieldBegin();
820
+ const ftype = ret.ftype;
821
+ const fid = ret.fid;
822
+ if (ftype == Thrift.Type.STOP) {
823
+ break;
824
+ }
825
+ switch (fid) {
826
+ case 1:
827
+ if (ftype == Thrift.Type.LIST) {
828
+ this.tokenIndexList = [];
829
+ const _rtmp316 = input.readListBegin();
830
+ const _size15 = _rtmp316.size || 0;
831
+ for (let _i17 = 0; _i17 < _size15; ++_i17) {
832
+ let elem18 = null;
833
+ elem18 = input.readI32();
834
+ this.tokenIndexList.push(elem18);
835
+ }
836
+ input.readListEnd();
837
+ } else {
838
+ input.skip(ftype);
839
+ }
840
+ break;
841
+ case 2:
842
+ if (ftype == Thrift.Type.I32) {
843
+ this.anchorTokenIndex = input.readI32();
844
+ } else {
845
+ input.skip(ftype);
846
+ }
847
+ break;
848
+ case 3:
849
+ if (ftype == Thrift.Type.STRUCT) {
850
+ this.tokenizationId = new uuid_ttypes.UUID();
851
+ this.tokenizationId.read(input);
852
+ } else {
853
+ input.skip(ftype);
854
+ }
855
+ break;
856
+ case 4:
857
+ if (ftype == Thrift.Type.STRUCT) {
858
+ this.textSpan = new spans_ttypes.TextSpan();
859
+ this.textSpan.read(input);
860
+ } else {
861
+ input.skip(ftype);
862
+ }
863
+ break;
864
+ case 5:
865
+ if (ftype == Thrift.Type.STRUCT) {
866
+ this.rawTextSpan = new spans_ttypes.TextSpan();
867
+ this.rawTextSpan.read(input);
868
+ } else {
869
+ input.skip(ftype);
870
+ }
871
+ break;
872
+ case 6:
873
+ if (ftype == Thrift.Type.STRUCT) {
874
+ this.audioSpan = new spans_ttypes.AudioSpan();
875
+ this.audioSpan.read(input);
876
+ } else {
877
+ input.skip(ftype);
878
+ }
879
+ break;
880
+ case 7:
881
+ if (ftype == Thrift.Type.LIST) {
882
+ this.dependencies = [];
883
+ const _rtmp320 = input.readListBegin();
884
+ const _size19 = _rtmp320.size || 0;
885
+ for (let _i21 = 0; _i21 < _size19; ++_i21) {
886
+ let elem22 = null;
887
+ elem22 = new ttypes.Dependency();
888
+ elem22.read(input);
889
+ this.dependencies.push(elem22);
890
+ }
891
+ input.readListEnd();
892
+ } else {
893
+ input.skip(ftype);
894
+ }
895
+ break;
896
+ case 8:
897
+ if (ftype == Thrift.Type.STRUCT) {
898
+ this.constituent = new ttypes.ConstituentRef();
899
+ this.constituent.read(input);
900
+ } else {
901
+ input.skip(ftype);
902
+ }
903
+ break;
904
+ default:
905
+ input.skip(ftype);
906
+ }
907
+ input.readFieldEnd();
908
+ }
909
+ input.readStructEnd();
910
+ return;
911
+ }
912
+
913
+ write (output) {
914
+ output.writeStructBegin('TokenRefSequence');
915
+ if (this.tokenIndexList !== null && this.tokenIndexList !== undefined) {
916
+ output.writeFieldBegin('tokenIndexList', Thrift.Type.LIST, 1);
917
+ output.writeListBegin(Thrift.Type.I32, this.tokenIndexList.length);
918
+ for (let iter23 in this.tokenIndexList) {
919
+ if (this.tokenIndexList.hasOwnProperty(iter23)) {
920
+ iter23 = this.tokenIndexList[iter23];
921
+ output.writeI32(iter23);
922
+ }
923
+ }
924
+ output.writeListEnd();
925
+ output.writeFieldEnd();
926
+ }
927
+ if (this.anchorTokenIndex !== null && this.anchorTokenIndex !== undefined) {
928
+ output.writeFieldBegin('anchorTokenIndex', Thrift.Type.I32, 2);
929
+ output.writeI32(this.anchorTokenIndex);
930
+ output.writeFieldEnd();
931
+ }
932
+ if (this.tokenizationId !== null && this.tokenizationId !== undefined) {
933
+ output.writeFieldBegin('tokenizationId', Thrift.Type.STRUCT, 3);
934
+ this.tokenizationId.write(output);
935
+ output.writeFieldEnd();
936
+ }
937
+ if (this.textSpan !== null && this.textSpan !== undefined) {
938
+ output.writeFieldBegin('textSpan', Thrift.Type.STRUCT, 4);
939
+ this.textSpan.write(output);
940
+ output.writeFieldEnd();
941
+ }
942
+ if (this.rawTextSpan !== null && this.rawTextSpan !== undefined) {
943
+ output.writeFieldBegin('rawTextSpan', Thrift.Type.STRUCT, 5);
944
+ this.rawTextSpan.write(output);
945
+ output.writeFieldEnd();
946
+ }
947
+ if (this.audioSpan !== null && this.audioSpan !== undefined) {
948
+ output.writeFieldBegin('audioSpan', Thrift.Type.STRUCT, 6);
949
+ this.audioSpan.write(output);
950
+ output.writeFieldEnd();
951
+ }
952
+ if (this.dependencies !== null && this.dependencies !== undefined) {
953
+ output.writeFieldBegin('dependencies', Thrift.Type.LIST, 7);
954
+ output.writeListBegin(Thrift.Type.STRUCT, this.dependencies.length);
955
+ for (let iter24 in this.dependencies) {
956
+ if (this.dependencies.hasOwnProperty(iter24)) {
957
+ iter24 = this.dependencies[iter24];
958
+ iter24.write(output);
959
+ }
960
+ }
961
+ output.writeListEnd();
962
+ output.writeFieldEnd();
963
+ }
964
+ if (this.constituent !== null && this.constituent !== undefined) {
965
+ output.writeFieldBegin('constituent', Thrift.Type.STRUCT, 8);
966
+ this.constituent.write(output);
967
+ output.writeFieldEnd();
968
+ }
969
+ output.writeFieldStop();
970
+ output.writeStructEnd();
971
+ return;
972
+ }
973
+
974
+ };
975
+ const TaggedToken = module.exports.TaggedToken = class {
976
+ constructor(args) {
977
+ this.tokenIndex = null;
978
+ this.tag = null;
979
+ this.confidence = null;
980
+ this.tagList = null;
981
+ this.confidenceList = null;
982
+ if (args) {
983
+ if (args.tokenIndex !== undefined && args.tokenIndex !== null) {
984
+ this.tokenIndex = args.tokenIndex;
985
+ }
986
+ if (args.tag !== undefined && args.tag !== null) {
987
+ this.tag = args.tag;
988
+ }
989
+ if (args.confidence !== undefined && args.confidence !== null) {
990
+ this.confidence = args.confidence;
991
+ }
992
+ if (args.tagList !== undefined && args.tagList !== null) {
993
+ this.tagList = Thrift.copyList(args.tagList, [null]);
994
+ }
995
+ if (args.confidenceList !== undefined && args.confidenceList !== null) {
996
+ this.confidenceList = Thrift.copyList(args.confidenceList, [null]);
997
+ }
998
+ }
999
+ }
1000
+
1001
+ read (input) {
1002
+ input.readStructBegin();
1003
+ while (true) {
1004
+ const ret = input.readFieldBegin();
1005
+ const ftype = ret.ftype;
1006
+ const fid = ret.fid;
1007
+ if (ftype == Thrift.Type.STOP) {
1008
+ break;
1009
+ }
1010
+ switch (fid) {
1011
+ case 1:
1012
+ if (ftype == Thrift.Type.I32) {
1013
+ this.tokenIndex = input.readI32();
1014
+ } else {
1015
+ input.skip(ftype);
1016
+ }
1017
+ break;
1018
+ case 2:
1019
+ if (ftype == Thrift.Type.STRING) {
1020
+ this.tag = input.readString();
1021
+ } else {
1022
+ input.skip(ftype);
1023
+ }
1024
+ break;
1025
+ case 3:
1026
+ if (ftype == Thrift.Type.DOUBLE) {
1027
+ this.confidence = input.readDouble();
1028
+ } else {
1029
+ input.skip(ftype);
1030
+ }
1031
+ break;
1032
+ case 4:
1033
+ if (ftype == Thrift.Type.LIST) {
1034
+ this.tagList = [];
1035
+ const _rtmp326 = input.readListBegin();
1036
+ const _size25 = _rtmp326.size || 0;
1037
+ for (let _i27 = 0; _i27 < _size25; ++_i27) {
1038
+ let elem28 = null;
1039
+ elem28 = input.readString();
1040
+ this.tagList.push(elem28);
1041
+ }
1042
+ input.readListEnd();
1043
+ } else {
1044
+ input.skip(ftype);
1045
+ }
1046
+ break;
1047
+ case 5:
1048
+ if (ftype == Thrift.Type.LIST) {
1049
+ this.confidenceList = [];
1050
+ const _rtmp330 = input.readListBegin();
1051
+ const _size29 = _rtmp330.size || 0;
1052
+ for (let _i31 = 0; _i31 < _size29; ++_i31) {
1053
+ let elem32 = null;
1054
+ elem32 = input.readDouble();
1055
+ this.confidenceList.push(elem32);
1056
+ }
1057
+ input.readListEnd();
1058
+ } else {
1059
+ input.skip(ftype);
1060
+ }
1061
+ break;
1062
+ default:
1063
+ input.skip(ftype);
1064
+ }
1065
+ input.readFieldEnd();
1066
+ }
1067
+ input.readStructEnd();
1068
+ return;
1069
+ }
1070
+
1071
+ write (output) {
1072
+ output.writeStructBegin('TaggedToken');
1073
+ if (this.tokenIndex !== null && this.tokenIndex !== undefined) {
1074
+ output.writeFieldBegin('tokenIndex', Thrift.Type.I32, 1);
1075
+ output.writeI32(this.tokenIndex);
1076
+ output.writeFieldEnd();
1077
+ }
1078
+ if (this.tag !== null && this.tag !== undefined) {
1079
+ output.writeFieldBegin('tag', Thrift.Type.STRING, 2);
1080
+ output.writeString(this.tag);
1081
+ output.writeFieldEnd();
1082
+ }
1083
+ if (this.confidence !== null && this.confidence !== undefined) {
1084
+ output.writeFieldBegin('confidence', Thrift.Type.DOUBLE, 3);
1085
+ output.writeDouble(this.confidence);
1086
+ output.writeFieldEnd();
1087
+ }
1088
+ if (this.tagList !== null && this.tagList !== undefined) {
1089
+ output.writeFieldBegin('tagList', Thrift.Type.LIST, 4);
1090
+ output.writeListBegin(Thrift.Type.STRING, this.tagList.length);
1091
+ for (let iter33 in this.tagList) {
1092
+ if (this.tagList.hasOwnProperty(iter33)) {
1093
+ iter33 = this.tagList[iter33];
1094
+ output.writeString(iter33);
1095
+ }
1096
+ }
1097
+ output.writeListEnd();
1098
+ output.writeFieldEnd();
1099
+ }
1100
+ if (this.confidenceList !== null && this.confidenceList !== undefined) {
1101
+ output.writeFieldBegin('confidenceList', Thrift.Type.LIST, 5);
1102
+ output.writeListBegin(Thrift.Type.DOUBLE, this.confidenceList.length);
1103
+ for (let iter34 in this.confidenceList) {
1104
+ if (this.confidenceList.hasOwnProperty(iter34)) {
1105
+ iter34 = this.confidenceList[iter34];
1106
+ output.writeDouble(iter34);
1107
+ }
1108
+ }
1109
+ output.writeListEnd();
1110
+ output.writeFieldEnd();
1111
+ }
1112
+ output.writeFieldStop();
1113
+ output.writeStructEnd();
1114
+ return;
1115
+ }
1116
+
1117
+ };
1118
+ const TokenTagging = module.exports.TokenTagging = class {
1119
+ constructor(args) {
1120
+ this.uuid = null;
1121
+ this.metadata = null;
1122
+ this.taggedTokenList = null;
1123
+ this.taggingType = null;
1124
+ if (args) {
1125
+ if (args.uuid !== undefined && args.uuid !== null) {
1126
+ this.uuid = new uuid_ttypes.UUID(args.uuid);
1127
+ } else {
1128
+ throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field uuid is unset!');
1129
+ }
1130
+ if (args.metadata !== undefined && args.metadata !== null) {
1131
+ this.metadata = new metadata_ttypes.AnnotationMetadata(args.metadata);
1132
+ } else {
1133
+ throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field metadata is unset!');
1134
+ }
1135
+ if (args.taggedTokenList !== undefined && args.taggedTokenList !== null) {
1136
+ this.taggedTokenList = Thrift.copyList(args.taggedTokenList, [ttypes.TaggedToken]);
1137
+ } else {
1138
+ throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field taggedTokenList is unset!');
1139
+ }
1140
+ if (args.taggingType !== undefined && args.taggingType !== null) {
1141
+ this.taggingType = args.taggingType;
1142
+ }
1143
+ }
1144
+ }
1145
+
1146
+ read (input) {
1147
+ input.readStructBegin();
1148
+ while (true) {
1149
+ const ret = input.readFieldBegin();
1150
+ const ftype = ret.ftype;
1151
+ const fid = ret.fid;
1152
+ if (ftype == Thrift.Type.STOP) {
1153
+ break;
1154
+ }
1155
+ switch (fid) {
1156
+ case 1:
1157
+ if (ftype == Thrift.Type.STRUCT) {
1158
+ this.uuid = new uuid_ttypes.UUID();
1159
+ this.uuid.read(input);
1160
+ } else {
1161
+ input.skip(ftype);
1162
+ }
1163
+ break;
1164
+ case 2:
1165
+ if (ftype == Thrift.Type.STRUCT) {
1166
+ this.metadata = new metadata_ttypes.AnnotationMetadata();
1167
+ this.metadata.read(input);
1168
+ } else {
1169
+ input.skip(ftype);
1170
+ }
1171
+ break;
1172
+ case 3:
1173
+ if (ftype == Thrift.Type.LIST) {
1174
+ this.taggedTokenList = [];
1175
+ const _rtmp336 = input.readListBegin();
1176
+ const _size35 = _rtmp336.size || 0;
1177
+ for (let _i37 = 0; _i37 < _size35; ++_i37) {
1178
+ let elem38 = null;
1179
+ elem38 = new ttypes.TaggedToken();
1180
+ elem38.read(input);
1181
+ this.taggedTokenList.push(elem38);
1182
+ }
1183
+ input.readListEnd();
1184
+ } else {
1185
+ input.skip(ftype);
1186
+ }
1187
+ break;
1188
+ case 4:
1189
+ if (ftype == Thrift.Type.STRING) {
1190
+ this.taggingType = input.readString();
1191
+ } else {
1192
+ input.skip(ftype);
1193
+ }
1194
+ break;
1195
+ default:
1196
+ input.skip(ftype);
1197
+ }
1198
+ input.readFieldEnd();
1199
+ }
1200
+ input.readStructEnd();
1201
+ return;
1202
+ }
1203
+
1204
+ write (output) {
1205
+ output.writeStructBegin('TokenTagging');
1206
+ if (this.uuid !== null && this.uuid !== undefined) {
1207
+ output.writeFieldBegin('uuid', Thrift.Type.STRUCT, 1);
1208
+ this.uuid.write(output);
1209
+ output.writeFieldEnd();
1210
+ }
1211
+ if (this.metadata !== null && this.metadata !== undefined) {
1212
+ output.writeFieldBegin('metadata', Thrift.Type.STRUCT, 2);
1213
+ this.metadata.write(output);
1214
+ output.writeFieldEnd();
1215
+ }
1216
+ if (this.taggedTokenList !== null && this.taggedTokenList !== undefined) {
1217
+ output.writeFieldBegin('taggedTokenList', Thrift.Type.LIST, 3);
1218
+ output.writeListBegin(Thrift.Type.STRUCT, this.taggedTokenList.length);
1219
+ for (let iter39 in this.taggedTokenList) {
1220
+ if (this.taggedTokenList.hasOwnProperty(iter39)) {
1221
+ iter39 = this.taggedTokenList[iter39];
1222
+ iter39.write(output);
1223
+ }
1224
+ }
1225
+ output.writeListEnd();
1226
+ output.writeFieldEnd();
1227
+ }
1228
+ if (this.taggingType !== null && this.taggingType !== undefined) {
1229
+ output.writeFieldBegin('taggingType', Thrift.Type.STRING, 4);
1230
+ output.writeString(this.taggingType);
1231
+ output.writeFieldEnd();
1232
+ }
1233
+ output.writeFieldStop();
1234
+ output.writeStructEnd();
1235
+ return;
1236
+ }
1237
+
1238
+ };
1239
+ const LatticePath = module.exports.LatticePath = class {
1240
+ constructor(args) {
1241
+ this.weight = null;
1242
+ this.tokenList = null;
1243
+ if (args) {
1244
+ if (args.weight !== undefined && args.weight !== null) {
1245
+ this.weight = args.weight;
1246
+ }
1247
+ if (args.tokenList !== undefined && args.tokenList !== null) {
1248
+ this.tokenList = Thrift.copyList(args.tokenList, [ttypes.Token]);
1249
+ } else {
1250
+ throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field tokenList is unset!');
1251
+ }
1252
+ }
1253
+ }
1254
+
1255
+ read (input) {
1256
+ input.readStructBegin();
1257
+ while (true) {
1258
+ const ret = input.readFieldBegin();
1259
+ const ftype = ret.ftype;
1260
+ const fid = ret.fid;
1261
+ if (ftype == Thrift.Type.STOP) {
1262
+ break;
1263
+ }
1264
+ switch (fid) {
1265
+ case 1:
1266
+ if (ftype == Thrift.Type.DOUBLE) {
1267
+ this.weight = input.readDouble();
1268
+ } else {
1269
+ input.skip(ftype);
1270
+ }
1271
+ break;
1272
+ case 2:
1273
+ if (ftype == Thrift.Type.LIST) {
1274
+ this.tokenList = [];
1275
+ const _rtmp341 = input.readListBegin();
1276
+ const _size40 = _rtmp341.size || 0;
1277
+ for (let _i42 = 0; _i42 < _size40; ++_i42) {
1278
+ let elem43 = null;
1279
+ elem43 = new ttypes.Token();
1280
+ elem43.read(input);
1281
+ this.tokenList.push(elem43);
1282
+ }
1283
+ input.readListEnd();
1284
+ } else {
1285
+ input.skip(ftype);
1286
+ }
1287
+ break;
1288
+ default:
1289
+ input.skip(ftype);
1290
+ }
1291
+ input.readFieldEnd();
1292
+ }
1293
+ input.readStructEnd();
1294
+ return;
1295
+ }
1296
+
1297
+ write (output) {
1298
+ output.writeStructBegin('LatticePath');
1299
+ if (this.weight !== null && this.weight !== undefined) {
1300
+ output.writeFieldBegin('weight', Thrift.Type.DOUBLE, 1);
1301
+ output.writeDouble(this.weight);
1302
+ output.writeFieldEnd();
1303
+ }
1304
+ if (this.tokenList !== null && this.tokenList !== undefined) {
1305
+ output.writeFieldBegin('tokenList', Thrift.Type.LIST, 2);
1306
+ output.writeListBegin(Thrift.Type.STRUCT, this.tokenList.length);
1307
+ for (let iter44 in this.tokenList) {
1308
+ if (this.tokenList.hasOwnProperty(iter44)) {
1309
+ iter44 = this.tokenList[iter44];
1310
+ iter44.write(output);
1311
+ }
1312
+ }
1313
+ output.writeListEnd();
1314
+ output.writeFieldEnd();
1315
+ }
1316
+ output.writeFieldStop();
1317
+ output.writeStructEnd();
1318
+ return;
1319
+ }
1320
+
1321
+ };
1322
+ const Arc = module.exports.Arc = class {
1323
+ constructor(args) {
1324
+ this.src = null;
1325
+ this.dst = null;
1326
+ this.token = null;
1327
+ this.weight = null;
1328
+ if (args) {
1329
+ if (args.src !== undefined && args.src !== null) {
1330
+ this.src = args.src;
1331
+ }
1332
+ if (args.dst !== undefined && args.dst !== null) {
1333
+ this.dst = args.dst;
1334
+ }
1335
+ if (args.token !== undefined && args.token !== null) {
1336
+ this.token = new ttypes.Token(args.token);
1337
+ }
1338
+ if (args.weight !== undefined && args.weight !== null) {
1339
+ this.weight = args.weight;
1340
+ }
1341
+ }
1342
+ }
1343
+
1344
+ read (input) {
1345
+ input.readStructBegin();
1346
+ while (true) {
1347
+ const ret = input.readFieldBegin();
1348
+ const ftype = ret.ftype;
1349
+ const fid = ret.fid;
1350
+ if (ftype == Thrift.Type.STOP) {
1351
+ break;
1352
+ }
1353
+ switch (fid) {
1354
+ case 1:
1355
+ if (ftype == Thrift.Type.I32) {
1356
+ this.src = input.readI32();
1357
+ } else {
1358
+ input.skip(ftype);
1359
+ }
1360
+ break;
1361
+ case 2:
1362
+ if (ftype == Thrift.Type.I32) {
1363
+ this.dst = input.readI32();
1364
+ } else {
1365
+ input.skip(ftype);
1366
+ }
1367
+ break;
1368
+ case 3:
1369
+ if (ftype == Thrift.Type.STRUCT) {
1370
+ this.token = new ttypes.Token();
1371
+ this.token.read(input);
1372
+ } else {
1373
+ input.skip(ftype);
1374
+ }
1375
+ break;
1376
+ case 4:
1377
+ if (ftype == Thrift.Type.DOUBLE) {
1378
+ this.weight = input.readDouble();
1379
+ } else {
1380
+ input.skip(ftype);
1381
+ }
1382
+ break;
1383
+ default:
1384
+ input.skip(ftype);
1385
+ }
1386
+ input.readFieldEnd();
1387
+ }
1388
+ input.readStructEnd();
1389
+ return;
1390
+ }
1391
+
1392
+ write (output) {
1393
+ output.writeStructBegin('Arc');
1394
+ if (this.src !== null && this.src !== undefined) {
1395
+ output.writeFieldBegin('src', Thrift.Type.I32, 1);
1396
+ output.writeI32(this.src);
1397
+ output.writeFieldEnd();
1398
+ }
1399
+ if (this.dst !== null && this.dst !== undefined) {
1400
+ output.writeFieldBegin('dst', Thrift.Type.I32, 2);
1401
+ output.writeI32(this.dst);
1402
+ output.writeFieldEnd();
1403
+ }
1404
+ if (this.token !== null && this.token !== undefined) {
1405
+ output.writeFieldBegin('token', Thrift.Type.STRUCT, 3);
1406
+ this.token.write(output);
1407
+ output.writeFieldEnd();
1408
+ }
1409
+ if (this.weight !== null && this.weight !== undefined) {
1410
+ output.writeFieldBegin('weight', Thrift.Type.DOUBLE, 4);
1411
+ output.writeDouble(this.weight);
1412
+ output.writeFieldEnd();
1413
+ }
1414
+ output.writeFieldStop();
1415
+ output.writeStructEnd();
1416
+ return;
1417
+ }
1418
+
1419
+ };
1420
+ const TokenLattice = module.exports.TokenLattice = class {
1421
+ constructor(args) {
1422
+ this.startState = 0;
1423
+ this.endState = 0;
1424
+ this.arcList = null;
1425
+ this.cachedBestPath = null;
1426
+ if (args) {
1427
+ if (args.startState !== undefined && args.startState !== null) {
1428
+ this.startState = args.startState;
1429
+ }
1430
+ if (args.endState !== undefined && args.endState !== null) {
1431
+ this.endState = args.endState;
1432
+ }
1433
+ if (args.arcList !== undefined && args.arcList !== null) {
1434
+ this.arcList = Thrift.copyList(args.arcList, [ttypes.Arc]);
1435
+ } else {
1436
+ throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field arcList is unset!');
1437
+ }
1438
+ if (args.cachedBestPath !== undefined && args.cachedBestPath !== null) {
1439
+ this.cachedBestPath = new ttypes.LatticePath(args.cachedBestPath);
1440
+ }
1441
+ }
1442
+ }
1443
+
1444
+ read (input) {
1445
+ input.readStructBegin();
1446
+ while (true) {
1447
+ const ret = input.readFieldBegin();
1448
+ const ftype = ret.ftype;
1449
+ const fid = ret.fid;
1450
+ if (ftype == Thrift.Type.STOP) {
1451
+ break;
1452
+ }
1453
+ switch (fid) {
1454
+ case 1:
1455
+ if (ftype == Thrift.Type.I32) {
1456
+ this.startState = input.readI32();
1457
+ } else {
1458
+ input.skip(ftype);
1459
+ }
1460
+ break;
1461
+ case 2:
1462
+ if (ftype == Thrift.Type.I32) {
1463
+ this.endState = input.readI32();
1464
+ } else {
1465
+ input.skip(ftype);
1466
+ }
1467
+ break;
1468
+ case 3:
1469
+ if (ftype == Thrift.Type.LIST) {
1470
+ this.arcList = [];
1471
+ const _rtmp346 = input.readListBegin();
1472
+ const _size45 = _rtmp346.size || 0;
1473
+ for (let _i47 = 0; _i47 < _size45; ++_i47) {
1474
+ let elem48 = null;
1475
+ elem48 = new ttypes.Arc();
1476
+ elem48.read(input);
1477
+ this.arcList.push(elem48);
1478
+ }
1479
+ input.readListEnd();
1480
+ } else {
1481
+ input.skip(ftype);
1482
+ }
1483
+ break;
1484
+ case 4:
1485
+ if (ftype == Thrift.Type.STRUCT) {
1486
+ this.cachedBestPath = new ttypes.LatticePath();
1487
+ this.cachedBestPath.read(input);
1488
+ } else {
1489
+ input.skip(ftype);
1490
+ }
1491
+ break;
1492
+ default:
1493
+ input.skip(ftype);
1494
+ }
1495
+ input.readFieldEnd();
1496
+ }
1497
+ input.readStructEnd();
1498
+ return;
1499
+ }
1500
+
1501
+ write (output) {
1502
+ output.writeStructBegin('TokenLattice');
1503
+ if (this.startState !== null && this.startState !== undefined) {
1504
+ output.writeFieldBegin('startState', Thrift.Type.I32, 1);
1505
+ output.writeI32(this.startState);
1506
+ output.writeFieldEnd();
1507
+ }
1508
+ if (this.endState !== null && this.endState !== undefined) {
1509
+ output.writeFieldBegin('endState', Thrift.Type.I32, 2);
1510
+ output.writeI32(this.endState);
1511
+ output.writeFieldEnd();
1512
+ }
1513
+ if (this.arcList !== null && this.arcList !== undefined) {
1514
+ output.writeFieldBegin('arcList', Thrift.Type.LIST, 3);
1515
+ output.writeListBegin(Thrift.Type.STRUCT, this.arcList.length);
1516
+ for (let iter49 in this.arcList) {
1517
+ if (this.arcList.hasOwnProperty(iter49)) {
1518
+ iter49 = this.arcList[iter49];
1519
+ iter49.write(output);
1520
+ }
1521
+ }
1522
+ output.writeListEnd();
1523
+ output.writeFieldEnd();
1524
+ }
1525
+ if (this.cachedBestPath !== null && this.cachedBestPath !== undefined) {
1526
+ output.writeFieldBegin('cachedBestPath', Thrift.Type.STRUCT, 4);
1527
+ this.cachedBestPath.write(output);
1528
+ output.writeFieldEnd();
1529
+ }
1530
+ output.writeFieldStop();
1531
+ output.writeStructEnd();
1532
+ return;
1533
+ }
1534
+
1535
+ };
1536
+ const TokenList = module.exports.TokenList = class {
1537
+ constructor(args) {
1538
+ this.tokenList = null;
1539
+ if (args) {
1540
+ if (args.tokenList !== undefined && args.tokenList !== null) {
1541
+ this.tokenList = Thrift.copyList(args.tokenList, [ttypes.Token]);
1542
+ } else {
1543
+ throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field tokenList is unset!');
1544
+ }
1545
+ }
1546
+ }
1547
+
1548
+ read (input) {
1549
+ input.readStructBegin();
1550
+ while (true) {
1551
+ const ret = input.readFieldBegin();
1552
+ const ftype = ret.ftype;
1553
+ const fid = ret.fid;
1554
+ if (ftype == Thrift.Type.STOP) {
1555
+ break;
1556
+ }
1557
+ switch (fid) {
1558
+ case 1:
1559
+ if (ftype == Thrift.Type.LIST) {
1560
+ this.tokenList = [];
1561
+ const _rtmp351 = input.readListBegin();
1562
+ const _size50 = _rtmp351.size || 0;
1563
+ for (let _i52 = 0; _i52 < _size50; ++_i52) {
1564
+ let elem53 = null;
1565
+ elem53 = new ttypes.Token();
1566
+ elem53.read(input);
1567
+ this.tokenList.push(elem53);
1568
+ }
1569
+ input.readListEnd();
1570
+ } else {
1571
+ input.skip(ftype);
1572
+ }
1573
+ break;
1574
+ case 0:
1575
+ input.skip(ftype);
1576
+ break;
1577
+ default:
1578
+ input.skip(ftype);
1579
+ }
1580
+ input.readFieldEnd();
1581
+ }
1582
+ input.readStructEnd();
1583
+ return;
1584
+ }
1585
+
1586
+ write (output) {
1587
+ output.writeStructBegin('TokenList');
1588
+ if (this.tokenList !== null && this.tokenList !== undefined) {
1589
+ output.writeFieldBegin('tokenList', Thrift.Type.LIST, 1);
1590
+ output.writeListBegin(Thrift.Type.STRUCT, this.tokenList.length);
1591
+ for (let iter54 in this.tokenList) {
1592
+ if (this.tokenList.hasOwnProperty(iter54)) {
1593
+ iter54 = this.tokenList[iter54];
1594
+ iter54.write(output);
1595
+ }
1596
+ }
1597
+ output.writeListEnd();
1598
+ output.writeFieldEnd();
1599
+ }
1600
+ output.writeFieldStop();
1601
+ output.writeStructEnd();
1602
+ return;
1603
+ }
1604
+
1605
+ };
1606
+ const SpanLink = module.exports.SpanLink = class {
1607
+ constructor(args) {
1608
+ this.tokens = null;
1609
+ this.concreteTarget = null;
1610
+ this.externalTarget = null;
1611
+ this.linkType = null;
1612
+ if (args) {
1613
+ if (args.tokens !== undefined && args.tokens !== null) {
1614
+ this.tokens = new ttypes.TokenRefSequence(args.tokens);
1615
+ } else {
1616
+ throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field tokens is unset!');
1617
+ }
1618
+ if (args.concreteTarget !== undefined && args.concreteTarget !== null) {
1619
+ this.concreteTarget = new uuid_ttypes.UUID(args.concreteTarget);
1620
+ }
1621
+ if (args.externalTarget !== undefined && args.externalTarget !== null) {
1622
+ this.externalTarget = args.externalTarget;
1623
+ }
1624
+ if (args.linkType !== undefined && args.linkType !== null) {
1625
+ this.linkType = args.linkType;
1626
+ } else {
1627
+ throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field linkType is unset!');
1628
+ }
1629
+ }
1630
+ }
1631
+
1632
+ read (input) {
1633
+ input.readStructBegin();
1634
+ while (true) {
1635
+ const ret = input.readFieldBegin();
1636
+ const ftype = ret.ftype;
1637
+ const fid = ret.fid;
1638
+ if (ftype == Thrift.Type.STOP) {
1639
+ break;
1640
+ }
1641
+ switch (fid) {
1642
+ case 1:
1643
+ if (ftype == Thrift.Type.STRUCT) {
1644
+ this.tokens = new ttypes.TokenRefSequence();
1645
+ this.tokens.read(input);
1646
+ } else {
1647
+ input.skip(ftype);
1648
+ }
1649
+ break;
1650
+ case 2:
1651
+ if (ftype == Thrift.Type.STRUCT) {
1652
+ this.concreteTarget = new uuid_ttypes.UUID();
1653
+ this.concreteTarget.read(input);
1654
+ } else {
1655
+ input.skip(ftype);
1656
+ }
1657
+ break;
1658
+ case 3:
1659
+ if (ftype == Thrift.Type.STRING) {
1660
+ this.externalTarget = input.readString();
1661
+ } else {
1662
+ input.skip(ftype);
1663
+ }
1664
+ break;
1665
+ case 4:
1666
+ if (ftype == Thrift.Type.STRING) {
1667
+ this.linkType = input.readString();
1668
+ } else {
1669
+ input.skip(ftype);
1670
+ }
1671
+ break;
1672
+ default:
1673
+ input.skip(ftype);
1674
+ }
1675
+ input.readFieldEnd();
1676
+ }
1677
+ input.readStructEnd();
1678
+ return;
1679
+ }
1680
+
1681
+ write (output) {
1682
+ output.writeStructBegin('SpanLink');
1683
+ if (this.tokens !== null && this.tokens !== undefined) {
1684
+ output.writeFieldBegin('tokens', Thrift.Type.STRUCT, 1);
1685
+ this.tokens.write(output);
1686
+ output.writeFieldEnd();
1687
+ }
1688
+ if (this.concreteTarget !== null && this.concreteTarget !== undefined) {
1689
+ output.writeFieldBegin('concreteTarget', Thrift.Type.STRUCT, 2);
1690
+ this.concreteTarget.write(output);
1691
+ output.writeFieldEnd();
1692
+ }
1693
+ if (this.externalTarget !== null && this.externalTarget !== undefined) {
1694
+ output.writeFieldBegin('externalTarget', Thrift.Type.STRING, 3);
1695
+ output.writeString(this.externalTarget);
1696
+ output.writeFieldEnd();
1697
+ }
1698
+ if (this.linkType !== null && this.linkType !== undefined) {
1699
+ output.writeFieldBegin('linkType', Thrift.Type.STRING, 4);
1700
+ output.writeString(this.linkType);
1701
+ output.writeFieldEnd();
1702
+ }
1703
+ output.writeFieldStop();
1704
+ output.writeStructEnd();
1705
+ return;
1706
+ }
1707
+
1708
+ };
1709
+ const Tokenization = module.exports.Tokenization = class {
1710
+ constructor(args) {
1711
+ this.uuid = null;
1712
+ this.metadata = null;
1713
+ this.tokenList = null;
1714
+ this.lattice = null;
1715
+ this.kind = null;
1716
+ this.tokenTaggingList = null;
1717
+ this.parseList = null;
1718
+ this.dependencyParseList = null;
1719
+ this.spanLinkList = null;
1720
+ if (args) {
1721
+ if (args.uuid !== undefined && args.uuid !== null) {
1722
+ this.uuid = new uuid_ttypes.UUID(args.uuid);
1723
+ } else {
1724
+ throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field uuid is unset!');
1725
+ }
1726
+ if (args.metadata !== undefined && args.metadata !== null) {
1727
+ this.metadata = new metadata_ttypes.AnnotationMetadata(args.metadata);
1728
+ } else {
1729
+ throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field metadata is unset!');
1730
+ }
1731
+ if (args.tokenList !== undefined && args.tokenList !== null) {
1732
+ this.tokenList = new ttypes.TokenList(args.tokenList);
1733
+ }
1734
+ if (args.lattice !== undefined && args.lattice !== null) {
1735
+ this.lattice = new ttypes.TokenLattice(args.lattice);
1736
+ }
1737
+ if (args.kind !== undefined && args.kind !== null) {
1738
+ this.kind = args.kind;
1739
+ } else {
1740
+ throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field kind is unset!');
1741
+ }
1742
+ if (args.tokenTaggingList !== undefined && args.tokenTaggingList !== null) {
1743
+ this.tokenTaggingList = Thrift.copyList(args.tokenTaggingList, [ttypes.TokenTagging]);
1744
+ }
1745
+ if (args.parseList !== undefined && args.parseList !== null) {
1746
+ this.parseList = Thrift.copyList(args.parseList, [ttypes.Parse]);
1747
+ }
1748
+ if (args.dependencyParseList !== undefined && args.dependencyParseList !== null) {
1749
+ this.dependencyParseList = Thrift.copyList(args.dependencyParseList, [ttypes.DependencyParse]);
1750
+ }
1751
+ if (args.spanLinkList !== undefined && args.spanLinkList !== null) {
1752
+ this.spanLinkList = Thrift.copyList(args.spanLinkList, [ttypes.SpanLink]);
1753
+ }
1754
+ }
1755
+ }
1756
+
1757
+ read (input) {
1758
+ input.readStructBegin();
1759
+ while (true) {
1760
+ const ret = input.readFieldBegin();
1761
+ const ftype = ret.ftype;
1762
+ const fid = ret.fid;
1763
+ if (ftype == Thrift.Type.STOP) {
1764
+ break;
1765
+ }
1766
+ switch (fid) {
1767
+ case 1:
1768
+ if (ftype == Thrift.Type.STRUCT) {
1769
+ this.uuid = new uuid_ttypes.UUID();
1770
+ this.uuid.read(input);
1771
+ } else {
1772
+ input.skip(ftype);
1773
+ }
1774
+ break;
1775
+ case 2:
1776
+ if (ftype == Thrift.Type.STRUCT) {
1777
+ this.metadata = new metadata_ttypes.AnnotationMetadata();
1778
+ this.metadata.read(input);
1779
+ } else {
1780
+ input.skip(ftype);
1781
+ }
1782
+ break;
1783
+ case 3:
1784
+ if (ftype == Thrift.Type.STRUCT) {
1785
+ this.tokenList = new ttypes.TokenList();
1786
+ this.tokenList.read(input);
1787
+ } else {
1788
+ input.skip(ftype);
1789
+ }
1790
+ break;
1791
+ case 4:
1792
+ if (ftype == Thrift.Type.STRUCT) {
1793
+ this.lattice = new ttypes.TokenLattice();
1794
+ this.lattice.read(input);
1795
+ } else {
1796
+ input.skip(ftype);
1797
+ }
1798
+ break;
1799
+ case 5:
1800
+ if (ftype == Thrift.Type.I32) {
1801
+ this.kind = input.readI32();
1802
+ } else {
1803
+ input.skip(ftype);
1804
+ }
1805
+ break;
1806
+ case 6:
1807
+ if (ftype == Thrift.Type.LIST) {
1808
+ this.tokenTaggingList = [];
1809
+ const _rtmp356 = input.readListBegin();
1810
+ const _size55 = _rtmp356.size || 0;
1811
+ for (let _i57 = 0; _i57 < _size55; ++_i57) {
1812
+ let elem58 = null;
1813
+ elem58 = new ttypes.TokenTagging();
1814
+ elem58.read(input);
1815
+ this.tokenTaggingList.push(elem58);
1816
+ }
1817
+ input.readListEnd();
1818
+ } else {
1819
+ input.skip(ftype);
1820
+ }
1821
+ break;
1822
+ case 7:
1823
+ if (ftype == Thrift.Type.LIST) {
1824
+ this.parseList = [];
1825
+ const _rtmp360 = input.readListBegin();
1826
+ const _size59 = _rtmp360.size || 0;
1827
+ for (let _i61 = 0; _i61 < _size59; ++_i61) {
1828
+ let elem62 = null;
1829
+ elem62 = new ttypes.Parse();
1830
+ elem62.read(input);
1831
+ this.parseList.push(elem62);
1832
+ }
1833
+ input.readListEnd();
1834
+ } else {
1835
+ input.skip(ftype);
1836
+ }
1837
+ break;
1838
+ case 8:
1839
+ if (ftype == Thrift.Type.LIST) {
1840
+ this.dependencyParseList = [];
1841
+ const _rtmp364 = input.readListBegin();
1842
+ const _size63 = _rtmp364.size || 0;
1843
+ for (let _i65 = 0; _i65 < _size63; ++_i65) {
1844
+ let elem66 = null;
1845
+ elem66 = new ttypes.DependencyParse();
1846
+ elem66.read(input);
1847
+ this.dependencyParseList.push(elem66);
1848
+ }
1849
+ input.readListEnd();
1850
+ } else {
1851
+ input.skip(ftype);
1852
+ }
1853
+ break;
1854
+ case 9:
1855
+ if (ftype == Thrift.Type.LIST) {
1856
+ this.spanLinkList = [];
1857
+ const _rtmp368 = input.readListBegin();
1858
+ const _size67 = _rtmp368.size || 0;
1859
+ for (let _i69 = 0; _i69 < _size67; ++_i69) {
1860
+ let elem70 = null;
1861
+ elem70 = new ttypes.SpanLink();
1862
+ elem70.read(input);
1863
+ this.spanLinkList.push(elem70);
1864
+ }
1865
+ input.readListEnd();
1866
+ } else {
1867
+ input.skip(ftype);
1868
+ }
1869
+ break;
1870
+ default:
1871
+ input.skip(ftype);
1872
+ }
1873
+ input.readFieldEnd();
1874
+ }
1875
+ input.readStructEnd();
1876
+ return;
1877
+ }
1878
+
1879
+ write (output) {
1880
+ output.writeStructBegin('Tokenization');
1881
+ if (this.uuid !== null && this.uuid !== undefined) {
1882
+ output.writeFieldBegin('uuid', Thrift.Type.STRUCT, 1);
1883
+ this.uuid.write(output);
1884
+ output.writeFieldEnd();
1885
+ }
1886
+ if (this.metadata !== null && this.metadata !== undefined) {
1887
+ output.writeFieldBegin('metadata', Thrift.Type.STRUCT, 2);
1888
+ this.metadata.write(output);
1889
+ output.writeFieldEnd();
1890
+ }
1891
+ if (this.tokenList !== null && this.tokenList !== undefined) {
1892
+ output.writeFieldBegin('tokenList', Thrift.Type.STRUCT, 3);
1893
+ this.tokenList.write(output);
1894
+ output.writeFieldEnd();
1895
+ }
1896
+ if (this.lattice !== null && this.lattice !== undefined) {
1897
+ output.writeFieldBegin('lattice', Thrift.Type.STRUCT, 4);
1898
+ this.lattice.write(output);
1899
+ output.writeFieldEnd();
1900
+ }
1901
+ if (this.kind !== null && this.kind !== undefined) {
1902
+ output.writeFieldBegin('kind', Thrift.Type.I32, 5);
1903
+ output.writeI32(this.kind);
1904
+ output.writeFieldEnd();
1905
+ }
1906
+ if (this.tokenTaggingList !== null && this.tokenTaggingList !== undefined) {
1907
+ output.writeFieldBegin('tokenTaggingList', Thrift.Type.LIST, 6);
1908
+ output.writeListBegin(Thrift.Type.STRUCT, this.tokenTaggingList.length);
1909
+ for (let iter71 in this.tokenTaggingList) {
1910
+ if (this.tokenTaggingList.hasOwnProperty(iter71)) {
1911
+ iter71 = this.tokenTaggingList[iter71];
1912
+ iter71.write(output);
1913
+ }
1914
+ }
1915
+ output.writeListEnd();
1916
+ output.writeFieldEnd();
1917
+ }
1918
+ if (this.parseList !== null && this.parseList !== undefined) {
1919
+ output.writeFieldBegin('parseList', Thrift.Type.LIST, 7);
1920
+ output.writeListBegin(Thrift.Type.STRUCT, this.parseList.length);
1921
+ for (let iter72 in this.parseList) {
1922
+ if (this.parseList.hasOwnProperty(iter72)) {
1923
+ iter72 = this.parseList[iter72];
1924
+ iter72.write(output);
1925
+ }
1926
+ }
1927
+ output.writeListEnd();
1928
+ output.writeFieldEnd();
1929
+ }
1930
+ if (this.dependencyParseList !== null && this.dependencyParseList !== undefined) {
1931
+ output.writeFieldBegin('dependencyParseList', Thrift.Type.LIST, 8);
1932
+ output.writeListBegin(Thrift.Type.STRUCT, this.dependencyParseList.length);
1933
+ for (let iter73 in this.dependencyParseList) {
1934
+ if (this.dependencyParseList.hasOwnProperty(iter73)) {
1935
+ iter73 = this.dependencyParseList[iter73];
1936
+ iter73.write(output);
1937
+ }
1938
+ }
1939
+ output.writeListEnd();
1940
+ output.writeFieldEnd();
1941
+ }
1942
+ if (this.spanLinkList !== null && this.spanLinkList !== undefined) {
1943
+ output.writeFieldBegin('spanLinkList', Thrift.Type.LIST, 9);
1944
+ output.writeListBegin(Thrift.Type.STRUCT, this.spanLinkList.length);
1945
+ for (let iter74 in this.spanLinkList) {
1946
+ if (this.spanLinkList.hasOwnProperty(iter74)) {
1947
+ iter74 = this.spanLinkList[iter74];
1948
+ iter74.write(output);
1949
+ }
1950
+ }
1951
+ output.writeListEnd();
1952
+ output.writeFieldEnd();
1953
+ }
1954
+ output.writeFieldStop();
1955
+ output.writeStructEnd();
1956
+ return;
1957
+ }
1958
+
1959
+ };
1960
+ const Sentence = module.exports.Sentence = class {
1961
+ constructor(args) {
1962
+ this.uuid = null;
1963
+ this.tokenization = null;
1964
+ this.textSpan = null;
1965
+ this.rawTextSpan = null;
1966
+ this.audioSpan = null;
1967
+ if (args) {
1968
+ if (args.uuid !== undefined && args.uuid !== null) {
1969
+ this.uuid = new uuid_ttypes.UUID(args.uuid);
1970
+ } else {
1971
+ throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field uuid is unset!');
1972
+ }
1973
+ if (args.tokenization !== undefined && args.tokenization !== null) {
1974
+ this.tokenization = new ttypes.Tokenization(args.tokenization);
1975
+ }
1976
+ if (args.textSpan !== undefined && args.textSpan !== null) {
1977
+ this.textSpan = new spans_ttypes.TextSpan(args.textSpan);
1978
+ }
1979
+ if (args.rawTextSpan !== undefined && args.rawTextSpan !== null) {
1980
+ this.rawTextSpan = new spans_ttypes.TextSpan(args.rawTextSpan);
1981
+ }
1982
+ if (args.audioSpan !== undefined && args.audioSpan !== null) {
1983
+ this.audioSpan = new spans_ttypes.AudioSpan(args.audioSpan);
1984
+ }
1985
+ }
1986
+ }
1987
+
1988
+ read (input) {
1989
+ input.readStructBegin();
1990
+ while (true) {
1991
+ const ret = input.readFieldBegin();
1992
+ const ftype = ret.ftype;
1993
+ const fid = ret.fid;
1994
+ if (ftype == Thrift.Type.STOP) {
1995
+ break;
1996
+ }
1997
+ switch (fid) {
1998
+ case 1:
1999
+ if (ftype == Thrift.Type.STRUCT) {
2000
+ this.uuid = new uuid_ttypes.UUID();
2001
+ this.uuid.read(input);
2002
+ } else {
2003
+ input.skip(ftype);
2004
+ }
2005
+ break;
2006
+ case 2:
2007
+ if (ftype == Thrift.Type.STRUCT) {
2008
+ this.tokenization = new ttypes.Tokenization();
2009
+ this.tokenization.read(input);
2010
+ } else {
2011
+ input.skip(ftype);
2012
+ }
2013
+ break;
2014
+ case 3:
2015
+ if (ftype == Thrift.Type.STRUCT) {
2016
+ this.textSpan = new spans_ttypes.TextSpan();
2017
+ this.textSpan.read(input);
2018
+ } else {
2019
+ input.skip(ftype);
2020
+ }
2021
+ break;
2022
+ case 4:
2023
+ if (ftype == Thrift.Type.STRUCT) {
2024
+ this.rawTextSpan = new spans_ttypes.TextSpan();
2025
+ this.rawTextSpan.read(input);
2026
+ } else {
2027
+ input.skip(ftype);
2028
+ }
2029
+ break;
2030
+ case 5:
2031
+ if (ftype == Thrift.Type.STRUCT) {
2032
+ this.audioSpan = new spans_ttypes.AudioSpan();
2033
+ this.audioSpan.read(input);
2034
+ } else {
2035
+ input.skip(ftype);
2036
+ }
2037
+ break;
2038
+ default:
2039
+ input.skip(ftype);
2040
+ }
2041
+ input.readFieldEnd();
2042
+ }
2043
+ input.readStructEnd();
2044
+ return;
2045
+ }
2046
+
2047
+ write (output) {
2048
+ output.writeStructBegin('Sentence');
2049
+ if (this.uuid !== null && this.uuid !== undefined) {
2050
+ output.writeFieldBegin('uuid', Thrift.Type.STRUCT, 1);
2051
+ this.uuid.write(output);
2052
+ output.writeFieldEnd();
2053
+ }
2054
+ if (this.tokenization !== null && this.tokenization !== undefined) {
2055
+ output.writeFieldBegin('tokenization', Thrift.Type.STRUCT, 2);
2056
+ this.tokenization.write(output);
2057
+ output.writeFieldEnd();
2058
+ }
2059
+ if (this.textSpan !== null && this.textSpan !== undefined) {
2060
+ output.writeFieldBegin('textSpan', Thrift.Type.STRUCT, 3);
2061
+ this.textSpan.write(output);
2062
+ output.writeFieldEnd();
2063
+ }
2064
+ if (this.rawTextSpan !== null && this.rawTextSpan !== undefined) {
2065
+ output.writeFieldBegin('rawTextSpan', Thrift.Type.STRUCT, 4);
2066
+ this.rawTextSpan.write(output);
2067
+ output.writeFieldEnd();
2068
+ }
2069
+ if (this.audioSpan !== null && this.audioSpan !== undefined) {
2070
+ output.writeFieldBegin('audioSpan', Thrift.Type.STRUCT, 5);
2071
+ this.audioSpan.write(output);
2072
+ output.writeFieldEnd();
2073
+ }
2074
+ output.writeFieldStop();
2075
+ output.writeStructEnd();
2076
+ return;
2077
+ }
2078
+
2079
+ };
2080
+ const Section = module.exports.Section = class {
2081
+ constructor(args) {
2082
+ this.uuid = null;
2083
+ this.sentenceList = null;
2084
+ this.textSpan = null;
2085
+ this.rawTextSpan = null;
2086
+ this.audioSpan = null;
2087
+ this.kind = null;
2088
+ this.label = null;
2089
+ this.numberList = null;
2090
+ this.lidList = null;
2091
+ if (args) {
2092
+ if (args.uuid !== undefined && args.uuid !== null) {
2093
+ this.uuid = new uuid_ttypes.UUID(args.uuid);
2094
+ } else {
2095
+ throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field uuid is unset!');
2096
+ }
2097
+ if (args.sentenceList !== undefined && args.sentenceList !== null) {
2098
+ this.sentenceList = Thrift.copyList(args.sentenceList, [ttypes.Sentence]);
2099
+ }
2100
+ if (args.textSpan !== undefined && args.textSpan !== null) {
2101
+ this.textSpan = new spans_ttypes.TextSpan(args.textSpan);
2102
+ }
2103
+ if (args.rawTextSpan !== undefined && args.rawTextSpan !== null) {
2104
+ this.rawTextSpan = new spans_ttypes.TextSpan(args.rawTextSpan);
2105
+ }
2106
+ if (args.audioSpan !== undefined && args.audioSpan !== null) {
2107
+ this.audioSpan = new spans_ttypes.AudioSpan(args.audioSpan);
2108
+ }
2109
+ if (args.kind !== undefined && args.kind !== null) {
2110
+ this.kind = args.kind;
2111
+ } else {
2112
+ throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field kind is unset!');
2113
+ }
2114
+ if (args.label !== undefined && args.label !== null) {
2115
+ this.label = args.label;
2116
+ }
2117
+ if (args.numberList !== undefined && args.numberList !== null) {
2118
+ this.numberList = Thrift.copyList(args.numberList, [null]);
2119
+ }
2120
+ if (args.lidList !== undefined && args.lidList !== null) {
2121
+ this.lidList = Thrift.copyList(args.lidList, [language_ttypes.LanguageIdentification]);
2122
+ }
2123
+ }
2124
+ }
2125
+
2126
+ read (input) {
2127
+ input.readStructBegin();
2128
+ while (true) {
2129
+ const ret = input.readFieldBegin();
2130
+ const ftype = ret.ftype;
2131
+ const fid = ret.fid;
2132
+ if (ftype == Thrift.Type.STOP) {
2133
+ break;
2134
+ }
2135
+ switch (fid) {
2136
+ case 1:
2137
+ if (ftype == Thrift.Type.STRUCT) {
2138
+ this.uuid = new uuid_ttypes.UUID();
2139
+ this.uuid.read(input);
2140
+ } else {
2141
+ input.skip(ftype);
2142
+ }
2143
+ break;
2144
+ case 2:
2145
+ if (ftype == Thrift.Type.LIST) {
2146
+ this.sentenceList = [];
2147
+ const _rtmp376 = input.readListBegin();
2148
+ const _size75 = _rtmp376.size || 0;
2149
+ for (let _i77 = 0; _i77 < _size75; ++_i77) {
2150
+ let elem78 = null;
2151
+ elem78 = new ttypes.Sentence();
2152
+ elem78.read(input);
2153
+ this.sentenceList.push(elem78);
2154
+ }
2155
+ input.readListEnd();
2156
+ } else {
2157
+ input.skip(ftype);
2158
+ }
2159
+ break;
2160
+ case 3:
2161
+ if (ftype == Thrift.Type.STRUCT) {
2162
+ this.textSpan = new spans_ttypes.TextSpan();
2163
+ this.textSpan.read(input);
2164
+ } else {
2165
+ input.skip(ftype);
2166
+ }
2167
+ break;
2168
+ case 4:
2169
+ if (ftype == Thrift.Type.STRUCT) {
2170
+ this.rawTextSpan = new spans_ttypes.TextSpan();
2171
+ this.rawTextSpan.read(input);
2172
+ } else {
2173
+ input.skip(ftype);
2174
+ }
2175
+ break;
2176
+ case 9:
2177
+ if (ftype == Thrift.Type.STRUCT) {
2178
+ this.audioSpan = new spans_ttypes.AudioSpan();
2179
+ this.audioSpan.read(input);
2180
+ } else {
2181
+ input.skip(ftype);
2182
+ }
2183
+ break;
2184
+ case 5:
2185
+ if (ftype == Thrift.Type.STRING) {
2186
+ this.kind = input.readString();
2187
+ } else {
2188
+ input.skip(ftype);
2189
+ }
2190
+ break;
2191
+ case 6:
2192
+ if (ftype == Thrift.Type.STRING) {
2193
+ this.label = input.readString();
2194
+ } else {
2195
+ input.skip(ftype);
2196
+ }
2197
+ break;
2198
+ case 7:
2199
+ if (ftype == Thrift.Type.LIST) {
2200
+ this.numberList = [];
2201
+ const _rtmp380 = input.readListBegin();
2202
+ const _size79 = _rtmp380.size || 0;
2203
+ for (let _i81 = 0; _i81 < _size79; ++_i81) {
2204
+ let elem82 = null;
2205
+ elem82 = input.readI32();
2206
+ this.numberList.push(elem82);
2207
+ }
2208
+ input.readListEnd();
2209
+ } else {
2210
+ input.skip(ftype);
2211
+ }
2212
+ break;
2213
+ case 8:
2214
+ if (ftype == Thrift.Type.LIST) {
2215
+ this.lidList = [];
2216
+ const _rtmp384 = input.readListBegin();
2217
+ const _size83 = _rtmp384.size || 0;
2218
+ for (let _i85 = 0; _i85 < _size83; ++_i85) {
2219
+ let elem86 = null;
2220
+ elem86 = new language_ttypes.LanguageIdentification();
2221
+ elem86.read(input);
2222
+ this.lidList.push(elem86);
2223
+ }
2224
+ input.readListEnd();
2225
+ } else {
2226
+ input.skip(ftype);
2227
+ }
2228
+ break;
2229
+ default:
2230
+ input.skip(ftype);
2231
+ }
2232
+ input.readFieldEnd();
2233
+ }
2234
+ input.readStructEnd();
2235
+ return;
2236
+ }
2237
+
2238
+ write (output) {
2239
+ output.writeStructBegin('Section');
2240
+ if (this.uuid !== null && this.uuid !== undefined) {
2241
+ output.writeFieldBegin('uuid', Thrift.Type.STRUCT, 1);
2242
+ this.uuid.write(output);
2243
+ output.writeFieldEnd();
2244
+ }
2245
+ if (this.sentenceList !== null && this.sentenceList !== undefined) {
2246
+ output.writeFieldBegin('sentenceList', Thrift.Type.LIST, 2);
2247
+ output.writeListBegin(Thrift.Type.STRUCT, this.sentenceList.length);
2248
+ for (let iter87 in this.sentenceList) {
2249
+ if (this.sentenceList.hasOwnProperty(iter87)) {
2250
+ iter87 = this.sentenceList[iter87];
2251
+ iter87.write(output);
2252
+ }
2253
+ }
2254
+ output.writeListEnd();
2255
+ output.writeFieldEnd();
2256
+ }
2257
+ if (this.textSpan !== null && this.textSpan !== undefined) {
2258
+ output.writeFieldBegin('textSpan', Thrift.Type.STRUCT, 3);
2259
+ this.textSpan.write(output);
2260
+ output.writeFieldEnd();
2261
+ }
2262
+ if (this.rawTextSpan !== null && this.rawTextSpan !== undefined) {
2263
+ output.writeFieldBegin('rawTextSpan', Thrift.Type.STRUCT, 4);
2264
+ this.rawTextSpan.write(output);
2265
+ output.writeFieldEnd();
2266
+ }
2267
+ if (this.audioSpan !== null && this.audioSpan !== undefined) {
2268
+ output.writeFieldBegin('audioSpan', Thrift.Type.STRUCT, 9);
2269
+ this.audioSpan.write(output);
2270
+ output.writeFieldEnd();
2271
+ }
2272
+ if (this.kind !== null && this.kind !== undefined) {
2273
+ output.writeFieldBegin('kind', Thrift.Type.STRING, 5);
2274
+ output.writeString(this.kind);
2275
+ output.writeFieldEnd();
2276
+ }
2277
+ if (this.label !== null && this.label !== undefined) {
2278
+ output.writeFieldBegin('label', Thrift.Type.STRING, 6);
2279
+ output.writeString(this.label);
2280
+ output.writeFieldEnd();
2281
+ }
2282
+ if (this.numberList !== null && this.numberList !== undefined) {
2283
+ output.writeFieldBegin('numberList', Thrift.Type.LIST, 7);
2284
+ output.writeListBegin(Thrift.Type.I32, this.numberList.length);
2285
+ for (let iter88 in this.numberList) {
2286
+ if (this.numberList.hasOwnProperty(iter88)) {
2287
+ iter88 = this.numberList[iter88];
2288
+ output.writeI32(iter88);
2289
+ }
2290
+ }
2291
+ output.writeListEnd();
2292
+ output.writeFieldEnd();
2293
+ }
2294
+ if (this.lidList !== null && this.lidList !== undefined) {
2295
+ output.writeFieldBegin('lidList', Thrift.Type.LIST, 8);
2296
+ output.writeListBegin(Thrift.Type.STRUCT, this.lidList.length);
2297
+ for (let iter89 in this.lidList) {
2298
+ if (this.lidList.hasOwnProperty(iter89)) {
2299
+ iter89 = this.lidList[iter89];
2300
+ iter89.write(output);
2301
+ }
2302
+ }
2303
+ output.writeListEnd();
2304
+ output.writeFieldEnd();
2305
+ }
2306
+ output.writeFieldStop();
2307
+ output.writeStructEnd();
2308
+ return;
2309
+ }
2310
+
2311
+ };