1 // automatically generated by the FlatBuffers compiler, do not modify
2 
3 
4 #ifndef FLATBUFFERS_GENERATED_MODEL_LIBTEXTCLASSIFIER3_H_
5 #define FLATBUFFERS_GENERATED_MODEL_LIBTEXTCLASSIFIER3_H_
6 
7 #include "flatbuffers/flatbuffers.h"
8 
9 // Ensure the included flatbuffers.h is the same version as when this file was
10 // generated, otherwise it may not be compatible.
11 static_assert(FLATBUFFERS_VERSION_MAJOR == 2 &&
12               FLATBUFFERS_VERSION_MINOR == 0 &&
13               FLATBUFFERS_VERSION_REVISION == 7,
14              "Non-compatible flatbuffers version included");
15 
16 #include "annotator/entity-data_generated.h"
17 #include "annotator/experimental/experimental_generated.h"
18 #include "utils/codepoint-range_generated.h"
19 #include "utils/container/bit-vector_generated.h"
20 #include "utils/flatbuffers/flatbuffers_generated.h"
21 #include "utils/grammar/rules_generated.h"
22 #include "utils/intents/intent-config_generated.h"
23 #include "utils/normalization_generated.h"
24 #include "utils/resources_generated.h"
25 #include "utils/tokenizer_generated.h"
26 #include "utils/zlib/buffer_generated.h"
27 
28 namespace libtextclassifier3 {
29 
30 struct SelectionModelOptions;
31 struct SelectionModelOptionsBuilder;
32 struct SelectionModelOptionsT;
33 
34 struct ClassificationModelOptions;
35 struct ClassificationModelOptionsBuilder;
36 struct ClassificationModelOptionsT;
37 
38 struct VerificationOptions;
39 struct VerificationOptionsBuilder;
40 struct VerificationOptionsT;
41 
42 struct CapturingGroup;
43 struct CapturingGroupBuilder;
44 struct CapturingGroupT;
45 
46 namespace RegexModel_ {
47 
48 struct Pattern;
49 struct PatternBuilder;
50 struct PatternT;
51 
52 }  // namespace RegexModel_
53 
54 struct RegexModel;
55 struct RegexModelBuilder;
56 struct RegexModelT;
57 
58 namespace DatetimeModelPattern_ {
59 
60 struct Regex;
61 struct RegexBuilder;
62 struct RegexT;
63 
64 }  // namespace DatetimeModelPattern_
65 
66 struct DatetimeModelPattern;
67 struct DatetimeModelPatternBuilder;
68 struct DatetimeModelPatternT;
69 
70 struct DatetimeModelExtractor;
71 struct DatetimeModelExtractorBuilder;
72 struct DatetimeModelExtractorT;
73 
74 struct DatetimeModel;
75 struct DatetimeModelBuilder;
76 struct DatetimeModelT;
77 
78 struct GrammarTokenizerOptions;
79 struct GrammarTokenizerOptionsBuilder;
80 struct GrammarTokenizerOptionsT;
81 
82 namespace DatetimeModelLibrary_ {
83 
84 struct Item;
85 struct ItemBuilder;
86 struct ItemT;
87 
88 }  // namespace DatetimeModelLibrary_
89 
90 struct DatetimeModelLibrary;
91 struct DatetimeModelLibraryBuilder;
92 struct DatetimeModelLibraryT;
93 
94 namespace GrammarModel_ {
95 
96 struct RuleClassificationResult;
97 struct RuleClassificationResultBuilder;
98 struct RuleClassificationResultT;
99 
100 }  // namespace GrammarModel_
101 
102 struct GrammarModel;
103 struct GrammarModelBuilder;
104 struct GrammarModelT;
105 
106 namespace MoneyParsingOptions_ {
107 
108 struct QuantitiesNameToExponentEntry;
109 struct QuantitiesNameToExponentEntryBuilder;
110 struct QuantitiesNameToExponentEntryT;
111 
112 }  // namespace MoneyParsingOptions_
113 
114 struct MoneyParsingOptions;
115 struct MoneyParsingOptionsBuilder;
116 struct MoneyParsingOptionsT;
117 
118 namespace ModelTriggeringOptions_ {
119 
120 struct CollectionToPriorityEntry;
121 struct CollectionToPriorityEntryBuilder;
122 struct CollectionToPriorityEntryT;
123 
124 }  // namespace ModelTriggeringOptions_
125 
126 struct ModelTriggeringOptions;
127 struct ModelTriggeringOptionsBuilder;
128 struct ModelTriggeringOptionsT;
129 
130 struct OutputOptions;
131 struct OutputOptionsBuilder;
132 struct OutputOptionsT;
133 
134 namespace Model_ {
135 
136 struct EmbeddingPruningMask;
137 struct EmbeddingPruningMaskBuilder;
138 struct EmbeddingPruningMaskT;
139 
140 struct ConflictResolutionOptions;
141 struct ConflictResolutionOptionsBuilder;
142 struct ConflictResolutionOptionsT;
143 
144 }  // namespace Model_
145 
146 struct Model;
147 struct ModelBuilder;
148 struct ModelT;
149 
150 namespace FeatureProcessorOptions_ {
151 
152 struct BoundsSensitiveFeatures;
153 struct BoundsSensitiveFeaturesBuilder;
154 struct BoundsSensitiveFeaturesT;
155 
156 }  // namespace FeatureProcessorOptions_
157 
158 struct FeatureProcessorOptions;
159 struct FeatureProcessorOptionsBuilder;
160 struct FeatureProcessorOptionsT;
161 
162 struct NumberAnnotatorOptions;
163 struct NumberAnnotatorOptionsBuilder;
164 struct NumberAnnotatorOptionsT;
165 
166 struct DurationAnnotatorOptions;
167 struct DurationAnnotatorOptionsBuilder;
168 struct DurationAnnotatorOptionsT;
169 
170 struct ContactAnnotatorOptions;
171 struct ContactAnnotatorOptionsBuilder;
172 struct ContactAnnotatorOptionsT;
173 
174 namespace TranslateAnnotatorOptions_ {
175 
176 struct BackoffOptions;
177 struct BackoffOptionsBuilder;
178 struct BackoffOptionsT;
179 
180 }  // namespace TranslateAnnotatorOptions_
181 
182 struct TranslateAnnotatorOptions;
183 struct TranslateAnnotatorOptionsBuilder;
184 struct TranslateAnnotatorOptionsT;
185 
186 namespace PodNerModel_ {
187 
188 struct Collection;
189 struct CollectionBuilder;
190 struct CollectionT;
191 
192 struct Label;
193 struct LabelBuilder;
194 struct LabelT;
195 
196 }  // namespace PodNerModel_
197 
198 struct PodNerModel;
199 struct PodNerModelBuilder;
200 struct PodNerModelT;
201 
202 struct VocabModel;
203 struct VocabModelBuilder;
204 struct VocabModelT;
205 
206 enum ModeFlag : int32_t {
207   ModeFlag_NONE = 0,
208   ModeFlag_ANNOTATION = 1,
209   ModeFlag_CLASSIFICATION = 2,
210   ModeFlag_ANNOTATION_AND_CLASSIFICATION = 3,
211   ModeFlag_SELECTION = 4,
212   ModeFlag_ANNOTATION_AND_SELECTION = 5,
213   ModeFlag_CLASSIFICATION_AND_SELECTION = 6,
214   ModeFlag_ALL = 7,
215   ModeFlag_MIN = ModeFlag_NONE,
216   ModeFlag_MAX = ModeFlag_ALL
217 };
218 
EnumValuesModeFlag()219 inline const ModeFlag (&EnumValuesModeFlag())[8] {
220   static const ModeFlag values[] = {
221     ModeFlag_NONE,
222     ModeFlag_ANNOTATION,
223     ModeFlag_CLASSIFICATION,
224     ModeFlag_ANNOTATION_AND_CLASSIFICATION,
225     ModeFlag_SELECTION,
226     ModeFlag_ANNOTATION_AND_SELECTION,
227     ModeFlag_CLASSIFICATION_AND_SELECTION,
228     ModeFlag_ALL
229   };
230   return values;
231 }
232 
EnumNamesModeFlag()233 inline const char * const *EnumNamesModeFlag() {
234   static const char * const names[9] = {
235     "NONE",
236     "ANNOTATION",
237     "CLASSIFICATION",
238     "ANNOTATION_AND_CLASSIFICATION",
239     "SELECTION",
240     "ANNOTATION_AND_SELECTION",
241     "CLASSIFICATION_AND_SELECTION",
242     "ALL",
243     nullptr
244   };
245   return names;
246 }
247 
EnumNameModeFlag(ModeFlag e)248 inline const char *EnumNameModeFlag(ModeFlag e) {
249   if (flatbuffers::IsOutRange(e, ModeFlag_NONE, ModeFlag_ALL)) return "";
250   const size_t index = static_cast<size_t>(e);
251   return EnumNamesModeFlag()[index];
252 }
253 
254 enum AnnotationUsecase : int32_t {
255   AnnotationUsecase_ANNOTATION_USECASE_SMART = 0,
256   AnnotationUsecase_ANNOTATION_USECASE_RAW = 1,
257   AnnotationUsecase_MIN = AnnotationUsecase_ANNOTATION_USECASE_SMART,
258   AnnotationUsecase_MAX = AnnotationUsecase_ANNOTATION_USECASE_RAW
259 };
260 
EnumValuesAnnotationUsecase()261 inline const AnnotationUsecase (&EnumValuesAnnotationUsecase())[2] {
262   static const AnnotationUsecase values[] = {
263     AnnotationUsecase_ANNOTATION_USECASE_SMART,
264     AnnotationUsecase_ANNOTATION_USECASE_RAW
265   };
266   return values;
267 }
268 
EnumNamesAnnotationUsecase()269 inline const char * const *EnumNamesAnnotationUsecase() {
270   static const char * const names[3] = {
271     "ANNOTATION_USECASE_SMART",
272     "ANNOTATION_USECASE_RAW",
273     nullptr
274   };
275   return names;
276 }
277 
EnumNameAnnotationUsecase(AnnotationUsecase e)278 inline const char *EnumNameAnnotationUsecase(AnnotationUsecase e) {
279   if (flatbuffers::IsOutRange(e, AnnotationUsecase_ANNOTATION_USECASE_SMART, AnnotationUsecase_ANNOTATION_USECASE_RAW)) return "";
280   const size_t index = static_cast<size_t>(e);
281   return EnumNamesAnnotationUsecase()[index];
282 }
283 
284 enum DatetimeExtractorType : int32_t {
285   DatetimeExtractorType_UNKNOWN_DATETIME_EXTRACTOR_TYPE = 0,
286   DatetimeExtractorType_AM = 1,
287   DatetimeExtractorType_PM = 2,
288   DatetimeExtractorType_JANUARY = 3,
289   DatetimeExtractorType_FEBRUARY = 4,
290   DatetimeExtractorType_MARCH = 5,
291   DatetimeExtractorType_APRIL = 6,
292   DatetimeExtractorType_MAY = 7,
293   DatetimeExtractorType_JUNE = 8,
294   DatetimeExtractorType_JULY = 9,
295   DatetimeExtractorType_AUGUST = 10,
296   DatetimeExtractorType_SEPTEMBER = 11,
297   DatetimeExtractorType_OCTOBER = 12,
298   DatetimeExtractorType_NOVEMBER = 13,
299   DatetimeExtractorType_DECEMBER = 14,
300   DatetimeExtractorType_NEXT = 15,
301   DatetimeExtractorType_NEXT_OR_SAME = 16,
302   DatetimeExtractorType_LAST = 17,
303   DatetimeExtractorType_NOW = 18,
304   DatetimeExtractorType_TOMORROW = 19,
305   DatetimeExtractorType_YESTERDAY = 20,
306   DatetimeExtractorType_PAST = 21,
307   DatetimeExtractorType_FUTURE = 22,
308   DatetimeExtractorType_DAY = 23,
309   DatetimeExtractorType_WEEK = 24,
310   DatetimeExtractorType_MONTH = 25,
311   DatetimeExtractorType_YEAR = 26,
312   DatetimeExtractorType_MONDAY = 27,
313   DatetimeExtractorType_TUESDAY = 28,
314   DatetimeExtractorType_WEDNESDAY = 29,
315   DatetimeExtractorType_THURSDAY = 30,
316   DatetimeExtractorType_FRIDAY = 31,
317   DatetimeExtractorType_SATURDAY = 32,
318   DatetimeExtractorType_SUNDAY = 33,
319   DatetimeExtractorType_DAYS = 34,
320   DatetimeExtractorType_WEEKS = 35,
321   DatetimeExtractorType_MONTHS = 36,
322   DatetimeExtractorType_HOURS = 37,
323   DatetimeExtractorType_MINUTES = 38,
324   DatetimeExtractorType_SECONDS = 39,
325   DatetimeExtractorType_YEARS = 40,
326   DatetimeExtractorType_DIGITS = 41,
327   DatetimeExtractorType_SIGNEDDIGITS = 42,
328   DatetimeExtractorType_ZERO = 43,
329   DatetimeExtractorType_ONE = 44,
330   DatetimeExtractorType_TWO = 45,
331   DatetimeExtractorType_THREE = 46,
332   DatetimeExtractorType_FOUR = 47,
333   DatetimeExtractorType_FIVE = 48,
334   DatetimeExtractorType_SIX = 49,
335   DatetimeExtractorType_SEVEN = 50,
336   DatetimeExtractorType_EIGHT = 51,
337   DatetimeExtractorType_NINE = 52,
338   DatetimeExtractorType_TEN = 53,
339   DatetimeExtractorType_ELEVEN = 54,
340   DatetimeExtractorType_TWELVE = 55,
341   DatetimeExtractorType_THIRTEEN = 56,
342   DatetimeExtractorType_FOURTEEN = 57,
343   DatetimeExtractorType_FIFTEEN = 58,
344   DatetimeExtractorType_SIXTEEN = 59,
345   DatetimeExtractorType_SEVENTEEN = 60,
346   DatetimeExtractorType_EIGHTEEN = 61,
347   DatetimeExtractorType_NINETEEN = 62,
348   DatetimeExtractorType_TWENTY = 63,
349   DatetimeExtractorType_THIRTY = 64,
350   DatetimeExtractorType_FORTY = 65,
351   DatetimeExtractorType_FIFTY = 66,
352   DatetimeExtractorType_SIXTY = 67,
353   DatetimeExtractorType_SEVENTY = 68,
354   DatetimeExtractorType_EIGHTY = 69,
355   DatetimeExtractorType_NINETY = 70,
356   DatetimeExtractorType_HUNDRED = 71,
357   DatetimeExtractorType_THOUSAND = 72,
358   DatetimeExtractorType_NOON = 73,
359   DatetimeExtractorType_MIDNIGHT = 74,
360   DatetimeExtractorType_MIN = DatetimeExtractorType_UNKNOWN_DATETIME_EXTRACTOR_TYPE,
361   DatetimeExtractorType_MAX = DatetimeExtractorType_MIDNIGHT
362 };
363 
EnumValuesDatetimeExtractorType()364 inline const DatetimeExtractorType (&EnumValuesDatetimeExtractorType())[75] {
365   static const DatetimeExtractorType values[] = {
366     DatetimeExtractorType_UNKNOWN_DATETIME_EXTRACTOR_TYPE,
367     DatetimeExtractorType_AM,
368     DatetimeExtractorType_PM,
369     DatetimeExtractorType_JANUARY,
370     DatetimeExtractorType_FEBRUARY,
371     DatetimeExtractorType_MARCH,
372     DatetimeExtractorType_APRIL,
373     DatetimeExtractorType_MAY,
374     DatetimeExtractorType_JUNE,
375     DatetimeExtractorType_JULY,
376     DatetimeExtractorType_AUGUST,
377     DatetimeExtractorType_SEPTEMBER,
378     DatetimeExtractorType_OCTOBER,
379     DatetimeExtractorType_NOVEMBER,
380     DatetimeExtractorType_DECEMBER,
381     DatetimeExtractorType_NEXT,
382     DatetimeExtractorType_NEXT_OR_SAME,
383     DatetimeExtractorType_LAST,
384     DatetimeExtractorType_NOW,
385     DatetimeExtractorType_TOMORROW,
386     DatetimeExtractorType_YESTERDAY,
387     DatetimeExtractorType_PAST,
388     DatetimeExtractorType_FUTURE,
389     DatetimeExtractorType_DAY,
390     DatetimeExtractorType_WEEK,
391     DatetimeExtractorType_MONTH,
392     DatetimeExtractorType_YEAR,
393     DatetimeExtractorType_MONDAY,
394     DatetimeExtractorType_TUESDAY,
395     DatetimeExtractorType_WEDNESDAY,
396     DatetimeExtractorType_THURSDAY,
397     DatetimeExtractorType_FRIDAY,
398     DatetimeExtractorType_SATURDAY,
399     DatetimeExtractorType_SUNDAY,
400     DatetimeExtractorType_DAYS,
401     DatetimeExtractorType_WEEKS,
402     DatetimeExtractorType_MONTHS,
403     DatetimeExtractorType_HOURS,
404     DatetimeExtractorType_MINUTES,
405     DatetimeExtractorType_SECONDS,
406     DatetimeExtractorType_YEARS,
407     DatetimeExtractorType_DIGITS,
408     DatetimeExtractorType_SIGNEDDIGITS,
409     DatetimeExtractorType_ZERO,
410     DatetimeExtractorType_ONE,
411     DatetimeExtractorType_TWO,
412     DatetimeExtractorType_THREE,
413     DatetimeExtractorType_FOUR,
414     DatetimeExtractorType_FIVE,
415     DatetimeExtractorType_SIX,
416     DatetimeExtractorType_SEVEN,
417     DatetimeExtractorType_EIGHT,
418     DatetimeExtractorType_NINE,
419     DatetimeExtractorType_TEN,
420     DatetimeExtractorType_ELEVEN,
421     DatetimeExtractorType_TWELVE,
422     DatetimeExtractorType_THIRTEEN,
423     DatetimeExtractorType_FOURTEEN,
424     DatetimeExtractorType_FIFTEEN,
425     DatetimeExtractorType_SIXTEEN,
426     DatetimeExtractorType_SEVENTEEN,
427     DatetimeExtractorType_EIGHTEEN,
428     DatetimeExtractorType_NINETEEN,
429     DatetimeExtractorType_TWENTY,
430     DatetimeExtractorType_THIRTY,
431     DatetimeExtractorType_FORTY,
432     DatetimeExtractorType_FIFTY,
433     DatetimeExtractorType_SIXTY,
434     DatetimeExtractorType_SEVENTY,
435     DatetimeExtractorType_EIGHTY,
436     DatetimeExtractorType_NINETY,
437     DatetimeExtractorType_HUNDRED,
438     DatetimeExtractorType_THOUSAND,
439     DatetimeExtractorType_NOON,
440     DatetimeExtractorType_MIDNIGHT
441   };
442   return values;
443 }
444 
EnumNamesDatetimeExtractorType()445 inline const char * const *EnumNamesDatetimeExtractorType() {
446   static const char * const names[76] = {
447     "UNKNOWN_DATETIME_EXTRACTOR_TYPE",
448     "AM",
449     "PM",
450     "JANUARY",
451     "FEBRUARY",
452     "MARCH",
453     "APRIL",
454     "MAY",
455     "JUNE",
456     "JULY",
457     "AUGUST",
458     "SEPTEMBER",
459     "OCTOBER",
460     "NOVEMBER",
461     "DECEMBER",
462     "NEXT",
463     "NEXT_OR_SAME",
464     "LAST",
465     "NOW",
466     "TOMORROW",
467     "YESTERDAY",
468     "PAST",
469     "FUTURE",
470     "DAY",
471     "WEEK",
472     "MONTH",
473     "YEAR",
474     "MONDAY",
475     "TUESDAY",
476     "WEDNESDAY",
477     "THURSDAY",
478     "FRIDAY",
479     "SATURDAY",
480     "SUNDAY",
481     "DAYS",
482     "WEEKS",
483     "MONTHS",
484     "HOURS",
485     "MINUTES",
486     "SECONDS",
487     "YEARS",
488     "DIGITS",
489     "SIGNEDDIGITS",
490     "ZERO",
491     "ONE",
492     "TWO",
493     "THREE",
494     "FOUR",
495     "FIVE",
496     "SIX",
497     "SEVEN",
498     "EIGHT",
499     "NINE",
500     "TEN",
501     "ELEVEN",
502     "TWELVE",
503     "THIRTEEN",
504     "FOURTEEN",
505     "FIFTEEN",
506     "SIXTEEN",
507     "SEVENTEEN",
508     "EIGHTEEN",
509     "NINETEEN",
510     "TWENTY",
511     "THIRTY",
512     "FORTY",
513     "FIFTY",
514     "SIXTY",
515     "SEVENTY",
516     "EIGHTY",
517     "NINETY",
518     "HUNDRED",
519     "THOUSAND",
520     "NOON",
521     "MIDNIGHT",
522     nullptr
523   };
524   return names;
525 }
526 
EnumNameDatetimeExtractorType(DatetimeExtractorType e)527 inline const char *EnumNameDatetimeExtractorType(DatetimeExtractorType e) {
528   if (flatbuffers::IsOutRange(e, DatetimeExtractorType_UNKNOWN_DATETIME_EXTRACTOR_TYPE, DatetimeExtractorType_MIDNIGHT)) return "";
529   const size_t index = static_cast<size_t>(e);
530   return EnumNamesDatetimeExtractorType()[index];
531 }
532 
533 enum DatetimeGroupType : int32_t {
534   DatetimeGroupType_GROUP_UNKNOWN = 0,
535   DatetimeGroupType_GROUP_UNUSED = 1,
536   DatetimeGroupType_GROUP_YEAR = 2,
537   DatetimeGroupType_GROUP_MONTH = 3,
538   DatetimeGroupType_GROUP_DAY = 4,
539   DatetimeGroupType_GROUP_HOUR = 5,
540   DatetimeGroupType_GROUP_MINUTE = 6,
541   DatetimeGroupType_GROUP_SECOND = 7,
542   DatetimeGroupType_GROUP_AMPM = 8,
543   DatetimeGroupType_GROUP_RELATIONDISTANCE = 9,
544   DatetimeGroupType_GROUP_RELATION = 10,
545   DatetimeGroupType_GROUP_RELATIONTYPE = 11,
546   DatetimeGroupType_GROUP_DUMMY1 = 12,
547   DatetimeGroupType_GROUP_DUMMY2 = 13,
548   DatetimeGroupType_GROUP_ABSOLUTETIME = 14,
549   DatetimeGroupType_MIN = DatetimeGroupType_GROUP_UNKNOWN,
550   DatetimeGroupType_MAX = DatetimeGroupType_GROUP_ABSOLUTETIME
551 };
552 
EnumValuesDatetimeGroupType()553 inline const DatetimeGroupType (&EnumValuesDatetimeGroupType())[15] {
554   static const DatetimeGroupType values[] = {
555     DatetimeGroupType_GROUP_UNKNOWN,
556     DatetimeGroupType_GROUP_UNUSED,
557     DatetimeGroupType_GROUP_YEAR,
558     DatetimeGroupType_GROUP_MONTH,
559     DatetimeGroupType_GROUP_DAY,
560     DatetimeGroupType_GROUP_HOUR,
561     DatetimeGroupType_GROUP_MINUTE,
562     DatetimeGroupType_GROUP_SECOND,
563     DatetimeGroupType_GROUP_AMPM,
564     DatetimeGroupType_GROUP_RELATIONDISTANCE,
565     DatetimeGroupType_GROUP_RELATION,
566     DatetimeGroupType_GROUP_RELATIONTYPE,
567     DatetimeGroupType_GROUP_DUMMY1,
568     DatetimeGroupType_GROUP_DUMMY2,
569     DatetimeGroupType_GROUP_ABSOLUTETIME
570   };
571   return values;
572 }
573 
EnumNamesDatetimeGroupType()574 inline const char * const *EnumNamesDatetimeGroupType() {
575   static const char * const names[16] = {
576     "GROUP_UNKNOWN",
577     "GROUP_UNUSED",
578     "GROUP_YEAR",
579     "GROUP_MONTH",
580     "GROUP_DAY",
581     "GROUP_HOUR",
582     "GROUP_MINUTE",
583     "GROUP_SECOND",
584     "GROUP_AMPM",
585     "GROUP_RELATIONDISTANCE",
586     "GROUP_RELATION",
587     "GROUP_RELATIONTYPE",
588     "GROUP_DUMMY1",
589     "GROUP_DUMMY2",
590     "GROUP_ABSOLUTETIME",
591     nullptr
592   };
593   return names;
594 }
595 
EnumNameDatetimeGroupType(DatetimeGroupType e)596 inline const char *EnumNameDatetimeGroupType(DatetimeGroupType e) {
597   if (flatbuffers::IsOutRange(e, DatetimeGroupType_GROUP_UNKNOWN, DatetimeGroupType_GROUP_ABSOLUTETIME)) return "";
598   const size_t index = static_cast<size_t>(e);
599   return EnumNamesDatetimeGroupType()[index];
600 }
601 
602 namespace FeatureProcessorOptions_ {
603 
604 enum CenterTokenSelectionMethod : int32_t {
605   CenterTokenSelectionMethod_DEFAULT_CENTER_TOKEN_METHOD = 0,
606   CenterTokenSelectionMethod_CENTER_TOKEN_FROM_CLICK = 1,
607   CenterTokenSelectionMethod_CENTER_TOKEN_MIDDLE_OF_SELECTION = 2,
608   CenterTokenSelectionMethod_MIN = CenterTokenSelectionMethod_DEFAULT_CENTER_TOKEN_METHOD,
609   CenterTokenSelectionMethod_MAX = CenterTokenSelectionMethod_CENTER_TOKEN_MIDDLE_OF_SELECTION
610 };
611 
EnumValuesCenterTokenSelectionMethod()612 inline const CenterTokenSelectionMethod (&EnumValuesCenterTokenSelectionMethod())[3] {
613   static const CenterTokenSelectionMethod values[] = {
614     CenterTokenSelectionMethod_DEFAULT_CENTER_TOKEN_METHOD,
615     CenterTokenSelectionMethod_CENTER_TOKEN_FROM_CLICK,
616     CenterTokenSelectionMethod_CENTER_TOKEN_MIDDLE_OF_SELECTION
617   };
618   return values;
619 }
620 
EnumNamesCenterTokenSelectionMethod()621 inline const char * const *EnumNamesCenterTokenSelectionMethod() {
622   static const char * const names[4] = {
623     "DEFAULT_CENTER_TOKEN_METHOD",
624     "CENTER_TOKEN_FROM_CLICK",
625     "CENTER_TOKEN_MIDDLE_OF_SELECTION",
626     nullptr
627   };
628   return names;
629 }
630 
EnumNameCenterTokenSelectionMethod(CenterTokenSelectionMethod e)631 inline const char *EnumNameCenterTokenSelectionMethod(CenterTokenSelectionMethod e) {
632   if (flatbuffers::IsOutRange(e, CenterTokenSelectionMethod_DEFAULT_CENTER_TOKEN_METHOD, CenterTokenSelectionMethod_CENTER_TOKEN_MIDDLE_OF_SELECTION)) return "";
633   const size_t index = static_cast<size_t>(e);
634   return EnumNamesCenterTokenSelectionMethod()[index];
635 }
636 
637 }  // namespace FeatureProcessorOptions_
638 
639 namespace TranslateAnnotatorOptions_ {
640 
641 enum Algorithm : int32_t {
642   Algorithm_DEFAULT_ALGORITHM = 0,
643   Algorithm_BACKOFF = 1,
644   Algorithm_MIN = Algorithm_DEFAULT_ALGORITHM,
645   Algorithm_MAX = Algorithm_BACKOFF
646 };
647 
EnumValuesAlgorithm()648 inline const Algorithm (&EnumValuesAlgorithm())[2] {
649   static const Algorithm values[] = {
650     Algorithm_DEFAULT_ALGORITHM,
651     Algorithm_BACKOFF
652   };
653   return values;
654 }
655 
EnumNamesAlgorithm()656 inline const char * const *EnumNamesAlgorithm() {
657   static const char * const names[3] = {
658     "DEFAULT_ALGORITHM",
659     "BACKOFF",
660     nullptr
661   };
662   return names;
663 }
664 
EnumNameAlgorithm(Algorithm e)665 inline const char *EnumNameAlgorithm(Algorithm e) {
666   if (flatbuffers::IsOutRange(e, Algorithm_DEFAULT_ALGORITHM, Algorithm_BACKOFF)) return "";
667   const size_t index = static_cast<size_t>(e);
668   return EnumNamesAlgorithm()[index];
669 }
670 
671 }  // namespace TranslateAnnotatorOptions_
672 
673 namespace PodNerModel_ {
674 namespace Label_ {
675 
676 enum BoiseType : int32_t {
677   BoiseType_NONE = 0,
678   BoiseType_BEGIN = 1,
679   BoiseType_O = 2,
680   BoiseType_INTERMEDIATE = 3,
681   BoiseType_SINGLE = 4,
682   BoiseType_END = 5,
683   BoiseType_MIN = BoiseType_NONE,
684   BoiseType_MAX = BoiseType_END
685 };
686 
EnumValuesBoiseType()687 inline const BoiseType (&EnumValuesBoiseType())[6] {
688   static const BoiseType values[] = {
689     BoiseType_NONE,
690     BoiseType_BEGIN,
691     BoiseType_O,
692     BoiseType_INTERMEDIATE,
693     BoiseType_SINGLE,
694     BoiseType_END
695   };
696   return values;
697 }
698 
EnumNamesBoiseType()699 inline const char * const *EnumNamesBoiseType() {
700   static const char * const names[7] = {
701     "NONE",
702     "BEGIN",
703     "O",
704     "INTERMEDIATE",
705     "SINGLE",
706     "END",
707     nullptr
708   };
709   return names;
710 }
711 
EnumNameBoiseType(BoiseType e)712 inline const char *EnumNameBoiseType(BoiseType e) {
713   if (flatbuffers::IsOutRange(e, BoiseType_NONE, BoiseType_END)) return "";
714   const size_t index = static_cast<size_t>(e);
715   return EnumNamesBoiseType()[index];
716 }
717 
718 enum MentionType : int32_t {
719   MentionType_UNDEFINED = 0,
720   MentionType_NAM = 1,
721   MentionType_NOM = 2,
722   MentionType_MIN = MentionType_UNDEFINED,
723   MentionType_MAX = MentionType_NOM
724 };
725 
EnumValuesMentionType()726 inline const MentionType (&EnumValuesMentionType())[3] {
727   static const MentionType values[] = {
728     MentionType_UNDEFINED,
729     MentionType_NAM,
730     MentionType_NOM
731   };
732   return values;
733 }
734 
EnumNamesMentionType()735 inline const char * const *EnumNamesMentionType() {
736   static const char * const names[4] = {
737     "UNDEFINED",
738     "NAM",
739     "NOM",
740     nullptr
741   };
742   return names;
743 }
744 
EnumNameMentionType(MentionType e)745 inline const char *EnumNameMentionType(MentionType e) {
746   if (flatbuffers::IsOutRange(e, MentionType_UNDEFINED, MentionType_NOM)) return "";
747   const size_t index = static_cast<size_t>(e);
748   return EnumNamesMentionType()[index];
749 }
750 
751 }  // namespace Label_
752 }  // namespace PodNerModel_
753 
754 struct SelectionModelOptionsT : public flatbuffers::NativeTable {
755   typedef SelectionModelOptions TableType;
756   bool strip_unpaired_brackets = true;
757   int32_t symmetry_context_size = 0;
758   int32_t batch_size = 1024;
759   bool always_classify_suggested_selection = false;
760 };
761 
762 struct SelectionModelOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
763   typedef SelectionModelOptionsT NativeTableType;
764   typedef SelectionModelOptionsBuilder Builder;
765   enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
766     VT_STRIP_UNPAIRED_BRACKETS = 4,
767     VT_SYMMETRY_CONTEXT_SIZE = 6,
768     VT_BATCH_SIZE = 8,
769     VT_ALWAYS_CLASSIFY_SUGGESTED_SELECTION = 10
770   };
strip_unpaired_bracketsFLATBUFFERS_FINAL_CLASS771   bool strip_unpaired_brackets() const {
772     return GetField<uint8_t>(VT_STRIP_UNPAIRED_BRACKETS, 1) != 0;
773   }
symmetry_context_sizeFLATBUFFERS_FINAL_CLASS774   int32_t symmetry_context_size() const {
775     return GetField<int32_t>(VT_SYMMETRY_CONTEXT_SIZE, 0);
776   }
batch_sizeFLATBUFFERS_FINAL_CLASS777   int32_t batch_size() const {
778     return GetField<int32_t>(VT_BATCH_SIZE, 1024);
779   }
always_classify_suggested_selectionFLATBUFFERS_FINAL_CLASS780   bool always_classify_suggested_selection() const {
781     return GetField<uint8_t>(VT_ALWAYS_CLASSIFY_SUGGESTED_SELECTION, 0) != 0;
782   }
VerifyFLATBUFFERS_FINAL_CLASS783   bool Verify(flatbuffers::Verifier &verifier) const {
784     return VerifyTableStart(verifier) &&
785            VerifyField<uint8_t>(verifier, VT_STRIP_UNPAIRED_BRACKETS, 1) &&
786            VerifyField<int32_t>(verifier, VT_SYMMETRY_CONTEXT_SIZE, 4) &&
787            VerifyField<int32_t>(verifier, VT_BATCH_SIZE, 4) &&
788            VerifyField<uint8_t>(verifier, VT_ALWAYS_CLASSIFY_SUGGESTED_SELECTION, 1) &&
789            verifier.EndTable();
790   }
791   SelectionModelOptionsT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const;
792   void UnPackTo(SelectionModelOptionsT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const;
793   static flatbuffers::Offset<SelectionModelOptions> Pack(flatbuffers::FlatBufferBuilder &_fbb, const SelectionModelOptionsT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
794 };
795 
796 struct SelectionModelOptionsBuilder {
797   typedef SelectionModelOptions Table;
798   flatbuffers::FlatBufferBuilder &fbb_;
799   flatbuffers::uoffset_t start_;
add_strip_unpaired_bracketsSelectionModelOptionsBuilder800   void add_strip_unpaired_brackets(bool strip_unpaired_brackets) {
801     fbb_.AddElement<uint8_t>(SelectionModelOptions::VT_STRIP_UNPAIRED_BRACKETS, static_cast<uint8_t>(strip_unpaired_brackets), 1);
802   }
add_symmetry_context_sizeSelectionModelOptionsBuilder803   void add_symmetry_context_size(int32_t symmetry_context_size) {
804     fbb_.AddElement<int32_t>(SelectionModelOptions::VT_SYMMETRY_CONTEXT_SIZE, symmetry_context_size, 0);
805   }
add_batch_sizeSelectionModelOptionsBuilder806   void add_batch_size(int32_t batch_size) {
807     fbb_.AddElement<int32_t>(SelectionModelOptions::VT_BATCH_SIZE, batch_size, 1024);
808   }
add_always_classify_suggested_selectionSelectionModelOptionsBuilder809   void add_always_classify_suggested_selection(bool always_classify_suggested_selection) {
810     fbb_.AddElement<uint8_t>(SelectionModelOptions::VT_ALWAYS_CLASSIFY_SUGGESTED_SELECTION, static_cast<uint8_t>(always_classify_suggested_selection), 0);
811   }
SelectionModelOptionsBuilderSelectionModelOptionsBuilder812   explicit SelectionModelOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb)
813         : fbb_(_fbb) {
814     start_ = fbb_.StartTable();
815   }
FinishSelectionModelOptionsBuilder816   flatbuffers::Offset<SelectionModelOptions> Finish() {
817     const auto end = fbb_.EndTable(start_);
818     auto o = flatbuffers::Offset<SelectionModelOptions>(end);
819     return o;
820   }
821 };
822 
823 inline flatbuffers::Offset<SelectionModelOptions> CreateSelectionModelOptions(
824     flatbuffers::FlatBufferBuilder &_fbb,
825     bool strip_unpaired_brackets = true,
826     int32_t symmetry_context_size = 0,
827     int32_t batch_size = 1024,
828     bool always_classify_suggested_selection = false) {
829   SelectionModelOptionsBuilder builder_(_fbb);
830   builder_.add_batch_size(batch_size);
831   builder_.add_symmetry_context_size(symmetry_context_size);
832   builder_.add_always_classify_suggested_selection(always_classify_suggested_selection);
833   builder_.add_strip_unpaired_brackets(strip_unpaired_brackets);
834   return builder_.Finish();
835 }
836 
837 flatbuffers::Offset<SelectionModelOptions> CreateSelectionModelOptions(flatbuffers::FlatBufferBuilder &_fbb, const SelectionModelOptionsT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
838 
839 struct ClassificationModelOptionsT : public flatbuffers::NativeTable {
840   typedef ClassificationModelOptions TableType;
841   int32_t phone_min_num_digits = 7;
842   int32_t phone_max_num_digits = 15;
843   int32_t address_min_num_tokens = 0;
844   int32_t max_num_tokens = -1;
845 };
846 
847 struct ClassificationModelOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
848   typedef ClassificationModelOptionsT NativeTableType;
849   typedef ClassificationModelOptionsBuilder Builder;
850   enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
851     VT_PHONE_MIN_NUM_DIGITS = 4,
852     VT_PHONE_MAX_NUM_DIGITS = 6,
853     VT_ADDRESS_MIN_NUM_TOKENS = 8,
854     VT_MAX_NUM_TOKENS = 10
855   };
phone_min_num_digitsFLATBUFFERS_FINAL_CLASS856   int32_t phone_min_num_digits() const {
857     return GetField<int32_t>(VT_PHONE_MIN_NUM_DIGITS, 7);
858   }
phone_max_num_digitsFLATBUFFERS_FINAL_CLASS859   int32_t phone_max_num_digits() const {
860     return GetField<int32_t>(VT_PHONE_MAX_NUM_DIGITS, 15);
861   }
address_min_num_tokensFLATBUFFERS_FINAL_CLASS862   int32_t address_min_num_tokens() const {
863     return GetField<int32_t>(VT_ADDRESS_MIN_NUM_TOKENS, 0);
864   }
max_num_tokensFLATBUFFERS_FINAL_CLASS865   int32_t max_num_tokens() const {
866     return GetField<int32_t>(VT_MAX_NUM_TOKENS, -1);
867   }
VerifyFLATBUFFERS_FINAL_CLASS868   bool Verify(flatbuffers::Verifier &verifier) const {
869     return VerifyTableStart(verifier) &&
870            VerifyField<int32_t>(verifier, VT_PHONE_MIN_NUM_DIGITS, 4) &&
871            VerifyField<int32_t>(verifier, VT_PHONE_MAX_NUM_DIGITS, 4) &&
872            VerifyField<int32_t>(verifier, VT_ADDRESS_MIN_NUM_TOKENS, 4) &&
873            VerifyField<int32_t>(verifier, VT_MAX_NUM_TOKENS, 4) &&
874            verifier.EndTable();
875   }
876   ClassificationModelOptionsT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const;
877   void UnPackTo(ClassificationModelOptionsT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const;
878   static flatbuffers::Offset<ClassificationModelOptions> Pack(flatbuffers::FlatBufferBuilder &_fbb, const ClassificationModelOptionsT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
879 };
880 
881 struct ClassificationModelOptionsBuilder {
882   typedef ClassificationModelOptions Table;
883   flatbuffers::FlatBufferBuilder &fbb_;
884   flatbuffers::uoffset_t start_;
add_phone_min_num_digitsClassificationModelOptionsBuilder885   void add_phone_min_num_digits(int32_t phone_min_num_digits) {
886     fbb_.AddElement<int32_t>(ClassificationModelOptions::VT_PHONE_MIN_NUM_DIGITS, phone_min_num_digits, 7);
887   }
add_phone_max_num_digitsClassificationModelOptionsBuilder888   void add_phone_max_num_digits(int32_t phone_max_num_digits) {
889     fbb_.AddElement<int32_t>(ClassificationModelOptions::VT_PHONE_MAX_NUM_DIGITS, phone_max_num_digits, 15);
890   }
add_address_min_num_tokensClassificationModelOptionsBuilder891   void add_address_min_num_tokens(int32_t address_min_num_tokens) {
892     fbb_.AddElement<int32_t>(ClassificationModelOptions::VT_ADDRESS_MIN_NUM_TOKENS, address_min_num_tokens, 0);
893   }
add_max_num_tokensClassificationModelOptionsBuilder894   void add_max_num_tokens(int32_t max_num_tokens) {
895     fbb_.AddElement<int32_t>(ClassificationModelOptions::VT_MAX_NUM_TOKENS, max_num_tokens, -1);
896   }
ClassificationModelOptionsBuilderClassificationModelOptionsBuilder897   explicit ClassificationModelOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb)
898         : fbb_(_fbb) {
899     start_ = fbb_.StartTable();
900   }
FinishClassificationModelOptionsBuilder901   flatbuffers::Offset<ClassificationModelOptions> Finish() {
902     const auto end = fbb_.EndTable(start_);
903     auto o = flatbuffers::Offset<ClassificationModelOptions>(end);
904     return o;
905   }
906 };
907 
908 inline flatbuffers::Offset<ClassificationModelOptions> CreateClassificationModelOptions(
909     flatbuffers::FlatBufferBuilder &_fbb,
910     int32_t phone_min_num_digits = 7,
911     int32_t phone_max_num_digits = 15,
912     int32_t address_min_num_tokens = 0,
913     int32_t max_num_tokens = -1) {
914   ClassificationModelOptionsBuilder builder_(_fbb);
915   builder_.add_max_num_tokens(max_num_tokens);
916   builder_.add_address_min_num_tokens(address_min_num_tokens);
917   builder_.add_phone_max_num_digits(phone_max_num_digits);
918   builder_.add_phone_min_num_digits(phone_min_num_digits);
919   return builder_.Finish();
920 }
921 
922 flatbuffers::Offset<ClassificationModelOptions> CreateClassificationModelOptions(flatbuffers::FlatBufferBuilder &_fbb, const ClassificationModelOptionsT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
923 
924 struct VerificationOptionsT : public flatbuffers::NativeTable {
925   typedef VerificationOptions TableType;
926   bool verify_luhn_checksum = false;
927   int32_t lua_verifier = -1;
928 };
929 
930 struct VerificationOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
931   typedef VerificationOptionsT NativeTableType;
932   typedef VerificationOptionsBuilder Builder;
933   enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
934     VT_VERIFY_LUHN_CHECKSUM = 4,
935     VT_LUA_VERIFIER = 6
936   };
verify_luhn_checksumFLATBUFFERS_FINAL_CLASS937   bool verify_luhn_checksum() const {
938     return GetField<uint8_t>(VT_VERIFY_LUHN_CHECKSUM, 0) != 0;
939   }
lua_verifierFLATBUFFERS_FINAL_CLASS940   int32_t lua_verifier() const {
941     return GetField<int32_t>(VT_LUA_VERIFIER, -1);
942   }
VerifyFLATBUFFERS_FINAL_CLASS943   bool Verify(flatbuffers::Verifier &verifier) const {
944     return VerifyTableStart(verifier) &&
945            VerifyField<uint8_t>(verifier, VT_VERIFY_LUHN_CHECKSUM, 1) &&
946            VerifyField<int32_t>(verifier, VT_LUA_VERIFIER, 4) &&
947            verifier.EndTable();
948   }
949   VerificationOptionsT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const;
950   void UnPackTo(VerificationOptionsT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const;
951   static flatbuffers::Offset<VerificationOptions> Pack(flatbuffers::FlatBufferBuilder &_fbb, const VerificationOptionsT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
952 };
953 
954 struct VerificationOptionsBuilder {
955   typedef VerificationOptions Table;
956   flatbuffers::FlatBufferBuilder &fbb_;
957   flatbuffers::uoffset_t start_;
add_verify_luhn_checksumVerificationOptionsBuilder958   void add_verify_luhn_checksum(bool verify_luhn_checksum) {
959     fbb_.AddElement<uint8_t>(VerificationOptions::VT_VERIFY_LUHN_CHECKSUM, static_cast<uint8_t>(verify_luhn_checksum), 0);
960   }
add_lua_verifierVerificationOptionsBuilder961   void add_lua_verifier(int32_t lua_verifier) {
962     fbb_.AddElement<int32_t>(VerificationOptions::VT_LUA_VERIFIER, lua_verifier, -1);
963   }
VerificationOptionsBuilderVerificationOptionsBuilder964   explicit VerificationOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb)
965         : fbb_(_fbb) {
966     start_ = fbb_.StartTable();
967   }
FinishVerificationOptionsBuilder968   flatbuffers::Offset<VerificationOptions> Finish() {
969     const auto end = fbb_.EndTable(start_);
970     auto o = flatbuffers::Offset<VerificationOptions>(end);
971     return o;
972   }
973 };
974 
975 inline flatbuffers::Offset<VerificationOptions> CreateVerificationOptions(
976     flatbuffers::FlatBufferBuilder &_fbb,
977     bool verify_luhn_checksum = false,
978     int32_t lua_verifier = -1) {
979   VerificationOptionsBuilder builder_(_fbb);
980   builder_.add_lua_verifier(lua_verifier);
981   builder_.add_verify_luhn_checksum(verify_luhn_checksum);
982   return builder_.Finish();
983 }
984 
985 flatbuffers::Offset<VerificationOptions> CreateVerificationOptions(flatbuffers::FlatBufferBuilder &_fbb, const VerificationOptionsT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
986 
987 struct CapturingGroupT : public flatbuffers::NativeTable {
988   typedef CapturingGroup TableType;
989   bool extend_selection = true;
990   std::unique_ptr<libtextclassifier3::FlatbufferFieldPathT> entity_field_path{};
991   std::string serialized_entity_data{};
992   std::unique_ptr<libtextclassifier3::NormalizationOptionsT> normalization_options{};
993   std::unique_ptr<libtextclassifier3::EntityDataT> entity_data{};
994   CapturingGroupT() = default;
995   CapturingGroupT(const CapturingGroupT &o);
996   CapturingGroupT(CapturingGroupT&&) FLATBUFFERS_NOEXCEPT = default;
997   CapturingGroupT &operator=(CapturingGroupT o) FLATBUFFERS_NOEXCEPT;
998 };
999 
1000 struct CapturingGroup FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
1001   typedef CapturingGroupT NativeTableType;
1002   typedef CapturingGroupBuilder Builder;
1003   enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
1004     VT_EXTEND_SELECTION = 4,
1005     VT_ENTITY_FIELD_PATH = 6,
1006     VT_SERIALIZED_ENTITY_DATA = 8,
1007     VT_NORMALIZATION_OPTIONS = 10,
1008     VT_ENTITY_DATA = 12
1009   };
extend_selectionFLATBUFFERS_FINAL_CLASS1010   bool extend_selection() const {
1011     return GetField<uint8_t>(VT_EXTEND_SELECTION, 1) != 0;
1012   }
entity_field_pathFLATBUFFERS_FINAL_CLASS1013   const libtextclassifier3::FlatbufferFieldPath *entity_field_path() const {
1014     return GetPointer<const libtextclassifier3::FlatbufferFieldPath *>(VT_ENTITY_FIELD_PATH);
1015   }
serialized_entity_dataFLATBUFFERS_FINAL_CLASS1016   const flatbuffers::String *serialized_entity_data() const {
1017     return GetPointer<const flatbuffers::String *>(VT_SERIALIZED_ENTITY_DATA);
1018   }
normalization_optionsFLATBUFFERS_FINAL_CLASS1019   const libtextclassifier3::NormalizationOptions *normalization_options() const {
1020     return GetPointer<const libtextclassifier3::NormalizationOptions *>(VT_NORMALIZATION_OPTIONS);
1021   }
entity_dataFLATBUFFERS_FINAL_CLASS1022   const libtextclassifier3::EntityData *entity_data() const {
1023     return GetPointer<const libtextclassifier3::EntityData *>(VT_ENTITY_DATA);
1024   }
VerifyFLATBUFFERS_FINAL_CLASS1025   bool Verify(flatbuffers::Verifier &verifier) const {
1026     return VerifyTableStart(verifier) &&
1027            VerifyField<uint8_t>(verifier, VT_EXTEND_SELECTION, 1) &&
1028            VerifyOffset(verifier, VT_ENTITY_FIELD_PATH) &&
1029            verifier.VerifyTable(entity_field_path()) &&
1030            VerifyOffset(verifier, VT_SERIALIZED_ENTITY_DATA) &&
1031            verifier.VerifyString(serialized_entity_data()) &&
1032            VerifyOffset(verifier, VT_NORMALIZATION_OPTIONS) &&
1033            verifier.VerifyTable(normalization_options()) &&
1034            VerifyOffset(verifier, VT_ENTITY_DATA) &&
1035            verifier.VerifyTable(entity_data()) &&
1036            verifier.EndTable();
1037   }
1038   CapturingGroupT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const;
1039   void UnPackTo(CapturingGroupT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const;
1040   static flatbuffers::Offset<CapturingGroup> Pack(flatbuffers::FlatBufferBuilder &_fbb, const CapturingGroupT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
1041 };
1042 
1043 struct CapturingGroupBuilder {
1044   typedef CapturingGroup Table;
1045   flatbuffers::FlatBufferBuilder &fbb_;
1046   flatbuffers::uoffset_t start_;
add_extend_selectionCapturingGroupBuilder1047   void add_extend_selection(bool extend_selection) {
1048     fbb_.AddElement<uint8_t>(CapturingGroup::VT_EXTEND_SELECTION, static_cast<uint8_t>(extend_selection), 1);
1049   }
add_entity_field_pathCapturingGroupBuilder1050   void add_entity_field_path(flatbuffers::Offset<libtextclassifier3::FlatbufferFieldPath> entity_field_path) {
1051     fbb_.AddOffset(CapturingGroup::VT_ENTITY_FIELD_PATH, entity_field_path);
1052   }
add_serialized_entity_dataCapturingGroupBuilder1053   void add_serialized_entity_data(flatbuffers::Offset<flatbuffers::String> serialized_entity_data) {
1054     fbb_.AddOffset(CapturingGroup::VT_SERIALIZED_ENTITY_DATA, serialized_entity_data);
1055   }
add_normalization_optionsCapturingGroupBuilder1056   void add_normalization_options(flatbuffers::Offset<libtextclassifier3::NormalizationOptions> normalization_options) {
1057     fbb_.AddOffset(CapturingGroup::VT_NORMALIZATION_OPTIONS, normalization_options);
1058   }
add_entity_dataCapturingGroupBuilder1059   void add_entity_data(flatbuffers::Offset<libtextclassifier3::EntityData> entity_data) {
1060     fbb_.AddOffset(CapturingGroup::VT_ENTITY_DATA, entity_data);
1061   }
CapturingGroupBuilderCapturingGroupBuilder1062   explicit CapturingGroupBuilder(flatbuffers::FlatBufferBuilder &_fbb)
1063         : fbb_(_fbb) {
1064     start_ = fbb_.StartTable();
1065   }
FinishCapturingGroupBuilder1066   flatbuffers::Offset<CapturingGroup> Finish() {
1067     const auto end = fbb_.EndTable(start_);
1068     auto o = flatbuffers::Offset<CapturingGroup>(end);
1069     return o;
1070   }
1071 };
1072 
1073 inline flatbuffers::Offset<CapturingGroup> CreateCapturingGroup(
1074     flatbuffers::FlatBufferBuilder &_fbb,
1075     bool extend_selection = true,
1076     flatbuffers::Offset<libtextclassifier3::FlatbufferFieldPath> entity_field_path = 0,
1077     flatbuffers::Offset<flatbuffers::String> serialized_entity_data = 0,
1078     flatbuffers::Offset<libtextclassifier3::NormalizationOptions> normalization_options = 0,
1079     flatbuffers::Offset<libtextclassifier3::EntityData> entity_data = 0) {
1080   CapturingGroupBuilder builder_(_fbb);
1081   builder_.add_entity_data(entity_data);
1082   builder_.add_normalization_options(normalization_options);
1083   builder_.add_serialized_entity_data(serialized_entity_data);
1084   builder_.add_entity_field_path(entity_field_path);
1085   builder_.add_extend_selection(extend_selection);
1086   return builder_.Finish();
1087 }
1088 
1089 inline flatbuffers::Offset<CapturingGroup> CreateCapturingGroupDirect(
1090     flatbuffers::FlatBufferBuilder &_fbb,
1091     bool extend_selection = true,
1092     flatbuffers::Offset<libtextclassifier3::FlatbufferFieldPath> entity_field_path = 0,
1093     const char *serialized_entity_data = nullptr,
1094     flatbuffers::Offset<libtextclassifier3::NormalizationOptions> normalization_options = 0,
1095     flatbuffers::Offset<libtextclassifier3::EntityData> entity_data = 0) {
1096   auto serialized_entity_data__ = serialized_entity_data ? _fbb.CreateSharedString(serialized_entity_data) : 0;
1097   return libtextclassifier3::CreateCapturingGroup(
1098       _fbb,
1099       extend_selection,
1100       entity_field_path,
1101       serialized_entity_data__,
1102       normalization_options,
1103       entity_data);
1104 }
1105 
1106 flatbuffers::Offset<CapturingGroup> CreateCapturingGroup(flatbuffers::FlatBufferBuilder &_fbb, const CapturingGroupT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
1107 
1108 namespace RegexModel_ {
1109 
1110 struct PatternT : public flatbuffers::NativeTable {
1111   typedef Pattern TableType;
1112   std::string collection_name{};
1113   std::string pattern{};
1114   libtextclassifier3::ModeFlag enabled_modes = libtextclassifier3::ModeFlag_ALL;
1115   float target_classification_score = 1.0f;
1116   float priority_score = 0.0f;
1117   bool use_approximate_matching = false;
1118   std::unique_ptr<libtextclassifier3::CompressedBufferT> compressed_pattern{};
1119   std::unique_ptr<libtextclassifier3::VerificationOptionsT> verification_options{};
1120   std::vector<std::unique_ptr<libtextclassifier3::CapturingGroupT>> capturing_group{};
1121   std::string serialized_entity_data{};
1122   std::unique_ptr<libtextclassifier3::EntityDataT> entity_data{};
1123   PatternT() = default;
1124   PatternT(const PatternT &o);
1125   PatternT(PatternT&&) FLATBUFFERS_NOEXCEPT = default;
1126   PatternT &operator=(PatternT o) FLATBUFFERS_NOEXCEPT;
1127 };
1128 
1129 struct Pattern FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
1130   typedef PatternT NativeTableType;
1131   typedef PatternBuilder Builder;
1132   enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
1133     VT_COLLECTION_NAME = 4,
1134     VT_PATTERN = 6,
1135     VT_ENABLED_MODES = 8,
1136     VT_TARGET_CLASSIFICATION_SCORE = 10,
1137     VT_PRIORITY_SCORE = 12,
1138     VT_USE_APPROXIMATE_MATCHING = 14,
1139     VT_COMPRESSED_PATTERN = 16,
1140     VT_VERIFICATION_OPTIONS = 18,
1141     VT_CAPTURING_GROUP = 20,
1142     VT_SERIALIZED_ENTITY_DATA = 22,
1143     VT_ENTITY_DATA = 24
1144   };
collection_nameFLATBUFFERS_FINAL_CLASS1145   const flatbuffers::String *collection_name() const {
1146     return GetPointer<const flatbuffers::String *>(VT_COLLECTION_NAME);
1147   }
patternFLATBUFFERS_FINAL_CLASS1148   const flatbuffers::String *pattern() const {
1149     return GetPointer<const flatbuffers::String *>(VT_PATTERN);
1150   }
enabled_modesFLATBUFFERS_FINAL_CLASS1151   libtextclassifier3::ModeFlag enabled_modes() const {
1152     return static_cast<libtextclassifier3::ModeFlag>(GetField<int32_t>(VT_ENABLED_MODES, 7));
1153   }
target_classification_scoreFLATBUFFERS_FINAL_CLASS1154   float target_classification_score() const {
1155     return GetField<float>(VT_TARGET_CLASSIFICATION_SCORE, 1.0f);
1156   }
priority_scoreFLATBUFFERS_FINAL_CLASS1157   float priority_score() const {
1158     return GetField<float>(VT_PRIORITY_SCORE, 0.0f);
1159   }
use_approximate_matchingFLATBUFFERS_FINAL_CLASS1160   bool use_approximate_matching() const {
1161     return GetField<uint8_t>(VT_USE_APPROXIMATE_MATCHING, 0) != 0;
1162   }
compressed_patternFLATBUFFERS_FINAL_CLASS1163   const libtextclassifier3::CompressedBuffer *compressed_pattern() const {
1164     return GetPointer<const libtextclassifier3::CompressedBuffer *>(VT_COMPRESSED_PATTERN);
1165   }
verification_optionsFLATBUFFERS_FINAL_CLASS1166   const libtextclassifier3::VerificationOptions *verification_options() const {
1167     return GetPointer<const libtextclassifier3::VerificationOptions *>(VT_VERIFICATION_OPTIONS);
1168   }
capturing_groupFLATBUFFERS_FINAL_CLASS1169   const flatbuffers::Vector<flatbuffers::Offset<libtextclassifier3::CapturingGroup>> *capturing_group() const {
1170     return GetPointer<const flatbuffers::Vector<flatbuffers::Offset<libtextclassifier3::CapturingGroup>> *>(VT_CAPTURING_GROUP);
1171   }
serialized_entity_dataFLATBUFFERS_FINAL_CLASS1172   const flatbuffers::String *serialized_entity_data() const {
1173     return GetPointer<const flatbuffers::String *>(VT_SERIALIZED_ENTITY_DATA);
1174   }
entity_dataFLATBUFFERS_FINAL_CLASS1175   const libtextclassifier3::EntityData *entity_data() const {
1176     return GetPointer<const libtextclassifier3::EntityData *>(VT_ENTITY_DATA);
1177   }
VerifyFLATBUFFERS_FINAL_CLASS1178   bool Verify(flatbuffers::Verifier &verifier) const {
1179     return VerifyTableStart(verifier) &&
1180            VerifyOffset(verifier, VT_COLLECTION_NAME) &&
1181            verifier.VerifyString(collection_name()) &&
1182            VerifyOffset(verifier, VT_PATTERN) &&
1183            verifier.VerifyString(pattern()) &&
1184            VerifyField<int32_t>(verifier, VT_ENABLED_MODES, 4) &&
1185            VerifyField<float>(verifier, VT_TARGET_CLASSIFICATION_SCORE, 4) &&
1186            VerifyField<float>(verifier, VT_PRIORITY_SCORE, 4) &&
1187            VerifyField<uint8_t>(verifier, VT_USE_APPROXIMATE_MATCHING, 1) &&
1188            VerifyOffset(verifier, VT_COMPRESSED_PATTERN) &&
1189            verifier.VerifyTable(compressed_pattern()) &&
1190            VerifyOffset(verifier, VT_VERIFICATION_OPTIONS) &&
1191            verifier.VerifyTable(verification_options()) &&
1192            VerifyOffset(verifier, VT_CAPTURING_GROUP) &&
1193            verifier.VerifyVector(capturing_group()) &&
1194            verifier.VerifyVectorOfTables(capturing_group()) &&
1195            VerifyOffset(verifier, VT_SERIALIZED_ENTITY_DATA) &&
1196            verifier.VerifyString(serialized_entity_data()) &&
1197            VerifyOffset(verifier, VT_ENTITY_DATA) &&
1198            verifier.VerifyTable(entity_data()) &&
1199            verifier.EndTable();
1200   }
1201   PatternT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const;
1202   void UnPackTo(PatternT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const;
1203   static flatbuffers::Offset<Pattern> Pack(flatbuffers::FlatBufferBuilder &_fbb, const PatternT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
1204 };
1205 
1206 struct PatternBuilder {
1207   typedef Pattern Table;
1208   flatbuffers::FlatBufferBuilder &fbb_;
1209   flatbuffers::uoffset_t start_;
add_collection_namePatternBuilder1210   void add_collection_name(flatbuffers::Offset<flatbuffers::String> collection_name) {
1211     fbb_.AddOffset(Pattern::VT_COLLECTION_NAME, collection_name);
1212   }
add_patternPatternBuilder1213   void add_pattern(flatbuffers::Offset<flatbuffers::String> pattern) {
1214     fbb_.AddOffset(Pattern::VT_PATTERN, pattern);
1215   }
add_enabled_modesPatternBuilder1216   void add_enabled_modes(libtextclassifier3::ModeFlag enabled_modes) {
1217     fbb_.AddElement<int32_t>(Pattern::VT_ENABLED_MODES, static_cast<int32_t>(enabled_modes), 7);
1218   }
add_target_classification_scorePatternBuilder1219   void add_target_classification_score(float target_classification_score) {
1220     fbb_.AddElement<float>(Pattern::VT_TARGET_CLASSIFICATION_SCORE, target_classification_score, 1.0f);
1221   }
add_priority_scorePatternBuilder1222   void add_priority_score(float priority_score) {
1223     fbb_.AddElement<float>(Pattern::VT_PRIORITY_SCORE, priority_score, 0.0f);
1224   }
add_use_approximate_matchingPatternBuilder1225   void add_use_approximate_matching(bool use_approximate_matching) {
1226     fbb_.AddElement<uint8_t>(Pattern::VT_USE_APPROXIMATE_MATCHING, static_cast<uint8_t>(use_approximate_matching), 0);
1227   }
add_compressed_patternPatternBuilder1228   void add_compressed_pattern(flatbuffers::Offset<libtextclassifier3::CompressedBuffer> compressed_pattern) {
1229     fbb_.AddOffset(Pattern::VT_COMPRESSED_PATTERN, compressed_pattern);
1230   }
add_verification_optionsPatternBuilder1231   void add_verification_options(flatbuffers::Offset<libtextclassifier3::VerificationOptions> verification_options) {
1232     fbb_.AddOffset(Pattern::VT_VERIFICATION_OPTIONS, verification_options);
1233   }
add_capturing_groupPatternBuilder1234   void add_capturing_group(flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<libtextclassifier3::CapturingGroup>>> capturing_group) {
1235     fbb_.AddOffset(Pattern::VT_CAPTURING_GROUP, capturing_group);
1236   }
add_serialized_entity_dataPatternBuilder1237   void add_serialized_entity_data(flatbuffers::Offset<flatbuffers::String> serialized_entity_data) {
1238     fbb_.AddOffset(Pattern::VT_SERIALIZED_ENTITY_DATA, serialized_entity_data);
1239   }
add_entity_dataPatternBuilder1240   void add_entity_data(flatbuffers::Offset<libtextclassifier3::EntityData> entity_data) {
1241     fbb_.AddOffset(Pattern::VT_ENTITY_DATA, entity_data);
1242   }
PatternBuilderPatternBuilder1243   explicit PatternBuilder(flatbuffers::FlatBufferBuilder &_fbb)
1244         : fbb_(_fbb) {
1245     start_ = fbb_.StartTable();
1246   }
FinishPatternBuilder1247   flatbuffers::Offset<Pattern> Finish() {
1248     const auto end = fbb_.EndTable(start_);
1249     auto o = flatbuffers::Offset<Pattern>(end);
1250     return o;
1251   }
1252 };
1253 
1254 inline flatbuffers::Offset<Pattern> CreatePattern(
1255     flatbuffers::FlatBufferBuilder &_fbb,
1256     flatbuffers::Offset<flatbuffers::String> collection_name = 0,
1257     flatbuffers::Offset<flatbuffers::String> pattern = 0,
1258     libtextclassifier3::ModeFlag enabled_modes = libtextclassifier3::ModeFlag_ALL,
1259     float target_classification_score = 1.0f,
1260     float priority_score = 0.0f,
1261     bool use_approximate_matching = false,
1262     flatbuffers::Offset<libtextclassifier3::CompressedBuffer> compressed_pattern = 0,
1263     flatbuffers::Offset<libtextclassifier3::VerificationOptions> verification_options = 0,
1264     flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<libtextclassifier3::CapturingGroup>>> capturing_group = 0,
1265     flatbuffers::Offset<flatbuffers::String> serialized_entity_data = 0,
1266     flatbuffers::Offset<libtextclassifier3::EntityData> entity_data = 0) {
1267   PatternBuilder builder_(_fbb);
1268   builder_.add_entity_data(entity_data);
1269   builder_.add_serialized_entity_data(serialized_entity_data);
1270   builder_.add_capturing_group(capturing_group);
1271   builder_.add_verification_options(verification_options);
1272   builder_.add_compressed_pattern(compressed_pattern);
1273   builder_.add_priority_score(priority_score);
1274   builder_.add_target_classification_score(target_classification_score);
1275   builder_.add_enabled_modes(enabled_modes);
1276   builder_.add_pattern(pattern);
1277   builder_.add_collection_name(collection_name);
1278   builder_.add_use_approximate_matching(use_approximate_matching);
1279   return builder_.Finish();
1280 }
1281 
1282 inline flatbuffers::Offset<Pattern> CreatePatternDirect(
1283     flatbuffers::FlatBufferBuilder &_fbb,
1284     const char *collection_name = nullptr,
1285     const char *pattern = nullptr,
1286     libtextclassifier3::ModeFlag enabled_modes = libtextclassifier3::ModeFlag_ALL,
1287     float target_classification_score = 1.0f,
1288     float priority_score = 0.0f,
1289     bool use_approximate_matching = false,
1290     flatbuffers::Offset<libtextclassifier3::CompressedBuffer> compressed_pattern = 0,
1291     flatbuffers::Offset<libtextclassifier3::VerificationOptions> verification_options = 0,
1292     const std::vector<flatbuffers::Offset<libtextclassifier3::CapturingGroup>> *capturing_group = nullptr,
1293     const char *serialized_entity_data = nullptr,
1294     flatbuffers::Offset<libtextclassifier3::EntityData> entity_data = 0) {
1295   auto collection_name__ = collection_name ? _fbb.CreateSharedString(collection_name) : 0;
1296   auto pattern__ = pattern ? _fbb.CreateSharedString(pattern) : 0;
1297   auto capturing_group__ = capturing_group ? _fbb.CreateVector<flatbuffers::Offset<libtextclassifier3::CapturingGroup>>(*capturing_group) : 0;
1298   auto serialized_entity_data__ = serialized_entity_data ? _fbb.CreateSharedString(serialized_entity_data) : 0;
1299   return libtextclassifier3::RegexModel_::CreatePattern(
1300       _fbb,
1301       collection_name__,
1302       pattern__,
1303       enabled_modes,
1304       target_classification_score,
1305       priority_score,
1306       use_approximate_matching,
1307       compressed_pattern,
1308       verification_options,
1309       capturing_group__,
1310       serialized_entity_data__,
1311       entity_data);
1312 }
1313 
1314 flatbuffers::Offset<Pattern> CreatePattern(flatbuffers::FlatBufferBuilder &_fbb, const PatternT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
1315 
1316 }  // namespace RegexModel_
1317 
1318 struct RegexModelT : public flatbuffers::NativeTable {
1319   typedef RegexModel TableType;
1320   std::vector<std::unique_ptr<libtextclassifier3::RegexModel_::PatternT>> patterns{};
1321   bool lazy_regex_compilation = true;
1322   std::vector<std::string> lua_verifier{};
1323   RegexModelT() = default;
1324   RegexModelT(const RegexModelT &o);
1325   RegexModelT(RegexModelT&&) FLATBUFFERS_NOEXCEPT = default;
1326   RegexModelT &operator=(RegexModelT o) FLATBUFFERS_NOEXCEPT;
1327 };
1328 
1329 struct RegexModel FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
1330   typedef RegexModelT NativeTableType;
1331   typedef RegexModelBuilder Builder;
1332   enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
1333     VT_PATTERNS = 4,
1334     VT_LAZY_REGEX_COMPILATION = 6,
1335     VT_LUA_VERIFIER = 8
1336   };
patternsFLATBUFFERS_FINAL_CLASS1337   const flatbuffers::Vector<flatbuffers::Offset<libtextclassifier3::RegexModel_::Pattern>> *patterns() const {
1338     return GetPointer<const flatbuffers::Vector<flatbuffers::Offset<libtextclassifier3::RegexModel_::Pattern>> *>(VT_PATTERNS);
1339   }
lazy_regex_compilationFLATBUFFERS_FINAL_CLASS1340   bool lazy_regex_compilation() const {
1341     return GetField<uint8_t>(VT_LAZY_REGEX_COMPILATION, 1) != 0;
1342   }
lua_verifierFLATBUFFERS_FINAL_CLASS1343   const flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>> *lua_verifier() const {
1344     return GetPointer<const flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>> *>(VT_LUA_VERIFIER);
1345   }
VerifyFLATBUFFERS_FINAL_CLASS1346   bool Verify(flatbuffers::Verifier &verifier) const {
1347     return VerifyTableStart(verifier) &&
1348            VerifyOffset(verifier, VT_PATTERNS) &&
1349            verifier.VerifyVector(patterns()) &&
1350            verifier.VerifyVectorOfTables(patterns()) &&
1351            VerifyField<uint8_t>(verifier, VT_LAZY_REGEX_COMPILATION, 1) &&
1352            VerifyOffset(verifier, VT_LUA_VERIFIER) &&
1353            verifier.VerifyVector(lua_verifier()) &&
1354            verifier.VerifyVectorOfStrings(lua_verifier()) &&
1355            verifier.EndTable();
1356   }
1357   RegexModelT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const;
1358   void UnPackTo(RegexModelT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const;
1359   static flatbuffers::Offset<RegexModel> Pack(flatbuffers::FlatBufferBuilder &_fbb, const RegexModelT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
1360 };
1361 
1362 struct RegexModelBuilder {
1363   typedef RegexModel Table;
1364   flatbuffers::FlatBufferBuilder &fbb_;
1365   flatbuffers::uoffset_t start_;
add_patternsRegexModelBuilder1366   void add_patterns(flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<libtextclassifier3::RegexModel_::Pattern>>> patterns) {
1367     fbb_.AddOffset(RegexModel::VT_PATTERNS, patterns);
1368   }
add_lazy_regex_compilationRegexModelBuilder1369   void add_lazy_regex_compilation(bool lazy_regex_compilation) {
1370     fbb_.AddElement<uint8_t>(RegexModel::VT_LAZY_REGEX_COMPILATION, static_cast<uint8_t>(lazy_regex_compilation), 1);
1371   }
add_lua_verifierRegexModelBuilder1372   void add_lua_verifier(flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>>> lua_verifier) {
1373     fbb_.AddOffset(RegexModel::VT_LUA_VERIFIER, lua_verifier);
1374   }
RegexModelBuilderRegexModelBuilder1375   explicit RegexModelBuilder(flatbuffers::FlatBufferBuilder &_fbb)
1376         : fbb_(_fbb) {
1377     start_ = fbb_.StartTable();
1378   }
FinishRegexModelBuilder1379   flatbuffers::Offset<RegexModel> Finish() {
1380     const auto end = fbb_.EndTable(start_);
1381     auto o = flatbuffers::Offset<RegexModel>(end);
1382     return o;
1383   }
1384 };
1385 
1386 inline flatbuffers::Offset<RegexModel> CreateRegexModel(
1387     flatbuffers::FlatBufferBuilder &_fbb,
1388     flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<libtextclassifier3::RegexModel_::Pattern>>> patterns = 0,
1389     bool lazy_regex_compilation = true,
1390     flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>>> lua_verifier = 0) {
1391   RegexModelBuilder builder_(_fbb);
1392   builder_.add_lua_verifier(lua_verifier);
1393   builder_.add_patterns(patterns);
1394   builder_.add_lazy_regex_compilation(lazy_regex_compilation);
1395   return builder_.Finish();
1396 }
1397 
1398 inline flatbuffers::Offset<RegexModel> CreateRegexModelDirect(
1399     flatbuffers::FlatBufferBuilder &_fbb,
1400     const std::vector<flatbuffers::Offset<libtextclassifier3::RegexModel_::Pattern>> *patterns = nullptr,
1401     bool lazy_regex_compilation = true,
1402     const std::vector<flatbuffers::Offset<flatbuffers::String>> *lua_verifier = nullptr) {
1403   auto patterns__ = patterns ? _fbb.CreateVector<flatbuffers::Offset<libtextclassifier3::RegexModel_::Pattern>>(*patterns) : 0;
1404   auto lua_verifier__ = lua_verifier ? _fbb.CreateVector<flatbuffers::Offset<flatbuffers::String>>(*lua_verifier) : 0;
1405   return libtextclassifier3::CreateRegexModel(
1406       _fbb,
1407       patterns__,
1408       lazy_regex_compilation,
1409       lua_verifier__);
1410 }
1411 
1412 flatbuffers::Offset<RegexModel> CreateRegexModel(flatbuffers::FlatBufferBuilder &_fbb, const RegexModelT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
1413 
1414 namespace DatetimeModelPattern_ {
1415 
1416 struct RegexT : public flatbuffers::NativeTable {
1417   typedef Regex TableType;
1418   std::string pattern{};
1419   std::vector<libtextclassifier3::DatetimeGroupType> groups{};
1420   std::unique_ptr<libtextclassifier3::CompressedBufferT> compressed_pattern{};
1421   RegexT() = default;
1422   RegexT(const RegexT &o);
1423   RegexT(RegexT&&) FLATBUFFERS_NOEXCEPT = default;
1424   RegexT &operator=(RegexT o) FLATBUFFERS_NOEXCEPT;
1425 };
1426 
1427 struct Regex FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
1428   typedef RegexT NativeTableType;
1429   typedef RegexBuilder Builder;
1430   enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
1431     VT_PATTERN = 4,
1432     VT_GROUPS = 6,
1433     VT_COMPRESSED_PATTERN = 8
1434   };
patternFLATBUFFERS_FINAL_CLASS1435   const flatbuffers::String *pattern() const {
1436     return GetPointer<const flatbuffers::String *>(VT_PATTERN);
1437   }
groupsFLATBUFFERS_FINAL_CLASS1438   const flatbuffers::Vector<int32_t> *groups() const {
1439     return GetPointer<const flatbuffers::Vector<int32_t> *>(VT_GROUPS);
1440   }
compressed_patternFLATBUFFERS_FINAL_CLASS1441   const libtextclassifier3::CompressedBuffer *compressed_pattern() const {
1442     return GetPointer<const libtextclassifier3::CompressedBuffer *>(VT_COMPRESSED_PATTERN);
1443   }
VerifyFLATBUFFERS_FINAL_CLASS1444   bool Verify(flatbuffers::Verifier &verifier) const {
1445     return VerifyTableStart(verifier) &&
1446            VerifyOffset(verifier, VT_PATTERN) &&
1447            verifier.VerifyString(pattern()) &&
1448            VerifyOffset(verifier, VT_GROUPS) &&
1449            verifier.VerifyVector(groups()) &&
1450            VerifyOffset(verifier, VT_COMPRESSED_PATTERN) &&
1451            verifier.VerifyTable(compressed_pattern()) &&
1452            verifier.EndTable();
1453   }
1454   RegexT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const;
1455   void UnPackTo(RegexT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const;
1456   static flatbuffers::Offset<Regex> Pack(flatbuffers::FlatBufferBuilder &_fbb, const RegexT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
1457 };
1458 
1459 struct RegexBuilder {
1460   typedef Regex Table;
1461   flatbuffers::FlatBufferBuilder &fbb_;
1462   flatbuffers::uoffset_t start_;
add_patternRegexBuilder1463   void add_pattern(flatbuffers::Offset<flatbuffers::String> pattern) {
1464     fbb_.AddOffset(Regex::VT_PATTERN, pattern);
1465   }
add_groupsRegexBuilder1466   void add_groups(flatbuffers::Offset<flatbuffers::Vector<int32_t>> groups) {
1467     fbb_.AddOffset(Regex::VT_GROUPS, groups);
1468   }
add_compressed_patternRegexBuilder1469   void add_compressed_pattern(flatbuffers::Offset<libtextclassifier3::CompressedBuffer> compressed_pattern) {
1470     fbb_.AddOffset(Regex::VT_COMPRESSED_PATTERN, compressed_pattern);
1471   }
RegexBuilderRegexBuilder1472   explicit RegexBuilder(flatbuffers::FlatBufferBuilder &_fbb)
1473         : fbb_(_fbb) {
1474     start_ = fbb_.StartTable();
1475   }
FinishRegexBuilder1476   flatbuffers::Offset<Regex> Finish() {
1477     const auto end = fbb_.EndTable(start_);
1478     auto o = flatbuffers::Offset<Regex>(end);
1479     return o;
1480   }
1481 };
1482 
1483 inline flatbuffers::Offset<Regex> CreateRegex(
1484     flatbuffers::FlatBufferBuilder &_fbb,
1485     flatbuffers::Offset<flatbuffers::String> pattern = 0,
1486     flatbuffers::Offset<flatbuffers::Vector<int32_t>> groups = 0,
1487     flatbuffers::Offset<libtextclassifier3::CompressedBuffer> compressed_pattern = 0) {
1488   RegexBuilder builder_(_fbb);
1489   builder_.add_compressed_pattern(compressed_pattern);
1490   builder_.add_groups(groups);
1491   builder_.add_pattern(pattern);
1492   return builder_.Finish();
1493 }
1494 
1495 inline flatbuffers::Offset<Regex> CreateRegexDirect(
1496     flatbuffers::FlatBufferBuilder &_fbb,
1497     const char *pattern = nullptr,
1498     const std::vector<int32_t> *groups = nullptr,
1499     flatbuffers::Offset<libtextclassifier3::CompressedBuffer> compressed_pattern = 0) {
1500   auto pattern__ = pattern ? _fbb.CreateSharedString(pattern) : 0;
1501   auto groups__ = groups ? _fbb.CreateVector<int32_t>(*groups) : 0;
1502   return libtextclassifier3::DatetimeModelPattern_::CreateRegex(
1503       _fbb,
1504       pattern__,
1505       groups__,
1506       compressed_pattern);
1507 }
1508 
1509 flatbuffers::Offset<Regex> CreateRegex(flatbuffers::FlatBufferBuilder &_fbb, const RegexT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
1510 
1511 }  // namespace DatetimeModelPattern_
1512 
1513 struct DatetimeModelPatternT : public flatbuffers::NativeTable {
1514   typedef DatetimeModelPattern TableType;
1515   std::vector<std::unique_ptr<libtextclassifier3::DatetimeModelPattern_::RegexT>> regexes{};
1516   std::vector<int32_t> locales{};
1517   float target_classification_score = 1.0f;
1518   float priority_score = 0.0f;
1519   libtextclassifier3::ModeFlag enabled_modes = libtextclassifier3::ModeFlag_ALL;
1520   uint32_t enabled_annotation_usecases = 4294967295;
1521   DatetimeModelPatternT() = default;
1522   DatetimeModelPatternT(const DatetimeModelPatternT &o);
1523   DatetimeModelPatternT(DatetimeModelPatternT&&) FLATBUFFERS_NOEXCEPT = default;
1524   DatetimeModelPatternT &operator=(DatetimeModelPatternT o) FLATBUFFERS_NOEXCEPT;
1525 };
1526 
1527 struct DatetimeModelPattern FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
1528   typedef DatetimeModelPatternT NativeTableType;
1529   typedef DatetimeModelPatternBuilder Builder;
1530   enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
1531     VT_REGEXES = 4,
1532     VT_LOCALES = 6,
1533     VT_TARGET_CLASSIFICATION_SCORE = 8,
1534     VT_PRIORITY_SCORE = 10,
1535     VT_ENABLED_MODES = 12,
1536     VT_ENABLED_ANNOTATION_USECASES = 14
1537   };
regexesFLATBUFFERS_FINAL_CLASS1538   const flatbuffers::Vector<flatbuffers::Offset<libtextclassifier3::DatetimeModelPattern_::Regex>> *regexes() const {
1539     return GetPointer<const flatbuffers::Vector<flatbuffers::Offset<libtextclassifier3::DatetimeModelPattern_::Regex>> *>(VT_REGEXES);
1540   }
localesFLATBUFFERS_FINAL_CLASS1541   const flatbuffers::Vector<int32_t> *locales() const {
1542     return GetPointer<const flatbuffers::Vector<int32_t> *>(VT_LOCALES);
1543   }
target_classification_scoreFLATBUFFERS_FINAL_CLASS1544   float target_classification_score() const {
1545     return GetField<float>(VT_TARGET_CLASSIFICATION_SCORE, 1.0f);
1546   }
priority_scoreFLATBUFFERS_FINAL_CLASS1547   float priority_score() const {
1548     return GetField<float>(VT_PRIORITY_SCORE, 0.0f);
1549   }
enabled_modesFLATBUFFERS_FINAL_CLASS1550   libtextclassifier3::ModeFlag enabled_modes() const {
1551     return static_cast<libtextclassifier3::ModeFlag>(GetField<int32_t>(VT_ENABLED_MODES, 7));
1552   }
enabled_annotation_usecasesFLATBUFFERS_FINAL_CLASS1553   uint32_t enabled_annotation_usecases() const {
1554     return GetField<uint32_t>(VT_ENABLED_ANNOTATION_USECASES, 4294967295);
1555   }
VerifyFLATBUFFERS_FINAL_CLASS1556   bool Verify(flatbuffers::Verifier &verifier) const {
1557     return VerifyTableStart(verifier) &&
1558            VerifyOffset(verifier, VT_REGEXES) &&
1559            verifier.VerifyVector(regexes()) &&
1560            verifier.VerifyVectorOfTables(regexes()) &&
1561            VerifyOffset(verifier, VT_LOCALES) &&
1562            verifier.VerifyVector(locales()) &&
1563            VerifyField<float>(verifier, VT_TARGET_CLASSIFICATION_SCORE, 4) &&
1564            VerifyField<float>(verifier, VT_PRIORITY_SCORE, 4) &&
1565            VerifyField<int32_t>(verifier, VT_ENABLED_MODES, 4) &&
1566            VerifyField<uint32_t>(verifier, VT_ENABLED_ANNOTATION_USECASES, 4) &&
1567            verifier.EndTable();
1568   }
1569   DatetimeModelPatternT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const;
1570   void UnPackTo(DatetimeModelPatternT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const;
1571   static flatbuffers::Offset<DatetimeModelPattern> Pack(flatbuffers::FlatBufferBuilder &_fbb, const DatetimeModelPatternT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
1572 };
1573 
1574 struct DatetimeModelPatternBuilder {
1575   typedef DatetimeModelPattern Table;
1576   flatbuffers::FlatBufferBuilder &fbb_;
1577   flatbuffers::uoffset_t start_;
add_regexesDatetimeModelPatternBuilder1578   void add_regexes(flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<libtextclassifier3::DatetimeModelPattern_::Regex>>> regexes) {
1579     fbb_.AddOffset(DatetimeModelPattern::VT_REGEXES, regexes);
1580   }
add_localesDatetimeModelPatternBuilder1581   void add_locales(flatbuffers::Offset<flatbuffers::Vector<int32_t>> locales) {
1582     fbb_.AddOffset(DatetimeModelPattern::VT_LOCALES, locales);
1583   }
add_target_classification_scoreDatetimeModelPatternBuilder1584   void add_target_classification_score(float target_classification_score) {
1585     fbb_.AddElement<float>(DatetimeModelPattern::VT_TARGET_CLASSIFICATION_SCORE, target_classification_score, 1.0f);
1586   }
add_priority_scoreDatetimeModelPatternBuilder1587   void add_priority_score(float priority_score) {
1588     fbb_.AddElement<float>(DatetimeModelPattern::VT_PRIORITY_SCORE, priority_score, 0.0f);
1589   }
add_enabled_modesDatetimeModelPatternBuilder1590   void add_enabled_modes(libtextclassifier3::ModeFlag enabled_modes) {
1591     fbb_.AddElement<int32_t>(DatetimeModelPattern::VT_ENABLED_MODES, static_cast<int32_t>(enabled_modes), 7);
1592   }
add_enabled_annotation_usecasesDatetimeModelPatternBuilder1593   void add_enabled_annotation_usecases(uint32_t enabled_annotation_usecases) {
1594     fbb_.AddElement<uint32_t>(DatetimeModelPattern::VT_ENABLED_ANNOTATION_USECASES, enabled_annotation_usecases, 4294967295);
1595   }
DatetimeModelPatternBuilderDatetimeModelPatternBuilder1596   explicit DatetimeModelPatternBuilder(flatbuffers::FlatBufferBuilder &_fbb)
1597         : fbb_(_fbb) {
1598     start_ = fbb_.StartTable();
1599   }
FinishDatetimeModelPatternBuilder1600   flatbuffers::Offset<DatetimeModelPattern> Finish() {
1601     const auto end = fbb_.EndTable(start_);
1602     auto o = flatbuffers::Offset<DatetimeModelPattern>(end);
1603     return o;
1604   }
1605 };
1606 
1607 inline flatbuffers::Offset<DatetimeModelPattern> CreateDatetimeModelPattern(
1608     flatbuffers::FlatBufferBuilder &_fbb,
1609     flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<libtextclassifier3::DatetimeModelPattern_::Regex>>> regexes = 0,
1610     flatbuffers::Offset<flatbuffers::Vector<int32_t>> locales = 0,
1611     float target_classification_score = 1.0f,
1612     float priority_score = 0.0f,
1613     libtextclassifier3::ModeFlag enabled_modes = libtextclassifier3::ModeFlag_ALL,
1614     uint32_t enabled_annotation_usecases = 4294967295) {
1615   DatetimeModelPatternBuilder builder_(_fbb);
1616   builder_.add_enabled_annotation_usecases(enabled_annotation_usecases);
1617   builder_.add_enabled_modes(enabled_modes);
1618   builder_.add_priority_score(priority_score);
1619   builder_.add_target_classification_score(target_classification_score);
1620   builder_.add_locales(locales);
1621   builder_.add_regexes(regexes);
1622   return builder_.Finish();
1623 }
1624 
1625 inline flatbuffers::Offset<DatetimeModelPattern> CreateDatetimeModelPatternDirect(
1626     flatbuffers::FlatBufferBuilder &_fbb,
1627     const std::vector<flatbuffers::Offset<libtextclassifier3::DatetimeModelPattern_::Regex>> *regexes = nullptr,
1628     const std::vector<int32_t> *locales = nullptr,
1629     float target_classification_score = 1.0f,
1630     float priority_score = 0.0f,
1631     libtextclassifier3::ModeFlag enabled_modes = libtextclassifier3::ModeFlag_ALL,
1632     uint32_t enabled_annotation_usecases = 4294967295) {
1633   auto regexes__ = regexes ? _fbb.CreateVector<flatbuffers::Offset<libtextclassifier3::DatetimeModelPattern_::Regex>>(*regexes) : 0;
1634   auto locales__ = locales ? _fbb.CreateVector<int32_t>(*locales) : 0;
1635   return libtextclassifier3::CreateDatetimeModelPattern(
1636       _fbb,
1637       regexes__,
1638       locales__,
1639       target_classification_score,
1640       priority_score,
1641       enabled_modes,
1642       enabled_annotation_usecases);
1643 }
1644 
1645 flatbuffers::Offset<DatetimeModelPattern> CreateDatetimeModelPattern(flatbuffers::FlatBufferBuilder &_fbb, const DatetimeModelPatternT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
1646 
1647 struct DatetimeModelExtractorT : public flatbuffers::NativeTable {
1648   typedef DatetimeModelExtractor TableType;
1649   libtextclassifier3::DatetimeExtractorType extractor = libtextclassifier3::DatetimeExtractorType_UNKNOWN_DATETIME_EXTRACTOR_TYPE;
1650   std::string pattern{};
1651   std::vector<int32_t> locales{};
1652   std::unique_ptr<libtextclassifier3::CompressedBufferT> compressed_pattern{};
1653   DatetimeModelExtractorT() = default;
1654   DatetimeModelExtractorT(const DatetimeModelExtractorT &o);
1655   DatetimeModelExtractorT(DatetimeModelExtractorT&&) FLATBUFFERS_NOEXCEPT = default;
1656   DatetimeModelExtractorT &operator=(DatetimeModelExtractorT o) FLATBUFFERS_NOEXCEPT;
1657 };
1658 
1659 struct DatetimeModelExtractor FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
1660   typedef DatetimeModelExtractorT NativeTableType;
1661   typedef DatetimeModelExtractorBuilder Builder;
1662   enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
1663     VT_EXTRACTOR = 4,
1664     VT_PATTERN = 6,
1665     VT_LOCALES = 8,
1666     VT_COMPRESSED_PATTERN = 10
1667   };
extractorFLATBUFFERS_FINAL_CLASS1668   libtextclassifier3::DatetimeExtractorType extractor() const {
1669     return static_cast<libtextclassifier3::DatetimeExtractorType>(GetField<int32_t>(VT_EXTRACTOR, 0));
1670   }
patternFLATBUFFERS_FINAL_CLASS1671   const flatbuffers::String *pattern() const {
1672     return GetPointer<const flatbuffers::String *>(VT_PATTERN);
1673   }
localesFLATBUFFERS_FINAL_CLASS1674   const flatbuffers::Vector<int32_t> *locales() const {
1675     return GetPointer<const flatbuffers::Vector<int32_t> *>(VT_LOCALES);
1676   }
compressed_patternFLATBUFFERS_FINAL_CLASS1677   const libtextclassifier3::CompressedBuffer *compressed_pattern() const {
1678     return GetPointer<const libtextclassifier3::CompressedBuffer *>(VT_COMPRESSED_PATTERN);
1679   }
VerifyFLATBUFFERS_FINAL_CLASS1680   bool Verify(flatbuffers::Verifier &verifier) const {
1681     return VerifyTableStart(verifier) &&
1682            VerifyField<int32_t>(verifier, VT_EXTRACTOR, 4) &&
1683            VerifyOffset(verifier, VT_PATTERN) &&
1684            verifier.VerifyString(pattern()) &&
1685            VerifyOffset(verifier, VT_LOCALES) &&
1686            verifier.VerifyVector(locales()) &&
1687            VerifyOffset(verifier, VT_COMPRESSED_PATTERN) &&
1688            verifier.VerifyTable(compressed_pattern()) &&
1689            verifier.EndTable();
1690   }
1691   DatetimeModelExtractorT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const;
1692   void UnPackTo(DatetimeModelExtractorT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const;
1693   static flatbuffers::Offset<DatetimeModelExtractor> Pack(flatbuffers::FlatBufferBuilder &_fbb, const DatetimeModelExtractorT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
1694 };
1695 
1696 struct DatetimeModelExtractorBuilder {
1697   typedef DatetimeModelExtractor Table;
1698   flatbuffers::FlatBufferBuilder &fbb_;
1699   flatbuffers::uoffset_t start_;
add_extractorDatetimeModelExtractorBuilder1700   void add_extractor(libtextclassifier3::DatetimeExtractorType extractor) {
1701     fbb_.AddElement<int32_t>(DatetimeModelExtractor::VT_EXTRACTOR, static_cast<int32_t>(extractor), 0);
1702   }
add_patternDatetimeModelExtractorBuilder1703   void add_pattern(flatbuffers::Offset<flatbuffers::String> pattern) {
1704     fbb_.AddOffset(DatetimeModelExtractor::VT_PATTERN, pattern);
1705   }
add_localesDatetimeModelExtractorBuilder1706   void add_locales(flatbuffers::Offset<flatbuffers::Vector<int32_t>> locales) {
1707     fbb_.AddOffset(DatetimeModelExtractor::VT_LOCALES, locales);
1708   }
add_compressed_patternDatetimeModelExtractorBuilder1709   void add_compressed_pattern(flatbuffers::Offset<libtextclassifier3::CompressedBuffer> compressed_pattern) {
1710     fbb_.AddOffset(DatetimeModelExtractor::VT_COMPRESSED_PATTERN, compressed_pattern);
1711   }
DatetimeModelExtractorBuilderDatetimeModelExtractorBuilder1712   explicit DatetimeModelExtractorBuilder(flatbuffers::FlatBufferBuilder &_fbb)
1713         : fbb_(_fbb) {
1714     start_ = fbb_.StartTable();
1715   }
FinishDatetimeModelExtractorBuilder1716   flatbuffers::Offset<DatetimeModelExtractor> Finish() {
1717     const auto end = fbb_.EndTable(start_);
1718     auto o = flatbuffers::Offset<DatetimeModelExtractor>(end);
1719     return o;
1720   }
1721 };
1722 
1723 inline flatbuffers::Offset<DatetimeModelExtractor> CreateDatetimeModelExtractor(
1724     flatbuffers::FlatBufferBuilder &_fbb,
1725     libtextclassifier3::DatetimeExtractorType extractor = libtextclassifier3::DatetimeExtractorType_UNKNOWN_DATETIME_EXTRACTOR_TYPE,
1726     flatbuffers::Offset<flatbuffers::String> pattern = 0,
1727     flatbuffers::Offset<flatbuffers::Vector<int32_t>> locales = 0,
1728     flatbuffers::Offset<libtextclassifier3::CompressedBuffer> compressed_pattern = 0) {
1729   DatetimeModelExtractorBuilder builder_(_fbb);
1730   builder_.add_compressed_pattern(compressed_pattern);
1731   builder_.add_locales(locales);
1732   builder_.add_pattern(pattern);
1733   builder_.add_extractor(extractor);
1734   return builder_.Finish();
1735 }
1736 
1737 inline flatbuffers::Offset<DatetimeModelExtractor> CreateDatetimeModelExtractorDirect(
1738     flatbuffers::FlatBufferBuilder &_fbb,
1739     libtextclassifier3::DatetimeExtractorType extractor = libtextclassifier3::DatetimeExtractorType_UNKNOWN_DATETIME_EXTRACTOR_TYPE,
1740     const char *pattern = nullptr,
1741     const std::vector<int32_t> *locales = nullptr,
1742     flatbuffers::Offset<libtextclassifier3::CompressedBuffer> compressed_pattern = 0) {
1743   auto pattern__ = pattern ? _fbb.CreateSharedString(pattern) : 0;
1744   auto locales__ = locales ? _fbb.CreateVector<int32_t>(*locales) : 0;
1745   return libtextclassifier3::CreateDatetimeModelExtractor(
1746       _fbb,
1747       extractor,
1748       pattern__,
1749       locales__,
1750       compressed_pattern);
1751 }
1752 
1753 flatbuffers::Offset<DatetimeModelExtractor> CreateDatetimeModelExtractor(flatbuffers::FlatBufferBuilder &_fbb, const DatetimeModelExtractorT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
1754 
1755 struct DatetimeModelT : public flatbuffers::NativeTable {
1756   typedef DatetimeModel TableType;
1757   std::vector<std::string> locales{};
1758   std::vector<std::unique_ptr<libtextclassifier3::DatetimeModelPatternT>> patterns{};
1759   std::vector<std::unique_ptr<libtextclassifier3::DatetimeModelExtractorT>> extractors{};
1760   bool use_extractors_for_locating = true;
1761   std::vector<int32_t> default_locales{};
1762   bool generate_alternative_interpretations_when_ambiguous = false;
1763   bool lazy_regex_compilation = true;
1764   bool prefer_future_for_unspecified_date = false;
1765   DatetimeModelT() = default;
1766   DatetimeModelT(const DatetimeModelT &o);
1767   DatetimeModelT(DatetimeModelT&&) FLATBUFFERS_NOEXCEPT = default;
1768   DatetimeModelT &operator=(DatetimeModelT o) FLATBUFFERS_NOEXCEPT;
1769 };
1770 
1771 struct DatetimeModel FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
1772   typedef DatetimeModelT NativeTableType;
1773   typedef DatetimeModelBuilder Builder;
1774   enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
1775     VT_LOCALES = 4,
1776     VT_PATTERNS = 6,
1777     VT_EXTRACTORS = 8,
1778     VT_USE_EXTRACTORS_FOR_LOCATING = 10,
1779     VT_DEFAULT_LOCALES = 12,
1780     VT_GENERATE_ALTERNATIVE_INTERPRETATIONS_WHEN_AMBIGUOUS = 14,
1781     VT_LAZY_REGEX_COMPILATION = 16,
1782     VT_PREFER_FUTURE_FOR_UNSPECIFIED_DATE = 18
1783   };
localesFLATBUFFERS_FINAL_CLASS1784   const flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>> *locales() const {
1785     return GetPointer<const flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>> *>(VT_LOCALES);
1786   }
patternsFLATBUFFERS_FINAL_CLASS1787   const flatbuffers::Vector<flatbuffers::Offset<libtextclassifier3::DatetimeModelPattern>> *patterns() const {
1788     return GetPointer<const flatbuffers::Vector<flatbuffers::Offset<libtextclassifier3::DatetimeModelPattern>> *>(VT_PATTERNS);
1789   }
extractorsFLATBUFFERS_FINAL_CLASS1790   const flatbuffers::Vector<flatbuffers::Offset<libtextclassifier3::DatetimeModelExtractor>> *extractors() const {
1791     return GetPointer<const flatbuffers::Vector<flatbuffers::Offset<libtextclassifier3::DatetimeModelExtractor>> *>(VT_EXTRACTORS);
1792   }
use_extractors_for_locatingFLATBUFFERS_FINAL_CLASS1793   bool use_extractors_for_locating() const {
1794     return GetField<uint8_t>(VT_USE_EXTRACTORS_FOR_LOCATING, 1) != 0;
1795   }
default_localesFLATBUFFERS_FINAL_CLASS1796   const flatbuffers::Vector<int32_t> *default_locales() const {
1797     return GetPointer<const flatbuffers::Vector<int32_t> *>(VT_DEFAULT_LOCALES);
1798   }
generate_alternative_interpretations_when_ambiguousFLATBUFFERS_FINAL_CLASS1799   bool generate_alternative_interpretations_when_ambiguous() const {
1800     return GetField<uint8_t>(VT_GENERATE_ALTERNATIVE_INTERPRETATIONS_WHEN_AMBIGUOUS, 0) != 0;
1801   }
lazy_regex_compilationFLATBUFFERS_FINAL_CLASS1802   bool lazy_regex_compilation() const {
1803     return GetField<uint8_t>(VT_LAZY_REGEX_COMPILATION, 1) != 0;
1804   }
prefer_future_for_unspecified_dateFLATBUFFERS_FINAL_CLASS1805   bool prefer_future_for_unspecified_date() const {
1806     return GetField<uint8_t>(VT_PREFER_FUTURE_FOR_UNSPECIFIED_DATE, 0) != 0;
1807   }
VerifyFLATBUFFERS_FINAL_CLASS1808   bool Verify(flatbuffers::Verifier &verifier) const {
1809     return VerifyTableStart(verifier) &&
1810            VerifyOffset(verifier, VT_LOCALES) &&
1811            verifier.VerifyVector(locales()) &&
1812            verifier.VerifyVectorOfStrings(locales()) &&
1813            VerifyOffset(verifier, VT_PATTERNS) &&
1814            verifier.VerifyVector(patterns()) &&
1815            verifier.VerifyVectorOfTables(patterns()) &&
1816            VerifyOffset(verifier, VT_EXTRACTORS) &&
1817            verifier.VerifyVector(extractors()) &&
1818            verifier.VerifyVectorOfTables(extractors()) &&
1819            VerifyField<uint8_t>(verifier, VT_USE_EXTRACTORS_FOR_LOCATING, 1) &&
1820            VerifyOffset(verifier, VT_DEFAULT_LOCALES) &&
1821            verifier.VerifyVector(default_locales()) &&
1822            VerifyField<uint8_t>(verifier, VT_GENERATE_ALTERNATIVE_INTERPRETATIONS_WHEN_AMBIGUOUS, 1) &&
1823            VerifyField<uint8_t>(verifier, VT_LAZY_REGEX_COMPILATION, 1) &&
1824            VerifyField<uint8_t>(verifier, VT_PREFER_FUTURE_FOR_UNSPECIFIED_DATE, 1) &&
1825            verifier.EndTable();
1826   }
1827   DatetimeModelT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const;
1828   void UnPackTo(DatetimeModelT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const;
1829   static flatbuffers::Offset<DatetimeModel> Pack(flatbuffers::FlatBufferBuilder &_fbb, const DatetimeModelT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
1830 };
1831 
1832 struct DatetimeModelBuilder {
1833   typedef DatetimeModel Table;
1834   flatbuffers::FlatBufferBuilder &fbb_;
1835   flatbuffers::uoffset_t start_;
add_localesDatetimeModelBuilder1836   void add_locales(flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>>> locales) {
1837     fbb_.AddOffset(DatetimeModel::VT_LOCALES, locales);
1838   }
add_patternsDatetimeModelBuilder1839   void add_patterns(flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<libtextclassifier3::DatetimeModelPattern>>> patterns) {
1840     fbb_.AddOffset(DatetimeModel::VT_PATTERNS, patterns);
1841   }
add_extractorsDatetimeModelBuilder1842   void add_extractors(flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<libtextclassifier3::DatetimeModelExtractor>>> extractors) {
1843     fbb_.AddOffset(DatetimeModel::VT_EXTRACTORS, extractors);
1844   }
add_use_extractors_for_locatingDatetimeModelBuilder1845   void add_use_extractors_for_locating(bool use_extractors_for_locating) {
1846     fbb_.AddElement<uint8_t>(DatetimeModel::VT_USE_EXTRACTORS_FOR_LOCATING, static_cast<uint8_t>(use_extractors_for_locating), 1);
1847   }
add_default_localesDatetimeModelBuilder1848   void add_default_locales(flatbuffers::Offset<flatbuffers::Vector<int32_t>> default_locales) {
1849     fbb_.AddOffset(DatetimeModel::VT_DEFAULT_LOCALES, default_locales);
1850   }
add_generate_alternative_interpretations_when_ambiguousDatetimeModelBuilder1851   void add_generate_alternative_interpretations_when_ambiguous(bool generate_alternative_interpretations_when_ambiguous) {
1852     fbb_.AddElement<uint8_t>(DatetimeModel::VT_GENERATE_ALTERNATIVE_INTERPRETATIONS_WHEN_AMBIGUOUS, static_cast<uint8_t>(generate_alternative_interpretations_when_ambiguous), 0);
1853   }
add_lazy_regex_compilationDatetimeModelBuilder1854   void add_lazy_regex_compilation(bool lazy_regex_compilation) {
1855     fbb_.AddElement<uint8_t>(DatetimeModel::VT_LAZY_REGEX_COMPILATION, static_cast<uint8_t>(lazy_regex_compilation), 1);
1856   }
add_prefer_future_for_unspecified_dateDatetimeModelBuilder1857   void add_prefer_future_for_unspecified_date(bool prefer_future_for_unspecified_date) {
1858     fbb_.AddElement<uint8_t>(DatetimeModel::VT_PREFER_FUTURE_FOR_UNSPECIFIED_DATE, static_cast<uint8_t>(prefer_future_for_unspecified_date), 0);
1859   }
DatetimeModelBuilderDatetimeModelBuilder1860   explicit DatetimeModelBuilder(flatbuffers::FlatBufferBuilder &_fbb)
1861         : fbb_(_fbb) {
1862     start_ = fbb_.StartTable();
1863   }
FinishDatetimeModelBuilder1864   flatbuffers::Offset<DatetimeModel> Finish() {
1865     const auto end = fbb_.EndTable(start_);
1866     auto o = flatbuffers::Offset<DatetimeModel>(end);
1867     return o;
1868   }
1869 };
1870 
1871 inline flatbuffers::Offset<DatetimeModel> CreateDatetimeModel(
1872     flatbuffers::FlatBufferBuilder &_fbb,
1873     flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>>> locales = 0,
1874     flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<libtextclassifier3::DatetimeModelPattern>>> patterns = 0,
1875     flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<libtextclassifier3::DatetimeModelExtractor>>> extractors = 0,
1876     bool use_extractors_for_locating = true,
1877     flatbuffers::Offset<flatbuffers::Vector<int32_t>> default_locales = 0,
1878     bool generate_alternative_interpretations_when_ambiguous = false,
1879     bool lazy_regex_compilation = true,
1880     bool prefer_future_for_unspecified_date = false) {
1881   DatetimeModelBuilder builder_(_fbb);
1882   builder_.add_default_locales(default_locales);
1883   builder_.add_extractors(extractors);
1884   builder_.add_patterns(patterns);
1885   builder_.add_locales(locales);
1886   builder_.add_prefer_future_for_unspecified_date(prefer_future_for_unspecified_date);
1887   builder_.add_lazy_regex_compilation(lazy_regex_compilation);
1888   builder_.add_generate_alternative_interpretations_when_ambiguous(generate_alternative_interpretations_when_ambiguous);
1889   builder_.add_use_extractors_for_locating(use_extractors_for_locating);
1890   return builder_.Finish();
1891 }
1892 
1893 inline flatbuffers::Offset<DatetimeModel> CreateDatetimeModelDirect(
1894     flatbuffers::FlatBufferBuilder &_fbb,
1895     const std::vector<flatbuffers::Offset<flatbuffers::String>> *locales = nullptr,
1896     const std::vector<flatbuffers::Offset<libtextclassifier3::DatetimeModelPattern>> *patterns = nullptr,
1897     const std::vector<flatbuffers::Offset<libtextclassifier3::DatetimeModelExtractor>> *extractors = nullptr,
1898     bool use_extractors_for_locating = true,
1899     const std::vector<int32_t> *default_locales = nullptr,
1900     bool generate_alternative_interpretations_when_ambiguous = false,
1901     bool lazy_regex_compilation = true,
1902     bool prefer_future_for_unspecified_date = false) {
1903   auto locales__ = locales ? _fbb.CreateVector<flatbuffers::Offset<flatbuffers::String>>(*locales) : 0;
1904   auto patterns__ = patterns ? _fbb.CreateVector<flatbuffers::Offset<libtextclassifier3::DatetimeModelPattern>>(*patterns) : 0;
1905   auto extractors__ = extractors ? _fbb.CreateVector<flatbuffers::Offset<libtextclassifier3::DatetimeModelExtractor>>(*extractors) : 0;
1906   auto default_locales__ = default_locales ? _fbb.CreateVector<int32_t>(*default_locales) : 0;
1907   return libtextclassifier3::CreateDatetimeModel(
1908       _fbb,
1909       locales__,
1910       patterns__,
1911       extractors__,
1912       use_extractors_for_locating,
1913       default_locales__,
1914       generate_alternative_interpretations_when_ambiguous,
1915       lazy_regex_compilation,
1916       prefer_future_for_unspecified_date);
1917 }
1918 
1919 flatbuffers::Offset<DatetimeModel> CreateDatetimeModel(flatbuffers::FlatBufferBuilder &_fbb, const DatetimeModelT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
1920 
1921 struct GrammarTokenizerOptionsT : public flatbuffers::NativeTable {
1922   typedef GrammarTokenizerOptions TableType;
1923   libtextclassifier3::TokenizationType tokenization_type = libtextclassifier3::TokenizationType_ICU;
1924   bool icu_preserve_whitespace_tokens = false;
1925   std::vector<std::unique_ptr<libtextclassifier3::TokenizationCodepointRangeT>> tokenization_codepoint_config{};
1926   std::vector<std::unique_ptr<libtextclassifier3::CodepointRangeT>> internal_tokenizer_codepoint_ranges{};
1927   bool tokenize_on_script_change = false;
1928   GrammarTokenizerOptionsT() = default;
1929   GrammarTokenizerOptionsT(const GrammarTokenizerOptionsT &o);
1930   GrammarTokenizerOptionsT(GrammarTokenizerOptionsT&&) FLATBUFFERS_NOEXCEPT = default;
1931   GrammarTokenizerOptionsT &operator=(GrammarTokenizerOptionsT o) FLATBUFFERS_NOEXCEPT;
1932 };
1933 
1934 struct GrammarTokenizerOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
1935   typedef GrammarTokenizerOptionsT NativeTableType;
1936   typedef GrammarTokenizerOptionsBuilder Builder;
1937   enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
1938     VT_TOKENIZATION_TYPE = 4,
1939     VT_ICU_PRESERVE_WHITESPACE_TOKENS = 6,
1940     VT_TOKENIZATION_CODEPOINT_CONFIG = 8,
1941     VT_INTERNAL_TOKENIZER_CODEPOINT_RANGES = 10,
1942     VT_TOKENIZE_ON_SCRIPT_CHANGE = 12
1943   };
tokenization_typeFLATBUFFERS_FINAL_CLASS1944   libtextclassifier3::TokenizationType tokenization_type() const {
1945     return static_cast<libtextclassifier3::TokenizationType>(GetField<int32_t>(VT_TOKENIZATION_TYPE, 2));
1946   }
icu_preserve_whitespace_tokensFLATBUFFERS_FINAL_CLASS1947   bool icu_preserve_whitespace_tokens() const {
1948     return GetField<uint8_t>(VT_ICU_PRESERVE_WHITESPACE_TOKENS, 0) != 0;
1949   }
tokenization_codepoint_configFLATBUFFERS_FINAL_CLASS1950   const flatbuffers::Vector<flatbuffers::Offset<libtextclassifier3::TokenizationCodepointRange>> *tokenization_codepoint_config() const {
1951     return GetPointer<const flatbuffers::Vector<flatbuffers::Offset<libtextclassifier3::TokenizationCodepointRange>> *>(VT_TOKENIZATION_CODEPOINT_CONFIG);
1952   }
internal_tokenizer_codepoint_rangesFLATBUFFERS_FINAL_CLASS1953   const flatbuffers::Vector<flatbuffers::Offset<libtextclassifier3::CodepointRange>> *internal_tokenizer_codepoint_ranges() const {
1954     return GetPointer<const flatbuffers::Vector<flatbuffers::Offset<libtextclassifier3::CodepointRange>> *>(VT_INTERNAL_TOKENIZER_CODEPOINT_RANGES);
1955   }
tokenize_on_script_changeFLATBUFFERS_FINAL_CLASS1956   bool tokenize_on_script_change() const {
1957     return GetField<uint8_t>(VT_TOKENIZE_ON_SCRIPT_CHANGE, 0) != 0;
1958   }
VerifyFLATBUFFERS_FINAL_CLASS1959   bool Verify(flatbuffers::Verifier &verifier) const {
1960     return VerifyTableStart(verifier) &&
1961            VerifyField<int32_t>(verifier, VT_TOKENIZATION_TYPE, 4) &&
1962            VerifyField<uint8_t>(verifier, VT_ICU_PRESERVE_WHITESPACE_TOKENS, 1) &&
1963            VerifyOffset(verifier, VT_TOKENIZATION_CODEPOINT_CONFIG) &&
1964            verifier.VerifyVector(tokenization_codepoint_config()) &&
1965            verifier.VerifyVectorOfTables(tokenization_codepoint_config()) &&
1966            VerifyOffset(verifier, VT_INTERNAL_TOKENIZER_CODEPOINT_RANGES) &&
1967            verifier.VerifyVector(internal_tokenizer_codepoint_ranges()) &&
1968            verifier.VerifyVectorOfTables(internal_tokenizer_codepoint_ranges()) &&
1969            VerifyField<uint8_t>(verifier, VT_TOKENIZE_ON_SCRIPT_CHANGE, 1) &&
1970            verifier.EndTable();
1971   }
1972   GrammarTokenizerOptionsT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const;
1973   void UnPackTo(GrammarTokenizerOptionsT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const;
1974   static flatbuffers::Offset<GrammarTokenizerOptions> Pack(flatbuffers::FlatBufferBuilder &_fbb, const GrammarTokenizerOptionsT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
1975 };
1976 
1977 struct GrammarTokenizerOptionsBuilder {
1978   typedef GrammarTokenizerOptions Table;
1979   flatbuffers::FlatBufferBuilder &fbb_;
1980   flatbuffers::uoffset_t start_;
add_tokenization_typeGrammarTokenizerOptionsBuilder1981   void add_tokenization_type(libtextclassifier3::TokenizationType tokenization_type) {
1982     fbb_.AddElement<int32_t>(GrammarTokenizerOptions::VT_TOKENIZATION_TYPE, static_cast<int32_t>(tokenization_type), 2);
1983   }
add_icu_preserve_whitespace_tokensGrammarTokenizerOptionsBuilder1984   void add_icu_preserve_whitespace_tokens(bool icu_preserve_whitespace_tokens) {
1985     fbb_.AddElement<uint8_t>(GrammarTokenizerOptions::VT_ICU_PRESERVE_WHITESPACE_TOKENS, static_cast<uint8_t>(icu_preserve_whitespace_tokens), 0);
1986   }
add_tokenization_codepoint_configGrammarTokenizerOptionsBuilder1987   void add_tokenization_codepoint_config(flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<libtextclassifier3::TokenizationCodepointRange>>> tokenization_codepoint_config) {
1988     fbb_.AddOffset(GrammarTokenizerOptions::VT_TOKENIZATION_CODEPOINT_CONFIG, tokenization_codepoint_config);
1989   }
add_internal_tokenizer_codepoint_rangesGrammarTokenizerOptionsBuilder1990   void add_internal_tokenizer_codepoint_ranges(flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<libtextclassifier3::CodepointRange>>> internal_tokenizer_codepoint_ranges) {
1991     fbb_.AddOffset(GrammarTokenizerOptions::VT_INTERNAL_TOKENIZER_CODEPOINT_RANGES, internal_tokenizer_codepoint_ranges);
1992   }
add_tokenize_on_script_changeGrammarTokenizerOptionsBuilder1993   void add_tokenize_on_script_change(bool tokenize_on_script_change) {
1994     fbb_.AddElement<uint8_t>(GrammarTokenizerOptions::VT_TOKENIZE_ON_SCRIPT_CHANGE, static_cast<uint8_t>(tokenize_on_script_change), 0);
1995   }
GrammarTokenizerOptionsBuilderGrammarTokenizerOptionsBuilder1996   explicit GrammarTokenizerOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb)
1997         : fbb_(_fbb) {
1998     start_ = fbb_.StartTable();
1999   }
FinishGrammarTokenizerOptionsBuilder2000   flatbuffers::Offset<GrammarTokenizerOptions> Finish() {
2001     const auto end = fbb_.EndTable(start_);
2002     auto o = flatbuffers::Offset<GrammarTokenizerOptions>(end);
2003     return o;
2004   }
2005 };
2006 
2007 inline flatbuffers::Offset<GrammarTokenizerOptions> CreateGrammarTokenizerOptions(
2008     flatbuffers::FlatBufferBuilder &_fbb,
2009     libtextclassifier3::TokenizationType tokenization_type = libtextclassifier3::TokenizationType_ICU,
2010     bool icu_preserve_whitespace_tokens = false,
2011     flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<libtextclassifier3::TokenizationCodepointRange>>> tokenization_codepoint_config = 0,
2012     flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<libtextclassifier3::CodepointRange>>> internal_tokenizer_codepoint_ranges = 0,
2013     bool tokenize_on_script_change = false) {
2014   GrammarTokenizerOptionsBuilder builder_(_fbb);
2015   builder_.add_internal_tokenizer_codepoint_ranges(internal_tokenizer_codepoint_ranges);
2016   builder_.add_tokenization_codepoint_config(tokenization_codepoint_config);
2017   builder_.add_tokenization_type(tokenization_type);
2018   builder_.add_tokenize_on_script_change(tokenize_on_script_change);
2019   builder_.add_icu_preserve_whitespace_tokens(icu_preserve_whitespace_tokens);
2020   return builder_.Finish();
2021 }
2022 
2023 inline flatbuffers::Offset<GrammarTokenizerOptions> CreateGrammarTokenizerOptionsDirect(
2024     flatbuffers::FlatBufferBuilder &_fbb,
2025     libtextclassifier3::TokenizationType tokenization_type = libtextclassifier3::TokenizationType_ICU,
2026     bool icu_preserve_whitespace_tokens = false,
2027     const std::vector<flatbuffers::Offset<libtextclassifier3::TokenizationCodepointRange>> *tokenization_codepoint_config = nullptr,
2028     const std::vector<flatbuffers::Offset<libtextclassifier3::CodepointRange>> *internal_tokenizer_codepoint_ranges = nullptr,
2029     bool tokenize_on_script_change = false) {
2030   auto tokenization_codepoint_config__ = tokenization_codepoint_config ? _fbb.CreateVector<flatbuffers::Offset<libtextclassifier3::TokenizationCodepointRange>>(*tokenization_codepoint_config) : 0;
2031   auto internal_tokenizer_codepoint_ranges__ = internal_tokenizer_codepoint_ranges ? _fbb.CreateVector<flatbuffers::Offset<libtextclassifier3::CodepointRange>>(*internal_tokenizer_codepoint_ranges) : 0;
2032   return libtextclassifier3::CreateGrammarTokenizerOptions(
2033       _fbb,
2034       tokenization_type,
2035       icu_preserve_whitespace_tokens,
2036       tokenization_codepoint_config__,
2037       internal_tokenizer_codepoint_ranges__,
2038       tokenize_on_script_change);
2039 }
2040 
2041 flatbuffers::Offset<GrammarTokenizerOptions> CreateGrammarTokenizerOptions(flatbuffers::FlatBufferBuilder &_fbb, const GrammarTokenizerOptionsT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
2042 
2043 namespace DatetimeModelLibrary_ {
2044 
2045 struct ItemT : public flatbuffers::NativeTable {
2046   typedef Item TableType;
2047   std::string key{};
2048   std::unique_ptr<libtextclassifier3::DatetimeModelT> value{};
2049   ItemT() = default;
2050   ItemT(const ItemT &o);
2051   ItemT(ItemT&&) FLATBUFFERS_NOEXCEPT = default;
2052   ItemT &operator=(ItemT o) FLATBUFFERS_NOEXCEPT;
2053 };
2054 
2055 struct Item FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
2056   typedef ItemT NativeTableType;
2057   typedef ItemBuilder Builder;
2058   enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
2059     VT_KEY = 4,
2060     VT_VALUE = 6
2061   };
keyFLATBUFFERS_FINAL_CLASS2062   const flatbuffers::String *key() const {
2063     return GetPointer<const flatbuffers::String *>(VT_KEY);
2064   }
valueFLATBUFFERS_FINAL_CLASS2065   const libtextclassifier3::DatetimeModel *value() const {
2066     return GetPointer<const libtextclassifier3::DatetimeModel *>(VT_VALUE);
2067   }
VerifyFLATBUFFERS_FINAL_CLASS2068   bool Verify(flatbuffers::Verifier &verifier) const {
2069     return VerifyTableStart(verifier) &&
2070            VerifyOffset(verifier, VT_KEY) &&
2071            verifier.VerifyString(key()) &&
2072            VerifyOffset(verifier, VT_VALUE) &&
2073            verifier.VerifyTable(value()) &&
2074            verifier.EndTable();
2075   }
2076   ItemT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const;
2077   void UnPackTo(ItemT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const;
2078   static flatbuffers::Offset<Item> Pack(flatbuffers::FlatBufferBuilder &_fbb, const ItemT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
2079 };
2080 
2081 struct ItemBuilder {
2082   typedef Item Table;
2083   flatbuffers::FlatBufferBuilder &fbb_;
2084   flatbuffers::uoffset_t start_;
add_keyItemBuilder2085   void add_key(flatbuffers::Offset<flatbuffers::String> key) {
2086     fbb_.AddOffset(Item::VT_KEY, key);
2087   }
add_valueItemBuilder2088   void add_value(flatbuffers::Offset<libtextclassifier3::DatetimeModel> value) {
2089     fbb_.AddOffset(Item::VT_VALUE, value);
2090   }
ItemBuilderItemBuilder2091   explicit ItemBuilder(flatbuffers::FlatBufferBuilder &_fbb)
2092         : fbb_(_fbb) {
2093     start_ = fbb_.StartTable();
2094   }
FinishItemBuilder2095   flatbuffers::Offset<Item> Finish() {
2096     const auto end = fbb_.EndTable(start_);
2097     auto o = flatbuffers::Offset<Item>(end);
2098     return o;
2099   }
2100 };
2101 
2102 inline flatbuffers::Offset<Item> CreateItem(
2103     flatbuffers::FlatBufferBuilder &_fbb,
2104     flatbuffers::Offset<flatbuffers::String> key = 0,
2105     flatbuffers::Offset<libtextclassifier3::DatetimeModel> value = 0) {
2106   ItemBuilder builder_(_fbb);
2107   builder_.add_value(value);
2108   builder_.add_key(key);
2109   return builder_.Finish();
2110 }
2111 
2112 inline flatbuffers::Offset<Item> CreateItemDirect(
2113     flatbuffers::FlatBufferBuilder &_fbb,
2114     const char *key = nullptr,
2115     flatbuffers::Offset<libtextclassifier3::DatetimeModel> value = 0) {
2116   auto key__ = key ? _fbb.CreateSharedString(key) : 0;
2117   return libtextclassifier3::DatetimeModelLibrary_::CreateItem(
2118       _fbb,
2119       key__,
2120       value);
2121 }
2122 
2123 flatbuffers::Offset<Item> CreateItem(flatbuffers::FlatBufferBuilder &_fbb, const ItemT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
2124 
2125 }  // namespace DatetimeModelLibrary_
2126 
2127 struct DatetimeModelLibraryT : public flatbuffers::NativeTable {
2128   typedef DatetimeModelLibrary TableType;
2129   std::vector<std::unique_ptr<libtextclassifier3::DatetimeModelLibrary_::ItemT>> models{};
2130   DatetimeModelLibraryT() = default;
2131   DatetimeModelLibraryT(const DatetimeModelLibraryT &o);
2132   DatetimeModelLibraryT(DatetimeModelLibraryT&&) FLATBUFFERS_NOEXCEPT = default;
2133   DatetimeModelLibraryT &operator=(DatetimeModelLibraryT o) FLATBUFFERS_NOEXCEPT;
2134 };
2135 
2136 struct DatetimeModelLibrary FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
2137   typedef DatetimeModelLibraryT NativeTableType;
2138   typedef DatetimeModelLibraryBuilder Builder;
2139   enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
2140     VT_MODELS = 4
2141   };
modelsFLATBUFFERS_FINAL_CLASS2142   const flatbuffers::Vector<flatbuffers::Offset<libtextclassifier3::DatetimeModelLibrary_::Item>> *models() const {
2143     return GetPointer<const flatbuffers::Vector<flatbuffers::Offset<libtextclassifier3::DatetimeModelLibrary_::Item>> *>(VT_MODELS);
2144   }
VerifyFLATBUFFERS_FINAL_CLASS2145   bool Verify(flatbuffers::Verifier &verifier) const {
2146     return VerifyTableStart(verifier) &&
2147            VerifyOffset(verifier, VT_MODELS) &&
2148            verifier.VerifyVector(models()) &&
2149            verifier.VerifyVectorOfTables(models()) &&
2150            verifier.EndTable();
2151   }
2152   DatetimeModelLibraryT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const;
2153   void UnPackTo(DatetimeModelLibraryT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const;
2154   static flatbuffers::Offset<DatetimeModelLibrary> Pack(flatbuffers::FlatBufferBuilder &_fbb, const DatetimeModelLibraryT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
2155 };
2156 
2157 struct DatetimeModelLibraryBuilder {
2158   typedef DatetimeModelLibrary Table;
2159   flatbuffers::FlatBufferBuilder &fbb_;
2160   flatbuffers::uoffset_t start_;
add_modelsDatetimeModelLibraryBuilder2161   void add_models(flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<libtextclassifier3::DatetimeModelLibrary_::Item>>> models) {
2162     fbb_.AddOffset(DatetimeModelLibrary::VT_MODELS, models);
2163   }
DatetimeModelLibraryBuilderDatetimeModelLibraryBuilder2164   explicit DatetimeModelLibraryBuilder(flatbuffers::FlatBufferBuilder &_fbb)
2165         : fbb_(_fbb) {
2166     start_ = fbb_.StartTable();
2167   }
FinishDatetimeModelLibraryBuilder2168   flatbuffers::Offset<DatetimeModelLibrary> Finish() {
2169     const auto end = fbb_.EndTable(start_);
2170     auto o = flatbuffers::Offset<DatetimeModelLibrary>(end);
2171     return o;
2172   }
2173 };
2174 
2175 inline flatbuffers::Offset<DatetimeModelLibrary> CreateDatetimeModelLibrary(
2176     flatbuffers::FlatBufferBuilder &_fbb,
2177     flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<libtextclassifier3::DatetimeModelLibrary_::Item>>> models = 0) {
2178   DatetimeModelLibraryBuilder builder_(_fbb);
2179   builder_.add_models(models);
2180   return builder_.Finish();
2181 }
2182 
2183 inline flatbuffers::Offset<DatetimeModelLibrary> CreateDatetimeModelLibraryDirect(
2184     flatbuffers::FlatBufferBuilder &_fbb,
2185     const std::vector<flatbuffers::Offset<libtextclassifier3::DatetimeModelLibrary_::Item>> *models = nullptr) {
2186   auto models__ = models ? _fbb.CreateVector<flatbuffers::Offset<libtextclassifier3::DatetimeModelLibrary_::Item>>(*models) : 0;
2187   return libtextclassifier3::CreateDatetimeModelLibrary(
2188       _fbb,
2189       models__);
2190 }
2191 
2192 flatbuffers::Offset<DatetimeModelLibrary> CreateDatetimeModelLibrary(flatbuffers::FlatBufferBuilder &_fbb, const DatetimeModelLibraryT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
2193 
2194 namespace GrammarModel_ {
2195 
2196 struct RuleClassificationResultT : public flatbuffers::NativeTable {
2197   typedef RuleClassificationResult TableType;
2198   std::string collection_name{};
2199   float target_classification_score = 1.0f;
2200   float priority_score = 0.0f;
2201   std::vector<std::unique_ptr<libtextclassifier3::CapturingGroupT>> capturing_group{};
2202   std::string serialized_entity_data{};
2203   libtextclassifier3::ModeFlag enabled_modes = libtextclassifier3::ModeFlag_ALL;
2204   std::unique_ptr<libtextclassifier3::EntityDataT> entity_data{};
2205   RuleClassificationResultT() = default;
2206   RuleClassificationResultT(const RuleClassificationResultT &o);
2207   RuleClassificationResultT(RuleClassificationResultT&&) FLATBUFFERS_NOEXCEPT = default;
2208   RuleClassificationResultT &operator=(RuleClassificationResultT o) FLATBUFFERS_NOEXCEPT;
2209 };
2210 
2211 struct RuleClassificationResult FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
2212   typedef RuleClassificationResultT NativeTableType;
2213   typedef RuleClassificationResultBuilder Builder;
2214   enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
2215     VT_COLLECTION_NAME = 4,
2216     VT_TARGET_CLASSIFICATION_SCORE = 6,
2217     VT_PRIORITY_SCORE = 8,
2218     VT_CAPTURING_GROUP = 10,
2219     VT_SERIALIZED_ENTITY_DATA = 12,
2220     VT_ENABLED_MODES = 14,
2221     VT_ENTITY_DATA = 16
2222   };
collection_nameFLATBUFFERS_FINAL_CLASS2223   const flatbuffers::String *collection_name() const {
2224     return GetPointer<const flatbuffers::String *>(VT_COLLECTION_NAME);
2225   }
target_classification_scoreFLATBUFFERS_FINAL_CLASS2226   float target_classification_score() const {
2227     return GetField<float>(VT_TARGET_CLASSIFICATION_SCORE, 1.0f);
2228   }
priority_scoreFLATBUFFERS_FINAL_CLASS2229   float priority_score() const {
2230     return GetField<float>(VT_PRIORITY_SCORE, 0.0f);
2231   }
capturing_groupFLATBUFFERS_FINAL_CLASS2232   const flatbuffers::Vector<flatbuffers::Offset<libtextclassifier3::CapturingGroup>> *capturing_group() const {
2233     return GetPointer<const flatbuffers::Vector<flatbuffers::Offset<libtextclassifier3::CapturingGroup>> *>(VT_CAPTURING_GROUP);
2234   }
serialized_entity_dataFLATBUFFERS_FINAL_CLASS2235   const flatbuffers::String *serialized_entity_data() const {
2236     return GetPointer<const flatbuffers::String *>(VT_SERIALIZED_ENTITY_DATA);
2237   }
enabled_modesFLATBUFFERS_FINAL_CLASS2238   libtextclassifier3::ModeFlag enabled_modes() const {
2239     return static_cast<libtextclassifier3::ModeFlag>(GetField<int32_t>(VT_ENABLED_MODES, 7));
2240   }
entity_dataFLATBUFFERS_FINAL_CLASS2241   const libtextclassifier3::EntityData *entity_data() const {
2242     return GetPointer<const libtextclassifier3::EntityData *>(VT_ENTITY_DATA);
2243   }
VerifyFLATBUFFERS_FINAL_CLASS2244   bool Verify(flatbuffers::Verifier &verifier) const {
2245     return VerifyTableStart(verifier) &&
2246            VerifyOffset(verifier, VT_COLLECTION_NAME) &&
2247            verifier.VerifyString(collection_name()) &&
2248            VerifyField<float>(verifier, VT_TARGET_CLASSIFICATION_SCORE, 4) &&
2249            VerifyField<float>(verifier, VT_PRIORITY_SCORE, 4) &&
2250            VerifyOffset(verifier, VT_CAPTURING_GROUP) &&
2251            verifier.VerifyVector(capturing_group()) &&
2252            verifier.VerifyVectorOfTables(capturing_group()) &&
2253            VerifyOffset(verifier, VT_SERIALIZED_ENTITY_DATA) &&
2254            verifier.VerifyString(serialized_entity_data()) &&
2255            VerifyField<int32_t>(verifier, VT_ENABLED_MODES, 4) &&
2256            VerifyOffset(verifier, VT_ENTITY_DATA) &&
2257            verifier.VerifyTable(entity_data()) &&
2258            verifier.EndTable();
2259   }
2260   RuleClassificationResultT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const;
2261   void UnPackTo(RuleClassificationResultT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const;
2262   static flatbuffers::Offset<RuleClassificationResult> Pack(flatbuffers::FlatBufferBuilder &_fbb, const RuleClassificationResultT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
2263 };
2264 
2265 struct RuleClassificationResultBuilder {
2266   typedef RuleClassificationResult Table;
2267   flatbuffers::FlatBufferBuilder &fbb_;
2268   flatbuffers::uoffset_t start_;
add_collection_nameRuleClassificationResultBuilder2269   void add_collection_name(flatbuffers::Offset<flatbuffers::String> collection_name) {
2270     fbb_.AddOffset(RuleClassificationResult::VT_COLLECTION_NAME, collection_name);
2271   }
add_target_classification_scoreRuleClassificationResultBuilder2272   void add_target_classification_score(float target_classification_score) {
2273     fbb_.AddElement<float>(RuleClassificationResult::VT_TARGET_CLASSIFICATION_SCORE, target_classification_score, 1.0f);
2274   }
add_priority_scoreRuleClassificationResultBuilder2275   void add_priority_score(float priority_score) {
2276     fbb_.AddElement<float>(RuleClassificationResult::VT_PRIORITY_SCORE, priority_score, 0.0f);
2277   }
add_capturing_groupRuleClassificationResultBuilder2278   void add_capturing_group(flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<libtextclassifier3::CapturingGroup>>> capturing_group) {
2279     fbb_.AddOffset(RuleClassificationResult::VT_CAPTURING_GROUP, capturing_group);
2280   }
add_serialized_entity_dataRuleClassificationResultBuilder2281   void add_serialized_entity_data(flatbuffers::Offset<flatbuffers::String> serialized_entity_data) {
2282     fbb_.AddOffset(RuleClassificationResult::VT_SERIALIZED_ENTITY_DATA, serialized_entity_data);
2283   }
add_enabled_modesRuleClassificationResultBuilder2284   void add_enabled_modes(libtextclassifier3::ModeFlag enabled_modes) {
2285     fbb_.AddElement<int32_t>(RuleClassificationResult::VT_ENABLED_MODES, static_cast<int32_t>(enabled_modes), 7);
2286   }
add_entity_dataRuleClassificationResultBuilder2287   void add_entity_data(flatbuffers::Offset<libtextclassifier3::EntityData> entity_data) {
2288     fbb_.AddOffset(RuleClassificationResult::VT_ENTITY_DATA, entity_data);
2289   }
RuleClassificationResultBuilderRuleClassificationResultBuilder2290   explicit RuleClassificationResultBuilder(flatbuffers::FlatBufferBuilder &_fbb)
2291         : fbb_(_fbb) {
2292     start_ = fbb_.StartTable();
2293   }
FinishRuleClassificationResultBuilder2294   flatbuffers::Offset<RuleClassificationResult> Finish() {
2295     const auto end = fbb_.EndTable(start_);
2296     auto o = flatbuffers::Offset<RuleClassificationResult>(end);
2297     return o;
2298   }
2299 };
2300 
2301 inline flatbuffers::Offset<RuleClassificationResult> CreateRuleClassificationResult(
2302     flatbuffers::FlatBufferBuilder &_fbb,
2303     flatbuffers::Offset<flatbuffers::String> collection_name = 0,
2304     float target_classification_score = 1.0f,
2305     float priority_score = 0.0f,
2306     flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<libtextclassifier3::CapturingGroup>>> capturing_group = 0,
2307     flatbuffers::Offset<flatbuffers::String> serialized_entity_data = 0,
2308     libtextclassifier3::ModeFlag enabled_modes = libtextclassifier3::ModeFlag_ALL,
2309     flatbuffers::Offset<libtextclassifier3::EntityData> entity_data = 0) {
2310   RuleClassificationResultBuilder builder_(_fbb);
2311   builder_.add_entity_data(entity_data);
2312   builder_.add_enabled_modes(enabled_modes);
2313   builder_.add_serialized_entity_data(serialized_entity_data);
2314   builder_.add_capturing_group(capturing_group);
2315   builder_.add_priority_score(priority_score);
2316   builder_.add_target_classification_score(target_classification_score);
2317   builder_.add_collection_name(collection_name);
2318   return builder_.Finish();
2319 }
2320 
2321 inline flatbuffers::Offset<RuleClassificationResult> CreateRuleClassificationResultDirect(
2322     flatbuffers::FlatBufferBuilder &_fbb,
2323     const char *collection_name = nullptr,
2324     float target_classification_score = 1.0f,
2325     float priority_score = 0.0f,
2326     const std::vector<flatbuffers::Offset<libtextclassifier3::CapturingGroup>> *capturing_group = nullptr,
2327     const char *serialized_entity_data = nullptr,
2328     libtextclassifier3::ModeFlag enabled_modes = libtextclassifier3::ModeFlag_ALL,
2329     flatbuffers::Offset<libtextclassifier3::EntityData> entity_data = 0) {
2330   auto collection_name__ = collection_name ? _fbb.CreateSharedString(collection_name) : 0;
2331   auto capturing_group__ = capturing_group ? _fbb.CreateVector<flatbuffers::Offset<libtextclassifier3::CapturingGroup>>(*capturing_group) : 0;
2332   auto serialized_entity_data__ = serialized_entity_data ? _fbb.CreateSharedString(serialized_entity_data) : 0;
2333   return libtextclassifier3::GrammarModel_::CreateRuleClassificationResult(
2334       _fbb,
2335       collection_name__,
2336       target_classification_score,
2337       priority_score,
2338       capturing_group__,
2339       serialized_entity_data__,
2340       enabled_modes,
2341       entity_data);
2342 }
2343 
2344 flatbuffers::Offset<RuleClassificationResult> CreateRuleClassificationResult(flatbuffers::FlatBufferBuilder &_fbb, const RuleClassificationResultT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
2345 
2346 }  // namespace GrammarModel_
2347 
2348 struct GrammarModelT : public flatbuffers::NativeTable {
2349   typedef GrammarModel TableType;
2350   std::unique_ptr<libtextclassifier3::grammar::RulesSetT> rules{};
2351   std::vector<std::unique_ptr<libtextclassifier3::GrammarModel_::RuleClassificationResultT>> rule_classification_result{};
2352   int32_t context_left_num_tokens = 0;
2353   int32_t context_right_num_tokens = 0;
2354   std::unique_ptr<libtextclassifier3::GrammarTokenizerOptionsT> tokenizer_options{};
2355   float target_classification_score = 1.0f;
2356   float priority_score = 1.0f;
2357   libtextclassifier3::ModeFlag enabled_modes = libtextclassifier3::ModeFlag_ALL;
2358   GrammarModelT() = default;
2359   GrammarModelT(const GrammarModelT &o);
2360   GrammarModelT(GrammarModelT&&) FLATBUFFERS_NOEXCEPT = default;
2361   GrammarModelT &operator=(GrammarModelT o) FLATBUFFERS_NOEXCEPT;
2362 };
2363 
2364 struct GrammarModel FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
2365   typedef GrammarModelT NativeTableType;
2366   typedef GrammarModelBuilder Builder;
2367   enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
2368     VT_RULES = 4,
2369     VT_RULE_CLASSIFICATION_RESULT = 6,
2370     VT_CONTEXT_LEFT_NUM_TOKENS = 8,
2371     VT_CONTEXT_RIGHT_NUM_TOKENS = 10,
2372     VT_TOKENIZER_OPTIONS = 12,
2373     VT_TARGET_CLASSIFICATION_SCORE = 14,
2374     VT_PRIORITY_SCORE = 16,
2375     VT_ENABLED_MODES = 18
2376   };
rulesFLATBUFFERS_FINAL_CLASS2377   const libtextclassifier3::grammar::RulesSet *rules() const {
2378     return GetPointer<const libtextclassifier3::grammar::RulesSet *>(VT_RULES);
2379   }
rule_classification_resultFLATBUFFERS_FINAL_CLASS2380   const flatbuffers::Vector<flatbuffers::Offset<libtextclassifier3::GrammarModel_::RuleClassificationResult>> *rule_classification_result() const {
2381     return GetPointer<const flatbuffers::Vector<flatbuffers::Offset<libtextclassifier3::GrammarModel_::RuleClassificationResult>> *>(VT_RULE_CLASSIFICATION_RESULT);
2382   }
context_left_num_tokensFLATBUFFERS_FINAL_CLASS2383   int32_t context_left_num_tokens() const {
2384     return GetField<int32_t>(VT_CONTEXT_LEFT_NUM_TOKENS, 0);
2385   }
context_right_num_tokensFLATBUFFERS_FINAL_CLASS2386   int32_t context_right_num_tokens() const {
2387     return GetField<int32_t>(VT_CONTEXT_RIGHT_NUM_TOKENS, 0);
2388   }
tokenizer_optionsFLATBUFFERS_FINAL_CLASS2389   const libtextclassifier3::GrammarTokenizerOptions *tokenizer_options() const {
2390     return GetPointer<const libtextclassifier3::GrammarTokenizerOptions *>(VT_TOKENIZER_OPTIONS);
2391   }
target_classification_scoreFLATBUFFERS_FINAL_CLASS2392   float target_classification_score() const {
2393     return GetField<float>(VT_TARGET_CLASSIFICATION_SCORE, 1.0f);
2394   }
priority_scoreFLATBUFFERS_FINAL_CLASS2395   float priority_score() const {
2396     return GetField<float>(VT_PRIORITY_SCORE, 1.0f);
2397   }
enabled_modesFLATBUFFERS_FINAL_CLASS2398   libtextclassifier3::ModeFlag enabled_modes() const {
2399     return static_cast<libtextclassifier3::ModeFlag>(GetField<int32_t>(VT_ENABLED_MODES, 7));
2400   }
VerifyFLATBUFFERS_FINAL_CLASS2401   bool Verify(flatbuffers::Verifier &verifier) const {
2402     return VerifyTableStart(verifier) &&
2403            VerifyOffset(verifier, VT_RULES) &&
2404            verifier.VerifyTable(rules()) &&
2405            VerifyOffset(verifier, VT_RULE_CLASSIFICATION_RESULT) &&
2406            verifier.VerifyVector(rule_classification_result()) &&
2407            verifier.VerifyVectorOfTables(rule_classification_result()) &&
2408            VerifyField<int32_t>(verifier, VT_CONTEXT_LEFT_NUM_TOKENS, 4) &&
2409            VerifyField<int32_t>(verifier, VT_CONTEXT_RIGHT_NUM_TOKENS, 4) &&
2410            VerifyOffset(verifier, VT_TOKENIZER_OPTIONS) &&
2411            verifier.VerifyTable(tokenizer_options()) &&
2412            VerifyField<float>(verifier, VT_TARGET_CLASSIFICATION_SCORE, 4) &&
2413            VerifyField<float>(verifier, VT_PRIORITY_SCORE, 4) &&
2414            VerifyField<int32_t>(verifier, VT_ENABLED_MODES, 4) &&
2415            verifier.EndTable();
2416   }
2417   GrammarModelT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const;
2418   void UnPackTo(GrammarModelT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const;
2419   static flatbuffers::Offset<GrammarModel> Pack(flatbuffers::FlatBufferBuilder &_fbb, const GrammarModelT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
2420 };
2421 
2422 struct GrammarModelBuilder {
2423   typedef GrammarModel Table;
2424   flatbuffers::FlatBufferBuilder &fbb_;
2425   flatbuffers::uoffset_t start_;
add_rulesGrammarModelBuilder2426   void add_rules(flatbuffers::Offset<libtextclassifier3::grammar::RulesSet> rules) {
2427     fbb_.AddOffset(GrammarModel::VT_RULES, rules);
2428   }
add_rule_classification_resultGrammarModelBuilder2429   void add_rule_classification_result(flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<libtextclassifier3::GrammarModel_::RuleClassificationResult>>> rule_classification_result) {
2430     fbb_.AddOffset(GrammarModel::VT_RULE_CLASSIFICATION_RESULT, rule_classification_result);
2431   }
add_context_left_num_tokensGrammarModelBuilder2432   void add_context_left_num_tokens(int32_t context_left_num_tokens) {
2433     fbb_.AddElement<int32_t>(GrammarModel::VT_CONTEXT_LEFT_NUM_TOKENS, context_left_num_tokens, 0);
2434   }
add_context_right_num_tokensGrammarModelBuilder2435   void add_context_right_num_tokens(int32_t context_right_num_tokens) {
2436     fbb_.AddElement<int32_t>(GrammarModel::VT_CONTEXT_RIGHT_NUM_TOKENS, context_right_num_tokens, 0);
2437   }
add_tokenizer_optionsGrammarModelBuilder2438   void add_tokenizer_options(flatbuffers::Offset<libtextclassifier3::GrammarTokenizerOptions> tokenizer_options) {
2439     fbb_.AddOffset(GrammarModel::VT_TOKENIZER_OPTIONS, tokenizer_options);
2440   }
add_target_classification_scoreGrammarModelBuilder2441   void add_target_classification_score(float target_classification_score) {
2442     fbb_.AddElement<float>(GrammarModel::VT_TARGET_CLASSIFICATION_SCORE, target_classification_score, 1.0f);
2443   }
add_priority_scoreGrammarModelBuilder2444   void add_priority_score(float priority_score) {
2445     fbb_.AddElement<float>(GrammarModel::VT_PRIORITY_SCORE, priority_score, 1.0f);
2446   }
add_enabled_modesGrammarModelBuilder2447   void add_enabled_modes(libtextclassifier3::ModeFlag enabled_modes) {
2448     fbb_.AddElement<int32_t>(GrammarModel::VT_ENABLED_MODES, static_cast<int32_t>(enabled_modes), 7);
2449   }
GrammarModelBuilderGrammarModelBuilder2450   explicit GrammarModelBuilder(flatbuffers::FlatBufferBuilder &_fbb)
2451         : fbb_(_fbb) {
2452     start_ = fbb_.StartTable();
2453   }
FinishGrammarModelBuilder2454   flatbuffers::Offset<GrammarModel> Finish() {
2455     const auto end = fbb_.EndTable(start_);
2456     auto o = flatbuffers::Offset<GrammarModel>(end);
2457     return o;
2458   }
2459 };
2460 
2461 inline flatbuffers::Offset<GrammarModel> CreateGrammarModel(
2462     flatbuffers::FlatBufferBuilder &_fbb,
2463     flatbuffers::Offset<libtextclassifier3::grammar::RulesSet> rules = 0,
2464     flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<libtextclassifier3::GrammarModel_::RuleClassificationResult>>> rule_classification_result = 0,
2465     int32_t context_left_num_tokens = 0,
2466     int32_t context_right_num_tokens = 0,
2467     flatbuffers::Offset<libtextclassifier3::GrammarTokenizerOptions> tokenizer_options = 0,
2468     float target_classification_score = 1.0f,
2469     float priority_score = 1.0f,
2470     libtextclassifier3::ModeFlag enabled_modes = libtextclassifier3::ModeFlag_ALL) {
2471   GrammarModelBuilder builder_(_fbb);
2472   builder_.add_enabled_modes(enabled_modes);
2473   builder_.add_priority_score(priority_score);
2474   builder_.add_target_classification_score(target_classification_score);
2475   builder_.add_tokenizer_options(tokenizer_options);
2476   builder_.add_context_right_num_tokens(context_right_num_tokens);
2477   builder_.add_context_left_num_tokens(context_left_num_tokens);
2478   builder_.add_rule_classification_result(rule_classification_result);
2479   builder_.add_rules(rules);
2480   return builder_.Finish();
2481 }
2482 
2483 inline flatbuffers::Offset<GrammarModel> CreateGrammarModelDirect(
2484     flatbuffers::FlatBufferBuilder &_fbb,
2485     flatbuffers::Offset<libtextclassifier3::grammar::RulesSet> rules = 0,
2486     const std::vector<flatbuffers::Offset<libtextclassifier3::GrammarModel_::RuleClassificationResult>> *rule_classification_result = nullptr,
2487     int32_t context_left_num_tokens = 0,
2488     int32_t context_right_num_tokens = 0,
2489     flatbuffers::Offset<libtextclassifier3::GrammarTokenizerOptions> tokenizer_options = 0,
2490     float target_classification_score = 1.0f,
2491     float priority_score = 1.0f,
2492     libtextclassifier3::ModeFlag enabled_modes = libtextclassifier3::ModeFlag_ALL) {
2493   auto rule_classification_result__ = rule_classification_result ? _fbb.CreateVector<flatbuffers::Offset<libtextclassifier3::GrammarModel_::RuleClassificationResult>>(*rule_classification_result) : 0;
2494   return libtextclassifier3::CreateGrammarModel(
2495       _fbb,
2496       rules,
2497       rule_classification_result__,
2498       context_left_num_tokens,
2499       context_right_num_tokens,
2500       tokenizer_options,
2501       target_classification_score,
2502       priority_score,
2503       enabled_modes);
2504 }
2505 
2506 flatbuffers::Offset<GrammarModel> CreateGrammarModel(flatbuffers::FlatBufferBuilder &_fbb, const GrammarModelT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
2507 
2508 namespace MoneyParsingOptions_ {
2509 
2510 struct QuantitiesNameToExponentEntryT : public flatbuffers::NativeTable {
2511   typedef QuantitiesNameToExponentEntry TableType;
2512   std::string key{};
2513   int32_t value = 0;
2514 };
2515 
2516 struct QuantitiesNameToExponentEntry FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
2517   typedef QuantitiesNameToExponentEntryT NativeTableType;
2518   typedef QuantitiesNameToExponentEntryBuilder Builder;
2519   enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
2520     VT_KEY = 4,
2521     VT_VALUE = 6
2522   };
keyFLATBUFFERS_FINAL_CLASS2523   const flatbuffers::String *key() const {
2524     return GetPointer<const flatbuffers::String *>(VT_KEY);
2525   }
KeyCompareLessThanFLATBUFFERS_FINAL_CLASS2526   bool KeyCompareLessThan(const QuantitiesNameToExponentEntry *o) const {
2527     return *key() < *o->key();
2528   }
KeyCompareWithValueFLATBUFFERS_FINAL_CLASS2529   int KeyCompareWithValue(const char *_key) const {
2530     return strcmp(key()->c_str(), _key);
2531   }
valueFLATBUFFERS_FINAL_CLASS2532   int32_t value() const {
2533     return GetField<int32_t>(VT_VALUE, 0);
2534   }
VerifyFLATBUFFERS_FINAL_CLASS2535   bool Verify(flatbuffers::Verifier &verifier) const {
2536     return VerifyTableStart(verifier) &&
2537            VerifyOffsetRequired(verifier, VT_KEY) &&
2538            verifier.VerifyString(key()) &&
2539            VerifyField<int32_t>(verifier, VT_VALUE, 4) &&
2540            verifier.EndTable();
2541   }
2542   QuantitiesNameToExponentEntryT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const;
2543   void UnPackTo(QuantitiesNameToExponentEntryT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const;
2544   static flatbuffers::Offset<QuantitiesNameToExponentEntry> Pack(flatbuffers::FlatBufferBuilder &_fbb, const QuantitiesNameToExponentEntryT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
2545 };
2546 
2547 struct QuantitiesNameToExponentEntryBuilder {
2548   typedef QuantitiesNameToExponentEntry Table;
2549   flatbuffers::FlatBufferBuilder &fbb_;
2550   flatbuffers::uoffset_t start_;
add_keyQuantitiesNameToExponentEntryBuilder2551   void add_key(flatbuffers::Offset<flatbuffers::String> key) {
2552     fbb_.AddOffset(QuantitiesNameToExponentEntry::VT_KEY, key);
2553   }
add_valueQuantitiesNameToExponentEntryBuilder2554   void add_value(int32_t value) {
2555     fbb_.AddElement<int32_t>(QuantitiesNameToExponentEntry::VT_VALUE, value, 0);
2556   }
QuantitiesNameToExponentEntryBuilderQuantitiesNameToExponentEntryBuilder2557   explicit QuantitiesNameToExponentEntryBuilder(flatbuffers::FlatBufferBuilder &_fbb)
2558         : fbb_(_fbb) {
2559     start_ = fbb_.StartTable();
2560   }
FinishQuantitiesNameToExponentEntryBuilder2561   flatbuffers::Offset<QuantitiesNameToExponentEntry> Finish() {
2562     const auto end = fbb_.EndTable(start_);
2563     auto o = flatbuffers::Offset<QuantitiesNameToExponentEntry>(end);
2564     fbb_.Required(o, QuantitiesNameToExponentEntry::VT_KEY);
2565     return o;
2566   }
2567 };
2568 
2569 inline flatbuffers::Offset<QuantitiesNameToExponentEntry> CreateQuantitiesNameToExponentEntry(
2570     flatbuffers::FlatBufferBuilder &_fbb,
2571     flatbuffers::Offset<flatbuffers::String> key = 0,
2572     int32_t value = 0) {
2573   QuantitiesNameToExponentEntryBuilder builder_(_fbb);
2574   builder_.add_value(value);
2575   builder_.add_key(key);
2576   return builder_.Finish();
2577 }
2578 
2579 inline flatbuffers::Offset<QuantitiesNameToExponentEntry> CreateQuantitiesNameToExponentEntryDirect(
2580     flatbuffers::FlatBufferBuilder &_fbb,
2581     const char *key = nullptr,
2582     int32_t value = 0) {
2583   auto key__ = key ? _fbb.CreateSharedString(key) : 0;
2584   return libtextclassifier3::MoneyParsingOptions_::CreateQuantitiesNameToExponentEntry(
2585       _fbb,
2586       key__,
2587       value);
2588 }
2589 
2590 flatbuffers::Offset<QuantitiesNameToExponentEntry> CreateQuantitiesNameToExponentEntry(flatbuffers::FlatBufferBuilder &_fbb, const QuantitiesNameToExponentEntryT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
2591 
2592 }  // namespace MoneyParsingOptions_
2593 
2594 struct MoneyParsingOptionsT : public flatbuffers::NativeTable {
2595   typedef MoneyParsingOptions TableType;
2596   std::vector<int32_t> separators{};
2597   std::vector<std::unique_ptr<libtextclassifier3::MoneyParsingOptions_::QuantitiesNameToExponentEntryT>> quantities_name_to_exponent{};
2598   MoneyParsingOptionsT() = default;
2599   MoneyParsingOptionsT(const MoneyParsingOptionsT &o);
2600   MoneyParsingOptionsT(MoneyParsingOptionsT&&) FLATBUFFERS_NOEXCEPT = default;
2601   MoneyParsingOptionsT &operator=(MoneyParsingOptionsT o) FLATBUFFERS_NOEXCEPT;
2602 };
2603 
2604 struct MoneyParsingOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
2605   typedef MoneyParsingOptionsT NativeTableType;
2606   typedef MoneyParsingOptionsBuilder Builder;
2607   enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
2608     VT_SEPARATORS = 4,
2609     VT_QUANTITIES_NAME_TO_EXPONENT = 6
2610   };
separatorsFLATBUFFERS_FINAL_CLASS2611   const flatbuffers::Vector<int32_t> *separators() const {
2612     return GetPointer<const flatbuffers::Vector<int32_t> *>(VT_SEPARATORS);
2613   }
quantities_name_to_exponentFLATBUFFERS_FINAL_CLASS2614   const flatbuffers::Vector<flatbuffers::Offset<libtextclassifier3::MoneyParsingOptions_::QuantitiesNameToExponentEntry>> *quantities_name_to_exponent() const {
2615     return GetPointer<const flatbuffers::Vector<flatbuffers::Offset<libtextclassifier3::MoneyParsingOptions_::QuantitiesNameToExponentEntry>> *>(VT_QUANTITIES_NAME_TO_EXPONENT);
2616   }
VerifyFLATBUFFERS_FINAL_CLASS2617   bool Verify(flatbuffers::Verifier &verifier) const {
2618     return VerifyTableStart(verifier) &&
2619            VerifyOffset(verifier, VT_SEPARATORS) &&
2620            verifier.VerifyVector(separators()) &&
2621            VerifyOffset(verifier, VT_QUANTITIES_NAME_TO_EXPONENT) &&
2622            verifier.VerifyVector(quantities_name_to_exponent()) &&
2623            verifier.VerifyVectorOfTables(quantities_name_to_exponent()) &&
2624            verifier.EndTable();
2625   }
2626   MoneyParsingOptionsT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const;
2627   void UnPackTo(MoneyParsingOptionsT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const;
2628   static flatbuffers::Offset<MoneyParsingOptions> Pack(flatbuffers::FlatBufferBuilder &_fbb, const MoneyParsingOptionsT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
2629 };
2630 
2631 struct MoneyParsingOptionsBuilder {
2632   typedef MoneyParsingOptions Table;
2633   flatbuffers::FlatBufferBuilder &fbb_;
2634   flatbuffers::uoffset_t start_;
add_separatorsMoneyParsingOptionsBuilder2635   void add_separators(flatbuffers::Offset<flatbuffers::Vector<int32_t>> separators) {
2636     fbb_.AddOffset(MoneyParsingOptions::VT_SEPARATORS, separators);
2637   }
add_quantities_name_to_exponentMoneyParsingOptionsBuilder2638   void add_quantities_name_to_exponent(flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<libtextclassifier3::MoneyParsingOptions_::QuantitiesNameToExponentEntry>>> quantities_name_to_exponent) {
2639     fbb_.AddOffset(MoneyParsingOptions::VT_QUANTITIES_NAME_TO_EXPONENT, quantities_name_to_exponent);
2640   }
MoneyParsingOptionsBuilderMoneyParsingOptionsBuilder2641   explicit MoneyParsingOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb)
2642         : fbb_(_fbb) {
2643     start_ = fbb_.StartTable();
2644   }
FinishMoneyParsingOptionsBuilder2645   flatbuffers::Offset<MoneyParsingOptions> Finish() {
2646     const auto end = fbb_.EndTable(start_);
2647     auto o = flatbuffers::Offset<MoneyParsingOptions>(end);
2648     return o;
2649   }
2650 };
2651 
2652 inline flatbuffers::Offset<MoneyParsingOptions> CreateMoneyParsingOptions(
2653     flatbuffers::FlatBufferBuilder &_fbb,
2654     flatbuffers::Offset<flatbuffers::Vector<int32_t>> separators = 0,
2655     flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<libtextclassifier3::MoneyParsingOptions_::QuantitiesNameToExponentEntry>>> quantities_name_to_exponent = 0) {
2656   MoneyParsingOptionsBuilder builder_(_fbb);
2657   builder_.add_quantities_name_to_exponent(quantities_name_to_exponent);
2658   builder_.add_separators(separators);
2659   return builder_.Finish();
2660 }
2661 
2662 inline flatbuffers::Offset<MoneyParsingOptions> CreateMoneyParsingOptionsDirect(
2663     flatbuffers::FlatBufferBuilder &_fbb,
2664     const std::vector<int32_t> *separators = nullptr,
2665     std::vector<flatbuffers::Offset<libtextclassifier3::MoneyParsingOptions_::QuantitiesNameToExponentEntry>> *quantities_name_to_exponent = nullptr) {
2666   auto separators__ = separators ? _fbb.CreateVector<int32_t>(*separators) : 0;
2667   auto quantities_name_to_exponent__ = quantities_name_to_exponent ? _fbb.CreateVectorOfSortedTables<libtextclassifier3::MoneyParsingOptions_::QuantitiesNameToExponentEntry>(quantities_name_to_exponent) : 0;
2668   return libtextclassifier3::CreateMoneyParsingOptions(
2669       _fbb,
2670       separators__,
2671       quantities_name_to_exponent__);
2672 }
2673 
2674 flatbuffers::Offset<MoneyParsingOptions> CreateMoneyParsingOptions(flatbuffers::FlatBufferBuilder &_fbb, const MoneyParsingOptionsT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
2675 
2676 namespace ModelTriggeringOptions_ {
2677 
2678 struct CollectionToPriorityEntryT : public flatbuffers::NativeTable {
2679   typedef CollectionToPriorityEntry TableType;
2680   std::string key{};
2681   float value = 0.0f;
2682 };
2683 
2684 struct CollectionToPriorityEntry FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
2685   typedef CollectionToPriorityEntryT NativeTableType;
2686   typedef CollectionToPriorityEntryBuilder Builder;
2687   enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
2688     VT_KEY = 4,
2689     VT_VALUE = 6
2690   };
keyFLATBUFFERS_FINAL_CLASS2691   const flatbuffers::String *key() const {
2692     return GetPointer<const flatbuffers::String *>(VT_KEY);
2693   }
KeyCompareLessThanFLATBUFFERS_FINAL_CLASS2694   bool KeyCompareLessThan(const CollectionToPriorityEntry *o) const {
2695     return *key() < *o->key();
2696   }
KeyCompareWithValueFLATBUFFERS_FINAL_CLASS2697   int KeyCompareWithValue(const char *_key) const {
2698     return strcmp(key()->c_str(), _key);
2699   }
valueFLATBUFFERS_FINAL_CLASS2700   float value() const {
2701     return GetField<float>(VT_VALUE, 0.0f);
2702   }
VerifyFLATBUFFERS_FINAL_CLASS2703   bool Verify(flatbuffers::Verifier &verifier) const {
2704     return VerifyTableStart(verifier) &&
2705            VerifyOffsetRequired(verifier, VT_KEY) &&
2706            verifier.VerifyString(key()) &&
2707            VerifyField<float>(verifier, VT_VALUE, 4) &&
2708            verifier.EndTable();
2709   }
2710   CollectionToPriorityEntryT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const;
2711   void UnPackTo(CollectionToPriorityEntryT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const;
2712   static flatbuffers::Offset<CollectionToPriorityEntry> Pack(flatbuffers::FlatBufferBuilder &_fbb, const CollectionToPriorityEntryT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
2713 };
2714 
2715 struct CollectionToPriorityEntryBuilder {
2716   typedef CollectionToPriorityEntry Table;
2717   flatbuffers::FlatBufferBuilder &fbb_;
2718   flatbuffers::uoffset_t start_;
add_keyCollectionToPriorityEntryBuilder2719   void add_key(flatbuffers::Offset<flatbuffers::String> key) {
2720     fbb_.AddOffset(CollectionToPriorityEntry::VT_KEY, key);
2721   }
add_valueCollectionToPriorityEntryBuilder2722   void add_value(float value) {
2723     fbb_.AddElement<float>(CollectionToPriorityEntry::VT_VALUE, value, 0.0f);
2724   }
CollectionToPriorityEntryBuilderCollectionToPriorityEntryBuilder2725   explicit CollectionToPriorityEntryBuilder(flatbuffers::FlatBufferBuilder &_fbb)
2726         : fbb_(_fbb) {
2727     start_ = fbb_.StartTable();
2728   }
FinishCollectionToPriorityEntryBuilder2729   flatbuffers::Offset<CollectionToPriorityEntry> Finish() {
2730     const auto end = fbb_.EndTable(start_);
2731     auto o = flatbuffers::Offset<CollectionToPriorityEntry>(end);
2732     fbb_.Required(o, CollectionToPriorityEntry::VT_KEY);
2733     return o;
2734   }
2735 };
2736 
2737 inline flatbuffers::Offset<CollectionToPriorityEntry> CreateCollectionToPriorityEntry(
2738     flatbuffers::FlatBufferBuilder &_fbb,
2739     flatbuffers::Offset<flatbuffers::String> key = 0,
2740     float value = 0.0f) {
2741   CollectionToPriorityEntryBuilder builder_(_fbb);
2742   builder_.add_value(value);
2743   builder_.add_key(key);
2744   return builder_.Finish();
2745 }
2746 
2747 inline flatbuffers::Offset<CollectionToPriorityEntry> CreateCollectionToPriorityEntryDirect(
2748     flatbuffers::FlatBufferBuilder &_fbb,
2749     const char *key = nullptr,
2750     float value = 0.0f) {
2751   auto key__ = key ? _fbb.CreateSharedString(key) : 0;
2752   return libtextclassifier3::ModelTriggeringOptions_::CreateCollectionToPriorityEntry(
2753       _fbb,
2754       key__,
2755       value);
2756 }
2757 
2758 flatbuffers::Offset<CollectionToPriorityEntry> CreateCollectionToPriorityEntry(flatbuffers::FlatBufferBuilder &_fbb, const CollectionToPriorityEntryT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
2759 
2760 }  // namespace ModelTriggeringOptions_
2761 
2762 struct ModelTriggeringOptionsT : public flatbuffers::NativeTable {
2763   typedef ModelTriggeringOptions TableType;
2764   float min_annotate_confidence = 0.0f;
2765   libtextclassifier3::ModeFlag enabled_modes = libtextclassifier3::ModeFlag_ALL;
2766   std::string dictionary_locales{};
2767   std::string locales{};
2768   float other_collection_priority_score = -1000.0f;
2769   float knowledge_priority_score = 0.0f;
2770   std::vector<std::unique_ptr<libtextclassifier3::ModelTriggeringOptions_::CollectionToPriorityEntryT>> collection_to_priority{};
2771   libtextclassifier3::ModeFlag knowledge_enabled_modes = libtextclassifier3::ModeFlag_ALL;
2772   libtextclassifier3::ModeFlag experimental_enabled_modes = libtextclassifier3::ModeFlag_ALL;
2773   libtextclassifier3::ModeFlag installed_app_enabled_modes = libtextclassifier3::ModeFlag_ALL;
2774   ModelTriggeringOptionsT() = default;
2775   ModelTriggeringOptionsT(const ModelTriggeringOptionsT &o);
2776   ModelTriggeringOptionsT(ModelTriggeringOptionsT&&) FLATBUFFERS_NOEXCEPT = default;
2777   ModelTriggeringOptionsT &operator=(ModelTriggeringOptionsT o) FLATBUFFERS_NOEXCEPT;
2778 };
2779 
2780 struct ModelTriggeringOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
2781   typedef ModelTriggeringOptionsT NativeTableType;
2782   typedef ModelTriggeringOptionsBuilder Builder;
2783   enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
2784     VT_MIN_ANNOTATE_CONFIDENCE = 4,
2785     VT_ENABLED_MODES = 6,
2786     VT_DICTIONARY_LOCALES = 8,
2787     VT_LOCALES = 10,
2788     VT_OTHER_COLLECTION_PRIORITY_SCORE = 12,
2789     VT_KNOWLEDGE_PRIORITY_SCORE = 14,
2790     VT_COLLECTION_TO_PRIORITY = 18,
2791     VT_KNOWLEDGE_ENABLED_MODES = 20,
2792     VT_EXPERIMENTAL_ENABLED_MODES = 22,
2793     VT_INSTALLED_APP_ENABLED_MODES = 24
2794   };
min_annotate_confidenceFLATBUFFERS_FINAL_CLASS2795   float min_annotate_confidence() const {
2796     return GetField<float>(VT_MIN_ANNOTATE_CONFIDENCE, 0.0f);
2797   }
enabled_modesFLATBUFFERS_FINAL_CLASS2798   libtextclassifier3::ModeFlag enabled_modes() const {
2799     return static_cast<libtextclassifier3::ModeFlag>(GetField<int32_t>(VT_ENABLED_MODES, 7));
2800   }
dictionary_localesFLATBUFFERS_FINAL_CLASS2801   const flatbuffers::String *dictionary_locales() const {
2802     return GetPointer<const flatbuffers::String *>(VT_DICTIONARY_LOCALES);
2803   }
localesFLATBUFFERS_FINAL_CLASS2804   const flatbuffers::String *locales() const {
2805     return GetPointer<const flatbuffers::String *>(VT_LOCALES);
2806   }
other_collection_priority_scoreFLATBUFFERS_FINAL_CLASS2807   float other_collection_priority_score() const {
2808     return GetField<float>(VT_OTHER_COLLECTION_PRIORITY_SCORE, -1000.0f);
2809   }
knowledge_priority_scoreFLATBUFFERS_FINAL_CLASS2810   float knowledge_priority_score() const {
2811     return GetField<float>(VT_KNOWLEDGE_PRIORITY_SCORE, 0.0f);
2812   }
collection_to_priorityFLATBUFFERS_FINAL_CLASS2813   const flatbuffers::Vector<flatbuffers::Offset<libtextclassifier3::ModelTriggeringOptions_::CollectionToPriorityEntry>> *collection_to_priority() const {
2814     return GetPointer<const flatbuffers::Vector<flatbuffers::Offset<libtextclassifier3::ModelTriggeringOptions_::CollectionToPriorityEntry>> *>(VT_COLLECTION_TO_PRIORITY);
2815   }
knowledge_enabled_modesFLATBUFFERS_FINAL_CLASS2816   libtextclassifier3::ModeFlag knowledge_enabled_modes() const {
2817     return static_cast<libtextclassifier3::ModeFlag>(GetField<int32_t>(VT_KNOWLEDGE_ENABLED_MODES, 7));
2818   }
experimental_enabled_modesFLATBUFFERS_FINAL_CLASS2819   libtextclassifier3::ModeFlag experimental_enabled_modes() const {
2820     return static_cast<libtextclassifier3::ModeFlag>(GetField<int32_t>(VT_EXPERIMENTAL_ENABLED_MODES, 7));
2821   }
installed_app_enabled_modesFLATBUFFERS_FINAL_CLASS2822   libtextclassifier3::ModeFlag installed_app_enabled_modes() const {
2823     return static_cast<libtextclassifier3::ModeFlag>(GetField<int32_t>(VT_INSTALLED_APP_ENABLED_MODES, 7));
2824   }
VerifyFLATBUFFERS_FINAL_CLASS2825   bool Verify(flatbuffers::Verifier &verifier) const {
2826     return VerifyTableStart(verifier) &&
2827            VerifyField<float>(verifier, VT_MIN_ANNOTATE_CONFIDENCE, 4) &&
2828            VerifyField<int32_t>(verifier, VT_ENABLED_MODES, 4) &&
2829            VerifyOffset(verifier, VT_DICTIONARY_LOCALES) &&
2830            verifier.VerifyString(dictionary_locales()) &&
2831            VerifyOffset(verifier, VT_LOCALES) &&
2832            verifier.VerifyString(locales()) &&
2833            VerifyField<float>(verifier, VT_OTHER_COLLECTION_PRIORITY_SCORE, 4) &&
2834            VerifyField<float>(verifier, VT_KNOWLEDGE_PRIORITY_SCORE, 4) &&
2835            VerifyOffset(verifier, VT_COLLECTION_TO_PRIORITY) &&
2836            verifier.VerifyVector(collection_to_priority()) &&
2837            verifier.VerifyVectorOfTables(collection_to_priority()) &&
2838            VerifyField<int32_t>(verifier, VT_KNOWLEDGE_ENABLED_MODES, 4) &&
2839            VerifyField<int32_t>(verifier, VT_EXPERIMENTAL_ENABLED_MODES, 4) &&
2840            VerifyField<int32_t>(verifier, VT_INSTALLED_APP_ENABLED_MODES, 4) &&
2841            verifier.EndTable();
2842   }
2843   ModelTriggeringOptionsT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const;
2844   void UnPackTo(ModelTriggeringOptionsT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const;
2845   static flatbuffers::Offset<ModelTriggeringOptions> Pack(flatbuffers::FlatBufferBuilder &_fbb, const ModelTriggeringOptionsT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
2846 };
2847 
2848 struct ModelTriggeringOptionsBuilder {
2849   typedef ModelTriggeringOptions Table;
2850   flatbuffers::FlatBufferBuilder &fbb_;
2851   flatbuffers::uoffset_t start_;
add_min_annotate_confidenceModelTriggeringOptionsBuilder2852   void add_min_annotate_confidence(float min_annotate_confidence) {
2853     fbb_.AddElement<float>(ModelTriggeringOptions::VT_MIN_ANNOTATE_CONFIDENCE, min_annotate_confidence, 0.0f);
2854   }
add_enabled_modesModelTriggeringOptionsBuilder2855   void add_enabled_modes(libtextclassifier3::ModeFlag enabled_modes) {
2856     fbb_.AddElement<int32_t>(ModelTriggeringOptions::VT_ENABLED_MODES, static_cast<int32_t>(enabled_modes), 7);
2857   }
add_dictionary_localesModelTriggeringOptionsBuilder2858   void add_dictionary_locales(flatbuffers::Offset<flatbuffers::String> dictionary_locales) {
2859     fbb_.AddOffset(ModelTriggeringOptions::VT_DICTIONARY_LOCALES, dictionary_locales);
2860   }
add_localesModelTriggeringOptionsBuilder2861   void add_locales(flatbuffers::Offset<flatbuffers::String> locales) {
2862     fbb_.AddOffset(ModelTriggeringOptions::VT_LOCALES, locales);
2863   }
add_other_collection_priority_scoreModelTriggeringOptionsBuilder2864   void add_other_collection_priority_score(float other_collection_priority_score) {
2865     fbb_.AddElement<float>(ModelTriggeringOptions::VT_OTHER_COLLECTION_PRIORITY_SCORE, other_collection_priority_score, -1000.0f);
2866   }
add_knowledge_priority_scoreModelTriggeringOptionsBuilder2867   void add_knowledge_priority_score(float knowledge_priority_score) {
2868     fbb_.AddElement<float>(ModelTriggeringOptions::VT_KNOWLEDGE_PRIORITY_SCORE, knowledge_priority_score, 0.0f);
2869   }
add_collection_to_priorityModelTriggeringOptionsBuilder2870   void add_collection_to_priority(flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<libtextclassifier3::ModelTriggeringOptions_::CollectionToPriorityEntry>>> collection_to_priority) {
2871     fbb_.AddOffset(ModelTriggeringOptions::VT_COLLECTION_TO_PRIORITY, collection_to_priority);
2872   }
add_knowledge_enabled_modesModelTriggeringOptionsBuilder2873   void add_knowledge_enabled_modes(libtextclassifier3::ModeFlag knowledge_enabled_modes) {
2874     fbb_.AddElement<int32_t>(ModelTriggeringOptions::VT_KNOWLEDGE_ENABLED_MODES, static_cast<int32_t>(knowledge_enabled_modes), 7);
2875   }
add_experimental_enabled_modesModelTriggeringOptionsBuilder2876   void add_experimental_enabled_modes(libtextclassifier3::ModeFlag experimental_enabled_modes) {
2877     fbb_.AddElement<int32_t>(ModelTriggeringOptions::VT_EXPERIMENTAL_ENABLED_MODES, static_cast<int32_t>(experimental_enabled_modes), 7);
2878   }
add_installed_app_enabled_modesModelTriggeringOptionsBuilder2879   void add_installed_app_enabled_modes(libtextclassifier3::ModeFlag installed_app_enabled_modes) {
2880     fbb_.AddElement<int32_t>(ModelTriggeringOptions::VT_INSTALLED_APP_ENABLED_MODES, static_cast<int32_t>(installed_app_enabled_modes), 7);
2881   }
ModelTriggeringOptionsBuilderModelTriggeringOptionsBuilder2882   explicit ModelTriggeringOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb)
2883         : fbb_(_fbb) {
2884     start_ = fbb_.StartTable();
2885   }
FinishModelTriggeringOptionsBuilder2886   flatbuffers::Offset<ModelTriggeringOptions> Finish() {
2887     const auto end = fbb_.EndTable(start_);
2888     auto o = flatbuffers::Offset<ModelTriggeringOptions>(end);
2889     return o;
2890   }
2891 };
2892 
2893 inline flatbuffers::Offset<ModelTriggeringOptions> CreateModelTriggeringOptions(
2894     flatbuffers::FlatBufferBuilder &_fbb,
2895     float min_annotate_confidence = 0.0f,
2896     libtextclassifier3::ModeFlag enabled_modes = libtextclassifier3::ModeFlag_ALL,
2897     flatbuffers::Offset<flatbuffers::String> dictionary_locales = 0,
2898     flatbuffers::Offset<flatbuffers::String> locales = 0,
2899     float other_collection_priority_score = -1000.0f,
2900     float knowledge_priority_score = 0.0f,
2901     flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<libtextclassifier3::ModelTriggeringOptions_::CollectionToPriorityEntry>>> collection_to_priority = 0,
2902     libtextclassifier3::ModeFlag knowledge_enabled_modes = libtextclassifier3::ModeFlag_ALL,
2903     libtextclassifier3::ModeFlag experimental_enabled_modes = libtextclassifier3::ModeFlag_ALL,
2904     libtextclassifier3::ModeFlag installed_app_enabled_modes = libtextclassifier3::ModeFlag_ALL) {
2905   ModelTriggeringOptionsBuilder builder_(_fbb);
2906   builder_.add_installed_app_enabled_modes(installed_app_enabled_modes);
2907   builder_.add_experimental_enabled_modes(experimental_enabled_modes);
2908   builder_.add_knowledge_enabled_modes(knowledge_enabled_modes);
2909   builder_.add_collection_to_priority(collection_to_priority);
2910   builder_.add_knowledge_priority_score(knowledge_priority_score);
2911   builder_.add_other_collection_priority_score(other_collection_priority_score);
2912   builder_.add_locales(locales);
2913   builder_.add_dictionary_locales(dictionary_locales);
2914   builder_.add_enabled_modes(enabled_modes);
2915   builder_.add_min_annotate_confidence(min_annotate_confidence);
2916   return builder_.Finish();
2917 }
2918 
2919 inline flatbuffers::Offset<ModelTriggeringOptions> CreateModelTriggeringOptionsDirect(
2920     flatbuffers::FlatBufferBuilder &_fbb,
2921     float min_annotate_confidence = 0.0f,
2922     libtextclassifier3::ModeFlag enabled_modes = libtextclassifier3::ModeFlag_ALL,
2923     const char *dictionary_locales = nullptr,
2924     const char *locales = nullptr,
2925     float other_collection_priority_score = -1000.0f,
2926     float knowledge_priority_score = 0.0f,
2927     std::vector<flatbuffers::Offset<libtextclassifier3::ModelTriggeringOptions_::CollectionToPriorityEntry>> *collection_to_priority = nullptr,
2928     libtextclassifier3::ModeFlag knowledge_enabled_modes = libtextclassifier3::ModeFlag_ALL,
2929     libtextclassifier3::ModeFlag experimental_enabled_modes = libtextclassifier3::ModeFlag_ALL,
2930     libtextclassifier3::ModeFlag installed_app_enabled_modes = libtextclassifier3::ModeFlag_ALL) {
2931   auto dictionary_locales__ = dictionary_locales ? _fbb.CreateSharedString(dictionary_locales) : 0;
2932   auto locales__ = locales ? _fbb.CreateSharedString(locales) : 0;
2933   auto collection_to_priority__ = collection_to_priority ? _fbb.CreateVectorOfSortedTables<libtextclassifier3::ModelTriggeringOptions_::CollectionToPriorityEntry>(collection_to_priority) : 0;
2934   return libtextclassifier3::CreateModelTriggeringOptions(
2935       _fbb,
2936       min_annotate_confidence,
2937       enabled_modes,
2938       dictionary_locales__,
2939       locales__,
2940       other_collection_priority_score,
2941       knowledge_priority_score,
2942       collection_to_priority__,
2943       knowledge_enabled_modes,
2944       experimental_enabled_modes,
2945       installed_app_enabled_modes);
2946 }
2947 
2948 flatbuffers::Offset<ModelTriggeringOptions> CreateModelTriggeringOptions(flatbuffers::FlatBufferBuilder &_fbb, const ModelTriggeringOptionsT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
2949 
2950 struct OutputOptionsT : public flatbuffers::NativeTable {
2951   typedef OutputOptions TableType;
2952   std::vector<std::string> filtered_collections_annotation{};
2953   std::vector<std::string> filtered_collections_classification{};
2954   std::vector<std::string> filtered_collections_selection{};
2955 };
2956 
2957 struct OutputOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
2958   typedef OutputOptionsT NativeTableType;
2959   typedef OutputOptionsBuilder Builder;
2960   enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
2961     VT_FILTERED_COLLECTIONS_ANNOTATION = 4,
2962     VT_FILTERED_COLLECTIONS_CLASSIFICATION = 6,
2963     VT_FILTERED_COLLECTIONS_SELECTION = 8
2964   };
filtered_collections_annotationFLATBUFFERS_FINAL_CLASS2965   const flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>> *filtered_collections_annotation() const {
2966     return GetPointer<const flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>> *>(VT_FILTERED_COLLECTIONS_ANNOTATION);
2967   }
filtered_collections_classificationFLATBUFFERS_FINAL_CLASS2968   const flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>> *filtered_collections_classification() const {
2969     return GetPointer<const flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>> *>(VT_FILTERED_COLLECTIONS_CLASSIFICATION);
2970   }
filtered_collections_selectionFLATBUFFERS_FINAL_CLASS2971   const flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>> *filtered_collections_selection() const {
2972     return GetPointer<const flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>> *>(VT_FILTERED_COLLECTIONS_SELECTION);
2973   }
VerifyFLATBUFFERS_FINAL_CLASS2974   bool Verify(flatbuffers::Verifier &verifier) const {
2975     return VerifyTableStart(verifier) &&
2976            VerifyOffset(verifier, VT_FILTERED_COLLECTIONS_ANNOTATION) &&
2977            verifier.VerifyVector(filtered_collections_annotation()) &&
2978            verifier.VerifyVectorOfStrings(filtered_collections_annotation()) &&
2979            VerifyOffset(verifier, VT_FILTERED_COLLECTIONS_CLASSIFICATION) &&
2980            verifier.VerifyVector(filtered_collections_classification()) &&
2981            verifier.VerifyVectorOfStrings(filtered_collections_classification()) &&
2982            VerifyOffset(verifier, VT_FILTERED_COLLECTIONS_SELECTION) &&
2983            verifier.VerifyVector(filtered_collections_selection()) &&
2984            verifier.VerifyVectorOfStrings(filtered_collections_selection()) &&
2985            verifier.EndTable();
2986   }
2987   OutputOptionsT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const;
2988   void UnPackTo(OutputOptionsT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const;
2989   static flatbuffers::Offset<OutputOptions> Pack(flatbuffers::FlatBufferBuilder &_fbb, const OutputOptionsT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
2990 };
2991 
2992 struct OutputOptionsBuilder {
2993   typedef OutputOptions Table;
2994   flatbuffers::FlatBufferBuilder &fbb_;
2995   flatbuffers::uoffset_t start_;
add_filtered_collections_annotationOutputOptionsBuilder2996   void add_filtered_collections_annotation(flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>>> filtered_collections_annotation) {
2997     fbb_.AddOffset(OutputOptions::VT_FILTERED_COLLECTIONS_ANNOTATION, filtered_collections_annotation);
2998   }
add_filtered_collections_classificationOutputOptionsBuilder2999   void add_filtered_collections_classification(flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>>> filtered_collections_classification) {
3000     fbb_.AddOffset(OutputOptions::VT_FILTERED_COLLECTIONS_CLASSIFICATION, filtered_collections_classification);
3001   }
add_filtered_collections_selectionOutputOptionsBuilder3002   void add_filtered_collections_selection(flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>>> filtered_collections_selection) {
3003     fbb_.AddOffset(OutputOptions::VT_FILTERED_COLLECTIONS_SELECTION, filtered_collections_selection);
3004   }
OutputOptionsBuilderOutputOptionsBuilder3005   explicit OutputOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb)
3006         : fbb_(_fbb) {
3007     start_ = fbb_.StartTable();
3008   }
FinishOutputOptionsBuilder3009   flatbuffers::Offset<OutputOptions> Finish() {
3010     const auto end = fbb_.EndTable(start_);
3011     auto o = flatbuffers::Offset<OutputOptions>(end);
3012     return o;
3013   }
3014 };
3015 
3016 inline flatbuffers::Offset<OutputOptions> CreateOutputOptions(
3017     flatbuffers::FlatBufferBuilder &_fbb,
3018     flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>>> filtered_collections_annotation = 0,
3019     flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>>> filtered_collections_classification = 0,
3020     flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>>> filtered_collections_selection = 0) {
3021   OutputOptionsBuilder builder_(_fbb);
3022   builder_.add_filtered_collections_selection(filtered_collections_selection);
3023   builder_.add_filtered_collections_classification(filtered_collections_classification);
3024   builder_.add_filtered_collections_annotation(filtered_collections_annotation);
3025   return builder_.Finish();
3026 }
3027 
3028 inline flatbuffers::Offset<OutputOptions> CreateOutputOptionsDirect(
3029     flatbuffers::FlatBufferBuilder &_fbb,
3030     const std::vector<flatbuffers::Offset<flatbuffers::String>> *filtered_collections_annotation = nullptr,
3031     const std::vector<flatbuffers::Offset<flatbuffers::String>> *filtered_collections_classification = nullptr,
3032     const std::vector<flatbuffers::Offset<flatbuffers::String>> *filtered_collections_selection = nullptr) {
3033   auto filtered_collections_annotation__ = filtered_collections_annotation ? _fbb.CreateVector<flatbuffers::Offset<flatbuffers::String>>(*filtered_collections_annotation) : 0;
3034   auto filtered_collections_classification__ = filtered_collections_classification ? _fbb.CreateVector<flatbuffers::Offset<flatbuffers::String>>(*filtered_collections_classification) : 0;
3035   auto filtered_collections_selection__ = filtered_collections_selection ? _fbb.CreateVector<flatbuffers::Offset<flatbuffers::String>>(*filtered_collections_selection) : 0;
3036   return libtextclassifier3::CreateOutputOptions(
3037       _fbb,
3038       filtered_collections_annotation__,
3039       filtered_collections_classification__,
3040       filtered_collections_selection__);
3041 }
3042 
3043 flatbuffers::Offset<OutputOptions> CreateOutputOptions(flatbuffers::FlatBufferBuilder &_fbb, const OutputOptionsT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
3044 
3045 namespace Model_ {
3046 
3047 struct EmbeddingPruningMaskT : public flatbuffers::NativeTable {
3048   typedef EmbeddingPruningMask TableType;
3049   bool enabled = false;
3050   std::vector<uint64_t> pruning_mask{};
3051   int32_t full_num_buckets = 0;
3052   int32_t pruned_row_bucket_id = 0;
3053 };
3054 
3055 struct EmbeddingPruningMask FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
3056   typedef EmbeddingPruningMaskT NativeTableType;
3057   typedef EmbeddingPruningMaskBuilder Builder;
3058   enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
3059     VT_ENABLED = 4,
3060     VT_PRUNING_MASK = 6,
3061     VT_FULL_NUM_BUCKETS = 8,
3062     VT_PRUNED_ROW_BUCKET_ID = 10
3063   };
enabledFLATBUFFERS_FINAL_CLASS3064   bool enabled() const {
3065     return GetField<uint8_t>(VT_ENABLED, 0) != 0;
3066   }
pruning_maskFLATBUFFERS_FINAL_CLASS3067   const flatbuffers::Vector<uint64_t> *pruning_mask() const {
3068     return GetPointer<const flatbuffers::Vector<uint64_t> *>(VT_PRUNING_MASK);
3069   }
full_num_bucketsFLATBUFFERS_FINAL_CLASS3070   int32_t full_num_buckets() const {
3071     return GetField<int32_t>(VT_FULL_NUM_BUCKETS, 0);
3072   }
pruned_row_bucket_idFLATBUFFERS_FINAL_CLASS3073   int32_t pruned_row_bucket_id() const {
3074     return GetField<int32_t>(VT_PRUNED_ROW_BUCKET_ID, 0);
3075   }
VerifyFLATBUFFERS_FINAL_CLASS3076   bool Verify(flatbuffers::Verifier &verifier) const {
3077     return VerifyTableStart(verifier) &&
3078            VerifyField<uint8_t>(verifier, VT_ENABLED, 1) &&
3079            VerifyOffset(verifier, VT_PRUNING_MASK) &&
3080            verifier.VerifyVector(pruning_mask()) &&
3081            VerifyField<int32_t>(verifier, VT_FULL_NUM_BUCKETS, 4) &&
3082            VerifyField<int32_t>(verifier, VT_PRUNED_ROW_BUCKET_ID, 4) &&
3083            verifier.EndTable();
3084   }
3085   EmbeddingPruningMaskT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const;
3086   void UnPackTo(EmbeddingPruningMaskT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const;
3087   static flatbuffers::Offset<EmbeddingPruningMask> Pack(flatbuffers::FlatBufferBuilder &_fbb, const EmbeddingPruningMaskT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
3088 };
3089 
3090 struct EmbeddingPruningMaskBuilder {
3091   typedef EmbeddingPruningMask Table;
3092   flatbuffers::FlatBufferBuilder &fbb_;
3093   flatbuffers::uoffset_t start_;
add_enabledEmbeddingPruningMaskBuilder3094   void add_enabled(bool enabled) {
3095     fbb_.AddElement<uint8_t>(EmbeddingPruningMask::VT_ENABLED, static_cast<uint8_t>(enabled), 0);
3096   }
add_pruning_maskEmbeddingPruningMaskBuilder3097   void add_pruning_mask(flatbuffers::Offset<flatbuffers::Vector<uint64_t>> pruning_mask) {
3098     fbb_.AddOffset(EmbeddingPruningMask::VT_PRUNING_MASK, pruning_mask);
3099   }
add_full_num_bucketsEmbeddingPruningMaskBuilder3100   void add_full_num_buckets(int32_t full_num_buckets) {
3101     fbb_.AddElement<int32_t>(EmbeddingPruningMask::VT_FULL_NUM_BUCKETS, full_num_buckets, 0);
3102   }
add_pruned_row_bucket_idEmbeddingPruningMaskBuilder3103   void add_pruned_row_bucket_id(int32_t pruned_row_bucket_id) {
3104     fbb_.AddElement<int32_t>(EmbeddingPruningMask::VT_PRUNED_ROW_BUCKET_ID, pruned_row_bucket_id, 0);
3105   }
EmbeddingPruningMaskBuilderEmbeddingPruningMaskBuilder3106   explicit EmbeddingPruningMaskBuilder(flatbuffers::FlatBufferBuilder &_fbb)
3107         : fbb_(_fbb) {
3108     start_ = fbb_.StartTable();
3109   }
FinishEmbeddingPruningMaskBuilder3110   flatbuffers::Offset<EmbeddingPruningMask> Finish() {
3111     const auto end = fbb_.EndTable(start_);
3112     auto o = flatbuffers::Offset<EmbeddingPruningMask>(end);
3113     return o;
3114   }
3115 };
3116 
3117 inline flatbuffers::Offset<EmbeddingPruningMask> CreateEmbeddingPruningMask(
3118     flatbuffers::FlatBufferBuilder &_fbb,
3119     bool enabled = false,
3120     flatbuffers::Offset<flatbuffers::Vector<uint64_t>> pruning_mask = 0,
3121     int32_t full_num_buckets = 0,
3122     int32_t pruned_row_bucket_id = 0) {
3123   EmbeddingPruningMaskBuilder builder_(_fbb);
3124   builder_.add_pruned_row_bucket_id(pruned_row_bucket_id);
3125   builder_.add_full_num_buckets(full_num_buckets);
3126   builder_.add_pruning_mask(pruning_mask);
3127   builder_.add_enabled(enabled);
3128   return builder_.Finish();
3129 }
3130 
3131 inline flatbuffers::Offset<EmbeddingPruningMask> CreateEmbeddingPruningMaskDirect(
3132     flatbuffers::FlatBufferBuilder &_fbb,
3133     bool enabled = false,
3134     const std::vector<uint64_t> *pruning_mask = nullptr,
3135     int32_t full_num_buckets = 0,
3136     int32_t pruned_row_bucket_id = 0) {
3137   if (pruning_mask) { _fbb.ForceVectorAlignment(pruning_mask->size(), sizeof(uint64_t), 16); }
3138   auto pruning_mask__ = pruning_mask ? _fbb.CreateVector<uint64_t>(*pruning_mask) : 0;
3139   return libtextclassifier3::Model_::CreateEmbeddingPruningMask(
3140       _fbb,
3141       enabled,
3142       pruning_mask__,
3143       full_num_buckets,
3144       pruned_row_bucket_id);
3145 }
3146 
3147 flatbuffers::Offset<EmbeddingPruningMask> CreateEmbeddingPruningMask(flatbuffers::FlatBufferBuilder &_fbb, const EmbeddingPruningMaskT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
3148 
3149 struct ConflictResolutionOptionsT : public flatbuffers::NativeTable {
3150   typedef ConflictResolutionOptions TableType;
3151   bool prioritize_longest_annotation = false;
3152   bool do_conflict_resolution_in_raw_mode = true;
3153 };
3154 
3155 struct ConflictResolutionOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
3156   typedef ConflictResolutionOptionsT NativeTableType;
3157   typedef ConflictResolutionOptionsBuilder Builder;
3158   enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
3159     VT_PRIORITIZE_LONGEST_ANNOTATION = 4,
3160     VT_DO_CONFLICT_RESOLUTION_IN_RAW_MODE = 6
3161   };
prioritize_longest_annotationFLATBUFFERS_FINAL_CLASS3162   bool prioritize_longest_annotation() const {
3163     return GetField<uint8_t>(VT_PRIORITIZE_LONGEST_ANNOTATION, 0) != 0;
3164   }
do_conflict_resolution_in_raw_modeFLATBUFFERS_FINAL_CLASS3165   bool do_conflict_resolution_in_raw_mode() const {
3166     return GetField<uint8_t>(VT_DO_CONFLICT_RESOLUTION_IN_RAW_MODE, 1) != 0;
3167   }
VerifyFLATBUFFERS_FINAL_CLASS3168   bool Verify(flatbuffers::Verifier &verifier) const {
3169     return VerifyTableStart(verifier) &&
3170            VerifyField<uint8_t>(verifier, VT_PRIORITIZE_LONGEST_ANNOTATION, 1) &&
3171            VerifyField<uint8_t>(verifier, VT_DO_CONFLICT_RESOLUTION_IN_RAW_MODE, 1) &&
3172            verifier.EndTable();
3173   }
3174   ConflictResolutionOptionsT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const;
3175   void UnPackTo(ConflictResolutionOptionsT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const;
3176   static flatbuffers::Offset<ConflictResolutionOptions> Pack(flatbuffers::FlatBufferBuilder &_fbb, const ConflictResolutionOptionsT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
3177 };
3178 
3179 struct ConflictResolutionOptionsBuilder {
3180   typedef ConflictResolutionOptions Table;
3181   flatbuffers::FlatBufferBuilder &fbb_;
3182   flatbuffers::uoffset_t start_;
add_prioritize_longest_annotationConflictResolutionOptionsBuilder3183   void add_prioritize_longest_annotation(bool prioritize_longest_annotation) {
3184     fbb_.AddElement<uint8_t>(ConflictResolutionOptions::VT_PRIORITIZE_LONGEST_ANNOTATION, static_cast<uint8_t>(prioritize_longest_annotation), 0);
3185   }
add_do_conflict_resolution_in_raw_modeConflictResolutionOptionsBuilder3186   void add_do_conflict_resolution_in_raw_mode(bool do_conflict_resolution_in_raw_mode) {
3187     fbb_.AddElement<uint8_t>(ConflictResolutionOptions::VT_DO_CONFLICT_RESOLUTION_IN_RAW_MODE, static_cast<uint8_t>(do_conflict_resolution_in_raw_mode), 1);
3188   }
ConflictResolutionOptionsBuilderConflictResolutionOptionsBuilder3189   explicit ConflictResolutionOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb)
3190         : fbb_(_fbb) {
3191     start_ = fbb_.StartTable();
3192   }
FinishConflictResolutionOptionsBuilder3193   flatbuffers::Offset<ConflictResolutionOptions> Finish() {
3194     const auto end = fbb_.EndTable(start_);
3195     auto o = flatbuffers::Offset<ConflictResolutionOptions>(end);
3196     return o;
3197   }
3198 };
3199 
3200 inline flatbuffers::Offset<ConflictResolutionOptions> CreateConflictResolutionOptions(
3201     flatbuffers::FlatBufferBuilder &_fbb,
3202     bool prioritize_longest_annotation = false,
3203     bool do_conflict_resolution_in_raw_mode = true) {
3204   ConflictResolutionOptionsBuilder builder_(_fbb);
3205   builder_.add_do_conflict_resolution_in_raw_mode(do_conflict_resolution_in_raw_mode);
3206   builder_.add_prioritize_longest_annotation(prioritize_longest_annotation);
3207   return builder_.Finish();
3208 }
3209 
3210 flatbuffers::Offset<ConflictResolutionOptions> CreateConflictResolutionOptions(flatbuffers::FlatBufferBuilder &_fbb, const ConflictResolutionOptionsT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
3211 
3212 }  // namespace Model_
3213 
3214 struct ModelT : public flatbuffers::NativeTable {
3215   typedef Model TableType;
3216   std::string locales{};
3217   int32_t version = 0;
3218   std::string name{};
3219   std::unique_ptr<libtextclassifier3::FeatureProcessorOptionsT> selection_feature_options{};
3220   std::unique_ptr<libtextclassifier3::FeatureProcessorOptionsT> classification_feature_options{};
3221   std::vector<uint8_t> selection_model{};
3222   std::vector<uint8_t> classification_model{};
3223   std::vector<uint8_t> embedding_model{};
3224   std::unique_ptr<libtextclassifier3::SelectionModelOptionsT> selection_options{};
3225   std::unique_ptr<libtextclassifier3::ClassificationModelOptionsT> classification_options{};
3226   std::unique_ptr<libtextclassifier3::RegexModelT> regex_model{};
3227   std::unique_ptr<libtextclassifier3::DatetimeModelT> datetime_model{};
3228   std::unique_ptr<libtextclassifier3::ModelTriggeringOptionsT> triggering_options{};
3229   libtextclassifier3::ModeFlag enabled_modes = libtextclassifier3::ModeFlag_ALL;
3230   bool snap_whitespace_selections = true;
3231   std::unique_ptr<libtextclassifier3::OutputOptionsT> output_options{};
3232   std::unique_ptr<libtextclassifier3::AndroidIntentFactoryOptionsT> android_intent_options{};
3233   std::unique_ptr<libtextclassifier3::IntentFactoryModelT> intent_options{};
3234   std::unique_ptr<libtextclassifier3::ResourcePoolT> resources{};
3235   std::vector<uint8_t> entity_data_schema{};
3236   std::unique_ptr<libtextclassifier3::NumberAnnotatorOptionsT> number_annotator_options{};
3237   std::unique_ptr<libtextclassifier3::DurationAnnotatorOptionsT> duration_annotator_options{};
3238   std::string triggering_locales{};
3239   std::unique_ptr<libtextclassifier3::Model_::EmbeddingPruningMaskT> embedding_pruning_mask{};
3240   std::unique_ptr<libtextclassifier3::ContactAnnotatorOptionsT> contact_annotator_options{};
3241   std::unique_ptr<libtextclassifier3::MoneyParsingOptionsT> money_parsing_options{};
3242   std::unique_ptr<libtextclassifier3::TranslateAnnotatorOptionsT> translate_annotator_options{};
3243   std::unique_ptr<libtextclassifier3::GrammarModelT> grammar_model{};
3244   std::unique_ptr<libtextclassifier3::Model_::ConflictResolutionOptionsT> conflict_resolution_options{};
3245   std::unique_ptr<libtextclassifier3::ExperimentalModelT> experimental_model{};
3246   std::unique_ptr<libtextclassifier3::PodNerModelT> pod_ner_model{};
3247   std::unique_ptr<libtextclassifier3::VocabModelT> vocab_model{};
3248   std::unique_ptr<libtextclassifier3::GrammarModelT> datetime_grammar_model{};
3249   ModelT() = default;
3250   ModelT(const ModelT &o);
3251   ModelT(ModelT&&) FLATBUFFERS_NOEXCEPT = default;
3252   ModelT &operator=(ModelT o) FLATBUFFERS_NOEXCEPT;
3253 };
3254 
3255 struct Model FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
3256   typedef ModelT NativeTableType;
3257   typedef ModelBuilder Builder;
3258   enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
3259     VT_LOCALES = 4,
3260     VT_VERSION = 6,
3261     VT_NAME = 8,
3262     VT_SELECTION_FEATURE_OPTIONS = 10,
3263     VT_CLASSIFICATION_FEATURE_OPTIONS = 12,
3264     VT_SELECTION_MODEL = 14,
3265     VT_CLASSIFICATION_MODEL = 16,
3266     VT_EMBEDDING_MODEL = 18,
3267     VT_SELECTION_OPTIONS = 20,
3268     VT_CLASSIFICATION_OPTIONS = 22,
3269     VT_REGEX_MODEL = 24,
3270     VT_DATETIME_MODEL = 26,
3271     VT_TRIGGERING_OPTIONS = 28,
3272     VT_ENABLED_MODES = 30,
3273     VT_SNAP_WHITESPACE_SELECTIONS = 32,
3274     VT_OUTPUT_OPTIONS = 34,
3275     VT_ANDROID_INTENT_OPTIONS = 36,
3276     VT_INTENT_OPTIONS = 38,
3277     VT_RESOURCES = 40,
3278     VT_ENTITY_DATA_SCHEMA = 42,
3279     VT_NUMBER_ANNOTATOR_OPTIONS = 44,
3280     VT_DURATION_ANNOTATOR_OPTIONS = 46,
3281     VT_TRIGGERING_LOCALES = 48,
3282     VT_EMBEDDING_PRUNING_MASK = 50,
3283     VT_CONTACT_ANNOTATOR_OPTIONS = 54,
3284     VT_MONEY_PARSING_OPTIONS = 56,
3285     VT_TRANSLATE_ANNOTATOR_OPTIONS = 58,
3286     VT_GRAMMAR_MODEL = 60,
3287     VT_CONFLICT_RESOLUTION_OPTIONS = 62,
3288     VT_EXPERIMENTAL_MODEL = 64,
3289     VT_POD_NER_MODEL = 66,
3290     VT_VOCAB_MODEL = 68,
3291     VT_DATETIME_GRAMMAR_MODEL = 70
3292   };
localesFLATBUFFERS_FINAL_CLASS3293   const flatbuffers::String *locales() const {
3294     return GetPointer<const flatbuffers::String *>(VT_LOCALES);
3295   }
versionFLATBUFFERS_FINAL_CLASS3296   int32_t version() const {
3297     return GetField<int32_t>(VT_VERSION, 0);
3298   }
nameFLATBUFFERS_FINAL_CLASS3299   const flatbuffers::String *name() const {
3300     return GetPointer<const flatbuffers::String *>(VT_NAME);
3301   }
selection_feature_optionsFLATBUFFERS_FINAL_CLASS3302   const libtextclassifier3::FeatureProcessorOptions *selection_feature_options() const {
3303     return GetPointer<const libtextclassifier3::FeatureProcessorOptions *>(VT_SELECTION_FEATURE_OPTIONS);
3304   }
classification_feature_optionsFLATBUFFERS_FINAL_CLASS3305   const libtextclassifier3::FeatureProcessorOptions *classification_feature_options() const {
3306     return GetPointer<const libtextclassifier3::FeatureProcessorOptions *>(VT_CLASSIFICATION_FEATURE_OPTIONS);
3307   }
selection_modelFLATBUFFERS_FINAL_CLASS3308   const flatbuffers::Vector<uint8_t> *selection_model() const {
3309     return GetPointer<const flatbuffers::Vector<uint8_t> *>(VT_SELECTION_MODEL);
3310   }
classification_modelFLATBUFFERS_FINAL_CLASS3311   const flatbuffers::Vector<uint8_t> *classification_model() const {
3312     return GetPointer<const flatbuffers::Vector<uint8_t> *>(VT_CLASSIFICATION_MODEL);
3313   }
embedding_modelFLATBUFFERS_FINAL_CLASS3314   const flatbuffers::Vector<uint8_t> *embedding_model() const {
3315     return GetPointer<const flatbuffers::Vector<uint8_t> *>(VT_EMBEDDING_MODEL);
3316   }
selection_optionsFLATBUFFERS_FINAL_CLASS3317   const libtextclassifier3::SelectionModelOptions *selection_options() const {
3318     return GetPointer<const libtextclassifier3::SelectionModelOptions *>(VT_SELECTION_OPTIONS);
3319   }
classification_optionsFLATBUFFERS_FINAL_CLASS3320   const libtextclassifier3::ClassificationModelOptions *classification_options() const {
3321     return GetPointer<const libtextclassifier3::ClassificationModelOptions *>(VT_CLASSIFICATION_OPTIONS);
3322   }
regex_modelFLATBUFFERS_FINAL_CLASS3323   const libtextclassifier3::RegexModel *regex_model() const {
3324     return GetPointer<const libtextclassifier3::RegexModel *>(VT_REGEX_MODEL);
3325   }
datetime_modelFLATBUFFERS_FINAL_CLASS3326   const libtextclassifier3::DatetimeModel *datetime_model() const {
3327     return GetPointer<const libtextclassifier3::DatetimeModel *>(VT_DATETIME_MODEL);
3328   }
triggering_optionsFLATBUFFERS_FINAL_CLASS3329   const libtextclassifier3::ModelTriggeringOptions *triggering_options() const {
3330     return GetPointer<const libtextclassifier3::ModelTriggeringOptions *>(VT_TRIGGERING_OPTIONS);
3331   }
enabled_modesFLATBUFFERS_FINAL_CLASS3332   libtextclassifier3::ModeFlag enabled_modes() const {
3333     return static_cast<libtextclassifier3::ModeFlag>(GetField<int32_t>(VT_ENABLED_MODES, 7));
3334   }
snap_whitespace_selectionsFLATBUFFERS_FINAL_CLASS3335   bool snap_whitespace_selections() const {
3336     return GetField<uint8_t>(VT_SNAP_WHITESPACE_SELECTIONS, 1) != 0;
3337   }
output_optionsFLATBUFFERS_FINAL_CLASS3338   const libtextclassifier3::OutputOptions *output_options() const {
3339     return GetPointer<const libtextclassifier3::OutputOptions *>(VT_OUTPUT_OPTIONS);
3340   }
android_intent_optionsFLATBUFFERS_FINAL_CLASS3341   const libtextclassifier3::AndroidIntentFactoryOptions *android_intent_options() const {
3342     return GetPointer<const libtextclassifier3::AndroidIntentFactoryOptions *>(VT_ANDROID_INTENT_OPTIONS);
3343   }
intent_optionsFLATBUFFERS_FINAL_CLASS3344   const libtextclassifier3::IntentFactoryModel *intent_options() const {
3345     return GetPointer<const libtextclassifier3::IntentFactoryModel *>(VT_INTENT_OPTIONS);
3346   }
resourcesFLATBUFFERS_FINAL_CLASS3347   const libtextclassifier3::ResourcePool *resources() const {
3348     return GetPointer<const libtextclassifier3::ResourcePool *>(VT_RESOURCES);
3349   }
entity_data_schemaFLATBUFFERS_FINAL_CLASS3350   const flatbuffers::Vector<uint8_t> *entity_data_schema() const {
3351     return GetPointer<const flatbuffers::Vector<uint8_t> *>(VT_ENTITY_DATA_SCHEMA);
3352   }
number_annotator_optionsFLATBUFFERS_FINAL_CLASS3353   const libtextclassifier3::NumberAnnotatorOptions *number_annotator_options() const {
3354     return GetPointer<const libtextclassifier3::NumberAnnotatorOptions *>(VT_NUMBER_ANNOTATOR_OPTIONS);
3355   }
duration_annotator_optionsFLATBUFFERS_FINAL_CLASS3356   const libtextclassifier3::DurationAnnotatorOptions *duration_annotator_options() const {
3357     return GetPointer<const libtextclassifier3::DurationAnnotatorOptions *>(VT_DURATION_ANNOTATOR_OPTIONS);
3358   }
triggering_localesFLATBUFFERS_FINAL_CLASS3359   const flatbuffers::String *triggering_locales() const {
3360     return GetPointer<const flatbuffers::String *>(VT_TRIGGERING_LOCALES);
3361   }
embedding_pruning_maskFLATBUFFERS_FINAL_CLASS3362   const libtextclassifier3::Model_::EmbeddingPruningMask *embedding_pruning_mask() const {
3363     return GetPointer<const libtextclassifier3::Model_::EmbeddingPruningMask *>(VT_EMBEDDING_PRUNING_MASK);
3364   }
contact_annotator_optionsFLATBUFFERS_FINAL_CLASS3365   const libtextclassifier3::ContactAnnotatorOptions *contact_annotator_options() const {
3366     return GetPointer<const libtextclassifier3::ContactAnnotatorOptions *>(VT_CONTACT_ANNOTATOR_OPTIONS);
3367   }
money_parsing_optionsFLATBUFFERS_FINAL_CLASS3368   const libtextclassifier3::MoneyParsingOptions *money_parsing_options() const {
3369     return GetPointer<const libtextclassifier3::MoneyParsingOptions *>(VT_MONEY_PARSING_OPTIONS);
3370   }
translate_annotator_optionsFLATBUFFERS_FINAL_CLASS3371   const libtextclassifier3::TranslateAnnotatorOptions *translate_annotator_options() const {
3372     return GetPointer<const libtextclassifier3::TranslateAnnotatorOptions *>(VT_TRANSLATE_ANNOTATOR_OPTIONS);
3373   }
grammar_modelFLATBUFFERS_FINAL_CLASS3374   const libtextclassifier3::GrammarModel *grammar_model() const {
3375     return GetPointer<const libtextclassifier3::GrammarModel *>(VT_GRAMMAR_MODEL);
3376   }
conflict_resolution_optionsFLATBUFFERS_FINAL_CLASS3377   const libtextclassifier3::Model_::ConflictResolutionOptions *conflict_resolution_options() const {
3378     return GetPointer<const libtextclassifier3::Model_::ConflictResolutionOptions *>(VT_CONFLICT_RESOLUTION_OPTIONS);
3379   }
experimental_modelFLATBUFFERS_FINAL_CLASS3380   const libtextclassifier3::ExperimentalModel *experimental_model() const {
3381     return GetPointer<const libtextclassifier3::ExperimentalModel *>(VT_EXPERIMENTAL_MODEL);
3382   }
pod_ner_modelFLATBUFFERS_FINAL_CLASS3383   const libtextclassifier3::PodNerModel *pod_ner_model() const {
3384     return GetPointer<const libtextclassifier3::PodNerModel *>(VT_POD_NER_MODEL);
3385   }
vocab_modelFLATBUFFERS_FINAL_CLASS3386   const libtextclassifier3::VocabModel *vocab_model() const {
3387     return GetPointer<const libtextclassifier3::VocabModel *>(VT_VOCAB_MODEL);
3388   }
datetime_grammar_modelFLATBUFFERS_FINAL_CLASS3389   const libtextclassifier3::GrammarModel *datetime_grammar_model() const {
3390     return GetPointer<const libtextclassifier3::GrammarModel *>(VT_DATETIME_GRAMMAR_MODEL);
3391   }
VerifyFLATBUFFERS_FINAL_CLASS3392   bool Verify(flatbuffers::Verifier &verifier) const {
3393     return VerifyTableStart(verifier) &&
3394            VerifyOffset(verifier, VT_LOCALES) &&
3395            verifier.VerifyString(locales()) &&
3396            VerifyField<int32_t>(verifier, VT_VERSION, 4) &&
3397            VerifyOffset(verifier, VT_NAME) &&
3398            verifier.VerifyString(name()) &&
3399            VerifyOffset(verifier, VT_SELECTION_FEATURE_OPTIONS) &&
3400            verifier.VerifyTable(selection_feature_options()) &&
3401            VerifyOffset(verifier, VT_CLASSIFICATION_FEATURE_OPTIONS) &&
3402            verifier.VerifyTable(classification_feature_options()) &&
3403            VerifyOffset(verifier, VT_SELECTION_MODEL) &&
3404            verifier.VerifyVector(selection_model()) &&
3405            VerifyOffset(verifier, VT_CLASSIFICATION_MODEL) &&
3406            verifier.VerifyVector(classification_model()) &&
3407            VerifyOffset(verifier, VT_EMBEDDING_MODEL) &&
3408            verifier.VerifyVector(embedding_model()) &&
3409            VerifyOffset(verifier, VT_SELECTION_OPTIONS) &&
3410            verifier.VerifyTable(selection_options()) &&
3411            VerifyOffset(verifier, VT_CLASSIFICATION_OPTIONS) &&
3412            verifier.VerifyTable(classification_options()) &&
3413            VerifyOffset(verifier, VT_REGEX_MODEL) &&
3414            verifier.VerifyTable(regex_model()) &&
3415            VerifyOffset(verifier, VT_DATETIME_MODEL) &&
3416            verifier.VerifyTable(datetime_model()) &&
3417            VerifyOffset(verifier, VT_TRIGGERING_OPTIONS) &&
3418            verifier.VerifyTable(triggering_options()) &&
3419            VerifyField<int32_t>(verifier, VT_ENABLED_MODES, 4) &&
3420            VerifyField<uint8_t>(verifier, VT_SNAP_WHITESPACE_SELECTIONS, 1) &&
3421            VerifyOffset(verifier, VT_OUTPUT_OPTIONS) &&
3422            verifier.VerifyTable(output_options()) &&
3423            VerifyOffset(verifier, VT_ANDROID_INTENT_OPTIONS) &&
3424            verifier.VerifyTable(android_intent_options()) &&
3425            VerifyOffset(verifier, VT_INTENT_OPTIONS) &&
3426            verifier.VerifyTable(intent_options()) &&
3427            VerifyOffset(verifier, VT_RESOURCES) &&
3428            verifier.VerifyTable(resources()) &&
3429            VerifyOffset(verifier, VT_ENTITY_DATA_SCHEMA) &&
3430            verifier.VerifyVector(entity_data_schema()) &&
3431            VerifyOffset(verifier, VT_NUMBER_ANNOTATOR_OPTIONS) &&
3432            verifier.VerifyTable(number_annotator_options()) &&
3433            VerifyOffset(verifier, VT_DURATION_ANNOTATOR_OPTIONS) &&
3434            verifier.VerifyTable(duration_annotator_options()) &&
3435            VerifyOffset(verifier, VT_TRIGGERING_LOCALES) &&
3436            verifier.VerifyString(triggering_locales()) &&
3437            VerifyOffset(verifier, VT_EMBEDDING_PRUNING_MASK) &&
3438            verifier.VerifyTable(embedding_pruning_mask()) &&
3439            VerifyOffset(verifier, VT_CONTACT_ANNOTATOR_OPTIONS) &&
3440            verifier.VerifyTable(contact_annotator_options()) &&
3441            VerifyOffset(verifier, VT_MONEY_PARSING_OPTIONS) &&
3442            verifier.VerifyTable(money_parsing_options()) &&
3443            VerifyOffset(verifier, VT_TRANSLATE_ANNOTATOR_OPTIONS) &&
3444            verifier.VerifyTable(translate_annotator_options()) &&
3445            VerifyOffset(verifier, VT_GRAMMAR_MODEL) &&
3446            verifier.VerifyTable(grammar_model()) &&
3447            VerifyOffset(verifier, VT_CONFLICT_RESOLUTION_OPTIONS) &&
3448            verifier.VerifyTable(conflict_resolution_options()) &&
3449            VerifyOffset(verifier, VT_EXPERIMENTAL_MODEL) &&
3450            verifier.VerifyTable(experimental_model()) &&
3451            VerifyOffset(verifier, VT_POD_NER_MODEL) &&
3452            verifier.VerifyTable(pod_ner_model()) &&
3453            VerifyOffset(verifier, VT_VOCAB_MODEL) &&
3454            verifier.VerifyTable(vocab_model()) &&
3455            VerifyOffset(verifier, VT_DATETIME_GRAMMAR_MODEL) &&
3456            verifier.VerifyTable(datetime_grammar_model()) &&
3457            verifier.EndTable();
3458   }
3459   ModelT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const;
3460   void UnPackTo(ModelT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const;
3461   static flatbuffers::Offset<Model> Pack(flatbuffers::FlatBufferBuilder &_fbb, const ModelT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
3462 };
3463 
3464 struct ModelBuilder {
3465   typedef Model Table;
3466   flatbuffers::FlatBufferBuilder &fbb_;
3467   flatbuffers::uoffset_t start_;
add_localesModelBuilder3468   void add_locales(flatbuffers::Offset<flatbuffers::String> locales) {
3469     fbb_.AddOffset(Model::VT_LOCALES, locales);
3470   }
add_versionModelBuilder3471   void add_version(int32_t version) {
3472     fbb_.AddElement<int32_t>(Model::VT_VERSION, version, 0);
3473   }
add_nameModelBuilder3474   void add_name(flatbuffers::Offset<flatbuffers::String> name) {
3475     fbb_.AddOffset(Model::VT_NAME, name);
3476   }
add_selection_feature_optionsModelBuilder3477   void add_selection_feature_options(flatbuffers::Offset<libtextclassifier3::FeatureProcessorOptions> selection_feature_options) {
3478     fbb_.AddOffset(Model::VT_SELECTION_FEATURE_OPTIONS, selection_feature_options);
3479   }
add_classification_feature_optionsModelBuilder3480   void add_classification_feature_options(flatbuffers::Offset<libtextclassifier3::FeatureProcessorOptions> classification_feature_options) {
3481     fbb_.AddOffset(Model::VT_CLASSIFICATION_FEATURE_OPTIONS, classification_feature_options);
3482   }
add_selection_modelModelBuilder3483   void add_selection_model(flatbuffers::Offset<flatbuffers::Vector<uint8_t>> selection_model) {
3484     fbb_.AddOffset(Model::VT_SELECTION_MODEL, selection_model);
3485   }
add_classification_modelModelBuilder3486   void add_classification_model(flatbuffers::Offset<flatbuffers::Vector<uint8_t>> classification_model) {
3487     fbb_.AddOffset(Model::VT_CLASSIFICATION_MODEL, classification_model);
3488   }
add_embedding_modelModelBuilder3489   void add_embedding_model(flatbuffers::Offset<flatbuffers::Vector<uint8_t>> embedding_model) {
3490     fbb_.AddOffset(Model::VT_EMBEDDING_MODEL, embedding_model);
3491   }
add_selection_optionsModelBuilder3492   void add_selection_options(flatbuffers::Offset<libtextclassifier3::SelectionModelOptions> selection_options) {
3493     fbb_.AddOffset(Model::VT_SELECTION_OPTIONS, selection_options);
3494   }
add_classification_optionsModelBuilder3495   void add_classification_options(flatbuffers::Offset<libtextclassifier3::ClassificationModelOptions> classification_options) {
3496     fbb_.AddOffset(Model::VT_CLASSIFICATION_OPTIONS, classification_options);
3497   }
add_regex_modelModelBuilder3498   void add_regex_model(flatbuffers::Offset<libtextclassifier3::RegexModel> regex_model) {
3499     fbb_.AddOffset(Model::VT_REGEX_MODEL, regex_model);
3500   }
add_datetime_modelModelBuilder3501   void add_datetime_model(flatbuffers::Offset<libtextclassifier3::DatetimeModel> datetime_model) {
3502     fbb_.AddOffset(Model::VT_DATETIME_MODEL, datetime_model);
3503   }
add_triggering_optionsModelBuilder3504   void add_triggering_options(flatbuffers::Offset<libtextclassifier3::ModelTriggeringOptions> triggering_options) {
3505     fbb_.AddOffset(Model::VT_TRIGGERING_OPTIONS, triggering_options);
3506   }
add_enabled_modesModelBuilder3507   void add_enabled_modes(libtextclassifier3::ModeFlag enabled_modes) {
3508     fbb_.AddElement<int32_t>(Model::VT_ENABLED_MODES, static_cast<int32_t>(enabled_modes), 7);
3509   }
add_snap_whitespace_selectionsModelBuilder3510   void add_snap_whitespace_selections(bool snap_whitespace_selections) {
3511     fbb_.AddElement<uint8_t>(Model::VT_SNAP_WHITESPACE_SELECTIONS, static_cast<uint8_t>(snap_whitespace_selections), 1);
3512   }
add_output_optionsModelBuilder3513   void add_output_options(flatbuffers::Offset<libtextclassifier3::OutputOptions> output_options) {
3514     fbb_.AddOffset(Model::VT_OUTPUT_OPTIONS, output_options);
3515   }
add_android_intent_optionsModelBuilder3516   void add_android_intent_options(flatbuffers::Offset<libtextclassifier3::AndroidIntentFactoryOptions> android_intent_options) {
3517     fbb_.AddOffset(Model::VT_ANDROID_INTENT_OPTIONS, android_intent_options);
3518   }
add_intent_optionsModelBuilder3519   void add_intent_options(flatbuffers::Offset<libtextclassifier3::IntentFactoryModel> intent_options) {
3520     fbb_.AddOffset(Model::VT_INTENT_OPTIONS, intent_options);
3521   }
add_resourcesModelBuilder3522   void add_resources(flatbuffers::Offset<libtextclassifier3::ResourcePool> resources) {
3523     fbb_.AddOffset(Model::VT_RESOURCES, resources);
3524   }
add_entity_data_schemaModelBuilder3525   void add_entity_data_schema(flatbuffers::Offset<flatbuffers::Vector<uint8_t>> entity_data_schema) {
3526     fbb_.AddOffset(Model::VT_ENTITY_DATA_SCHEMA, entity_data_schema);
3527   }
add_number_annotator_optionsModelBuilder3528   void add_number_annotator_options(flatbuffers::Offset<libtextclassifier3::NumberAnnotatorOptions> number_annotator_options) {
3529     fbb_.AddOffset(Model::VT_NUMBER_ANNOTATOR_OPTIONS, number_annotator_options);
3530   }
add_duration_annotator_optionsModelBuilder3531   void add_duration_annotator_options(flatbuffers::Offset<libtextclassifier3::DurationAnnotatorOptions> duration_annotator_options) {
3532     fbb_.AddOffset(Model::VT_DURATION_ANNOTATOR_OPTIONS, duration_annotator_options);
3533   }
add_triggering_localesModelBuilder3534   void add_triggering_locales(flatbuffers::Offset<flatbuffers::String> triggering_locales) {
3535     fbb_.AddOffset(Model::VT_TRIGGERING_LOCALES, triggering_locales);
3536   }
add_embedding_pruning_maskModelBuilder3537   void add_embedding_pruning_mask(flatbuffers::Offset<libtextclassifier3::Model_::EmbeddingPruningMask> embedding_pruning_mask) {
3538     fbb_.AddOffset(Model::VT_EMBEDDING_PRUNING_MASK, embedding_pruning_mask);
3539   }
add_contact_annotator_optionsModelBuilder3540   void add_contact_annotator_options(flatbuffers::Offset<libtextclassifier3::ContactAnnotatorOptions> contact_annotator_options) {
3541     fbb_.AddOffset(Model::VT_CONTACT_ANNOTATOR_OPTIONS, contact_annotator_options);
3542   }
add_money_parsing_optionsModelBuilder3543   void add_money_parsing_options(flatbuffers::Offset<libtextclassifier3::MoneyParsingOptions> money_parsing_options) {
3544     fbb_.AddOffset(Model::VT_MONEY_PARSING_OPTIONS, money_parsing_options);
3545   }
add_translate_annotator_optionsModelBuilder3546   void add_translate_annotator_options(flatbuffers::Offset<libtextclassifier3::TranslateAnnotatorOptions> translate_annotator_options) {
3547     fbb_.AddOffset(Model::VT_TRANSLATE_ANNOTATOR_OPTIONS, translate_annotator_options);
3548   }
add_grammar_modelModelBuilder3549   void add_grammar_model(flatbuffers::Offset<libtextclassifier3::GrammarModel> grammar_model) {
3550     fbb_.AddOffset(Model::VT_GRAMMAR_MODEL, grammar_model);
3551   }
add_conflict_resolution_optionsModelBuilder3552   void add_conflict_resolution_options(flatbuffers::Offset<libtextclassifier3::Model_::ConflictResolutionOptions> conflict_resolution_options) {
3553     fbb_.AddOffset(Model::VT_CONFLICT_RESOLUTION_OPTIONS, conflict_resolution_options);
3554   }
add_experimental_modelModelBuilder3555   void add_experimental_model(flatbuffers::Offset<libtextclassifier3::ExperimentalModel> experimental_model) {
3556     fbb_.AddOffset(Model::VT_EXPERIMENTAL_MODEL, experimental_model);
3557   }
add_pod_ner_modelModelBuilder3558   void add_pod_ner_model(flatbuffers::Offset<libtextclassifier3::PodNerModel> pod_ner_model) {
3559     fbb_.AddOffset(Model::VT_POD_NER_MODEL, pod_ner_model);
3560   }
add_vocab_modelModelBuilder3561   void add_vocab_model(flatbuffers::Offset<libtextclassifier3::VocabModel> vocab_model) {
3562     fbb_.AddOffset(Model::VT_VOCAB_MODEL, vocab_model);
3563   }
add_datetime_grammar_modelModelBuilder3564   void add_datetime_grammar_model(flatbuffers::Offset<libtextclassifier3::GrammarModel> datetime_grammar_model) {
3565     fbb_.AddOffset(Model::VT_DATETIME_GRAMMAR_MODEL, datetime_grammar_model);
3566   }
ModelBuilderModelBuilder3567   explicit ModelBuilder(flatbuffers::FlatBufferBuilder &_fbb)
3568         : fbb_(_fbb) {
3569     start_ = fbb_.StartTable();
3570   }
FinishModelBuilder3571   flatbuffers::Offset<Model> Finish() {
3572     const auto end = fbb_.EndTable(start_);
3573     auto o = flatbuffers::Offset<Model>(end);
3574     return o;
3575   }
3576 };
3577 
3578 inline flatbuffers::Offset<Model> CreateModel(
3579     flatbuffers::FlatBufferBuilder &_fbb,
3580     flatbuffers::Offset<flatbuffers::String> locales = 0,
3581     int32_t version = 0,
3582     flatbuffers::Offset<flatbuffers::String> name = 0,
3583     flatbuffers::Offset<libtextclassifier3::FeatureProcessorOptions> selection_feature_options = 0,
3584     flatbuffers::Offset<libtextclassifier3::FeatureProcessorOptions> classification_feature_options = 0,
3585     flatbuffers::Offset<flatbuffers::Vector<uint8_t>> selection_model = 0,
3586     flatbuffers::Offset<flatbuffers::Vector<uint8_t>> classification_model = 0,
3587     flatbuffers::Offset<flatbuffers::Vector<uint8_t>> embedding_model = 0,
3588     flatbuffers::Offset<libtextclassifier3::SelectionModelOptions> selection_options = 0,
3589     flatbuffers::Offset<libtextclassifier3::ClassificationModelOptions> classification_options = 0,
3590     flatbuffers::Offset<libtextclassifier3::RegexModel> regex_model = 0,
3591     flatbuffers::Offset<libtextclassifier3::DatetimeModel> datetime_model = 0,
3592     flatbuffers::Offset<libtextclassifier3::ModelTriggeringOptions> triggering_options = 0,
3593     libtextclassifier3::ModeFlag enabled_modes = libtextclassifier3::ModeFlag_ALL,
3594     bool snap_whitespace_selections = true,
3595     flatbuffers::Offset<libtextclassifier3::OutputOptions> output_options = 0,
3596     flatbuffers::Offset<libtextclassifier3::AndroidIntentFactoryOptions> android_intent_options = 0,
3597     flatbuffers::Offset<libtextclassifier3::IntentFactoryModel> intent_options = 0,
3598     flatbuffers::Offset<libtextclassifier3::ResourcePool> resources = 0,
3599     flatbuffers::Offset<flatbuffers::Vector<uint8_t>> entity_data_schema = 0,
3600     flatbuffers::Offset<libtextclassifier3::NumberAnnotatorOptions> number_annotator_options = 0,
3601     flatbuffers::Offset<libtextclassifier3::DurationAnnotatorOptions> duration_annotator_options = 0,
3602     flatbuffers::Offset<flatbuffers::String> triggering_locales = 0,
3603     flatbuffers::Offset<libtextclassifier3::Model_::EmbeddingPruningMask> embedding_pruning_mask = 0,
3604     flatbuffers::Offset<libtextclassifier3::ContactAnnotatorOptions> contact_annotator_options = 0,
3605     flatbuffers::Offset<libtextclassifier3::MoneyParsingOptions> money_parsing_options = 0,
3606     flatbuffers::Offset<libtextclassifier3::TranslateAnnotatorOptions> translate_annotator_options = 0,
3607     flatbuffers::Offset<libtextclassifier3::GrammarModel> grammar_model = 0,
3608     flatbuffers::Offset<libtextclassifier3::Model_::ConflictResolutionOptions> conflict_resolution_options = 0,
3609     flatbuffers::Offset<libtextclassifier3::ExperimentalModel> experimental_model = 0,
3610     flatbuffers::Offset<libtextclassifier3::PodNerModel> pod_ner_model = 0,
3611     flatbuffers::Offset<libtextclassifier3::VocabModel> vocab_model = 0,
3612     flatbuffers::Offset<libtextclassifier3::GrammarModel> datetime_grammar_model = 0) {
3613   ModelBuilder builder_(_fbb);
3614   builder_.add_datetime_grammar_model(datetime_grammar_model);
3615   builder_.add_vocab_model(vocab_model);
3616   builder_.add_pod_ner_model(pod_ner_model);
3617   builder_.add_experimental_model(experimental_model);
3618   builder_.add_conflict_resolution_options(conflict_resolution_options);
3619   builder_.add_grammar_model(grammar_model);
3620   builder_.add_translate_annotator_options(translate_annotator_options);
3621   builder_.add_money_parsing_options(money_parsing_options);
3622   builder_.add_contact_annotator_options(contact_annotator_options);
3623   builder_.add_embedding_pruning_mask(embedding_pruning_mask);
3624   builder_.add_triggering_locales(triggering_locales);
3625   builder_.add_duration_annotator_options(duration_annotator_options);
3626   builder_.add_number_annotator_options(number_annotator_options);
3627   builder_.add_entity_data_schema(entity_data_schema);
3628   builder_.add_resources(resources);
3629   builder_.add_intent_options(intent_options);
3630   builder_.add_android_intent_options(android_intent_options);
3631   builder_.add_output_options(output_options);
3632   builder_.add_enabled_modes(enabled_modes);
3633   builder_.add_triggering_options(triggering_options);
3634   builder_.add_datetime_model(datetime_model);
3635   builder_.add_regex_model(regex_model);
3636   builder_.add_classification_options(classification_options);
3637   builder_.add_selection_options(selection_options);
3638   builder_.add_embedding_model(embedding_model);
3639   builder_.add_classification_model(classification_model);
3640   builder_.add_selection_model(selection_model);
3641   builder_.add_classification_feature_options(classification_feature_options);
3642   builder_.add_selection_feature_options(selection_feature_options);
3643   builder_.add_name(name);
3644   builder_.add_version(version);
3645   builder_.add_locales(locales);
3646   builder_.add_snap_whitespace_selections(snap_whitespace_selections);
3647   return builder_.Finish();
3648 }
3649 
3650 inline flatbuffers::Offset<Model> CreateModelDirect(
3651     flatbuffers::FlatBufferBuilder &_fbb,
3652     const char *locales = nullptr,
3653     int32_t version = 0,
3654     const char *name = nullptr,
3655     flatbuffers::Offset<libtextclassifier3::FeatureProcessorOptions> selection_feature_options = 0,
3656     flatbuffers::Offset<libtextclassifier3::FeatureProcessorOptions> classification_feature_options = 0,
3657     const std::vector<uint8_t> *selection_model = nullptr,
3658     const std::vector<uint8_t> *classification_model = nullptr,
3659     const std::vector<uint8_t> *embedding_model = nullptr,
3660     flatbuffers::Offset<libtextclassifier3::SelectionModelOptions> selection_options = 0,
3661     flatbuffers::Offset<libtextclassifier3::ClassificationModelOptions> classification_options = 0,
3662     flatbuffers::Offset<libtextclassifier3::RegexModel> regex_model = 0,
3663     flatbuffers::Offset<libtextclassifier3::DatetimeModel> datetime_model = 0,
3664     flatbuffers::Offset<libtextclassifier3::ModelTriggeringOptions> triggering_options = 0,
3665     libtextclassifier3::ModeFlag enabled_modes = libtextclassifier3::ModeFlag_ALL,
3666     bool snap_whitespace_selections = true,
3667     flatbuffers::Offset<libtextclassifier3::OutputOptions> output_options = 0,
3668     flatbuffers::Offset<libtextclassifier3::AndroidIntentFactoryOptions> android_intent_options = 0,
3669     flatbuffers::Offset<libtextclassifier3::IntentFactoryModel> intent_options = 0,
3670     flatbuffers::Offset<libtextclassifier3::ResourcePool> resources = 0,
3671     const std::vector<uint8_t> *entity_data_schema = nullptr,
3672     flatbuffers::Offset<libtextclassifier3::NumberAnnotatorOptions> number_annotator_options = 0,
3673     flatbuffers::Offset<libtextclassifier3::DurationAnnotatorOptions> duration_annotator_options = 0,
3674     const char *triggering_locales = nullptr,
3675     flatbuffers::Offset<libtextclassifier3::Model_::EmbeddingPruningMask> embedding_pruning_mask = 0,
3676     flatbuffers::Offset<libtextclassifier3::ContactAnnotatorOptions> contact_annotator_options = 0,
3677     flatbuffers::Offset<libtextclassifier3::MoneyParsingOptions> money_parsing_options = 0,
3678     flatbuffers::Offset<libtextclassifier3::TranslateAnnotatorOptions> translate_annotator_options = 0,
3679     flatbuffers::Offset<libtextclassifier3::GrammarModel> grammar_model = 0,
3680     flatbuffers::Offset<libtextclassifier3::Model_::ConflictResolutionOptions> conflict_resolution_options = 0,
3681     flatbuffers::Offset<libtextclassifier3::ExperimentalModel> experimental_model = 0,
3682     flatbuffers::Offset<libtextclassifier3::PodNerModel> pod_ner_model = 0,
3683     flatbuffers::Offset<libtextclassifier3::VocabModel> vocab_model = 0,
3684     flatbuffers::Offset<libtextclassifier3::GrammarModel> datetime_grammar_model = 0) {
3685   auto locales__ = locales ? _fbb.CreateSharedString(locales) : 0;
3686   auto name__ = name ? _fbb.CreateSharedString(name) : 0;
3687   if (selection_model) { _fbb.ForceVectorAlignment(selection_model->size(), sizeof(uint8_t), 16); }
3688   auto selection_model__ = selection_model ? _fbb.CreateVector<uint8_t>(*selection_model) : 0;
3689   if (classification_model) { _fbb.ForceVectorAlignment(classification_model->size(), sizeof(uint8_t), 16); }
3690   auto classification_model__ = classification_model ? _fbb.CreateVector<uint8_t>(*classification_model) : 0;
3691   if (embedding_model) { _fbb.ForceVectorAlignment(embedding_model->size(), sizeof(uint8_t), 16); }
3692   auto embedding_model__ = embedding_model ? _fbb.CreateVector<uint8_t>(*embedding_model) : 0;
3693   auto entity_data_schema__ = entity_data_schema ? _fbb.CreateVector<uint8_t>(*entity_data_schema) : 0;
3694   auto triggering_locales__ = triggering_locales ? _fbb.CreateSharedString(triggering_locales) : 0;
3695   return libtextclassifier3::CreateModel(
3696       _fbb,
3697       locales__,
3698       version,
3699       name__,
3700       selection_feature_options,
3701       classification_feature_options,
3702       selection_model__,
3703       classification_model__,
3704       embedding_model__,
3705       selection_options,
3706       classification_options,
3707       regex_model,
3708       datetime_model,
3709       triggering_options,
3710       enabled_modes,
3711       snap_whitespace_selections,
3712       output_options,
3713       android_intent_options,
3714       intent_options,
3715       resources,
3716       entity_data_schema__,
3717       number_annotator_options,
3718       duration_annotator_options,
3719       triggering_locales__,
3720       embedding_pruning_mask,
3721       contact_annotator_options,
3722       money_parsing_options,
3723       translate_annotator_options,
3724       grammar_model,
3725       conflict_resolution_options,
3726       experimental_model,
3727       pod_ner_model,
3728       vocab_model,
3729       datetime_grammar_model);
3730 }
3731 
3732 flatbuffers::Offset<Model> CreateModel(flatbuffers::FlatBufferBuilder &_fbb, const ModelT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
3733 
3734 namespace FeatureProcessorOptions_ {
3735 
3736 struct BoundsSensitiveFeaturesT : public flatbuffers::NativeTable {
3737   typedef BoundsSensitiveFeatures TableType;
3738   bool enabled = false;
3739   int32_t num_tokens_before = 0;
3740   int32_t num_tokens_inside_left = 0;
3741   int32_t num_tokens_inside_right = 0;
3742   int32_t num_tokens_after = 0;
3743   bool include_inside_bag = false;
3744   bool include_inside_length = false;
3745   bool score_single_token_spans_as_zero = false;
3746 };
3747 
3748 struct BoundsSensitiveFeatures FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
3749   typedef BoundsSensitiveFeaturesT NativeTableType;
3750   typedef BoundsSensitiveFeaturesBuilder Builder;
3751   enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
3752     VT_ENABLED = 4,
3753     VT_NUM_TOKENS_BEFORE = 6,
3754     VT_NUM_TOKENS_INSIDE_LEFT = 8,
3755     VT_NUM_TOKENS_INSIDE_RIGHT = 10,
3756     VT_NUM_TOKENS_AFTER = 12,
3757     VT_INCLUDE_INSIDE_BAG = 14,
3758     VT_INCLUDE_INSIDE_LENGTH = 16,
3759     VT_SCORE_SINGLE_TOKEN_SPANS_AS_ZERO = 18
3760   };
enabledFLATBUFFERS_FINAL_CLASS3761   bool enabled() const {
3762     return GetField<uint8_t>(VT_ENABLED, 0) != 0;
3763   }
num_tokens_beforeFLATBUFFERS_FINAL_CLASS3764   int32_t num_tokens_before() const {
3765     return GetField<int32_t>(VT_NUM_TOKENS_BEFORE, 0);
3766   }
num_tokens_inside_leftFLATBUFFERS_FINAL_CLASS3767   int32_t num_tokens_inside_left() const {
3768     return GetField<int32_t>(VT_NUM_TOKENS_INSIDE_LEFT, 0);
3769   }
num_tokens_inside_rightFLATBUFFERS_FINAL_CLASS3770   int32_t num_tokens_inside_right() const {
3771     return GetField<int32_t>(VT_NUM_TOKENS_INSIDE_RIGHT, 0);
3772   }
num_tokens_afterFLATBUFFERS_FINAL_CLASS3773   int32_t num_tokens_after() const {
3774     return GetField<int32_t>(VT_NUM_TOKENS_AFTER, 0);
3775   }
include_inside_bagFLATBUFFERS_FINAL_CLASS3776   bool include_inside_bag() const {
3777     return GetField<uint8_t>(VT_INCLUDE_INSIDE_BAG, 0) != 0;
3778   }
include_inside_lengthFLATBUFFERS_FINAL_CLASS3779   bool include_inside_length() const {
3780     return GetField<uint8_t>(VT_INCLUDE_INSIDE_LENGTH, 0) != 0;
3781   }
score_single_token_spans_as_zeroFLATBUFFERS_FINAL_CLASS3782   bool score_single_token_spans_as_zero() const {
3783     return GetField<uint8_t>(VT_SCORE_SINGLE_TOKEN_SPANS_AS_ZERO, 0) != 0;
3784   }
VerifyFLATBUFFERS_FINAL_CLASS3785   bool Verify(flatbuffers::Verifier &verifier) const {
3786     return VerifyTableStart(verifier) &&
3787            VerifyField<uint8_t>(verifier, VT_ENABLED, 1) &&
3788            VerifyField<int32_t>(verifier, VT_NUM_TOKENS_BEFORE, 4) &&
3789            VerifyField<int32_t>(verifier, VT_NUM_TOKENS_INSIDE_LEFT, 4) &&
3790            VerifyField<int32_t>(verifier, VT_NUM_TOKENS_INSIDE_RIGHT, 4) &&
3791            VerifyField<int32_t>(verifier, VT_NUM_TOKENS_AFTER, 4) &&
3792            VerifyField<uint8_t>(verifier, VT_INCLUDE_INSIDE_BAG, 1) &&
3793            VerifyField<uint8_t>(verifier, VT_INCLUDE_INSIDE_LENGTH, 1) &&
3794            VerifyField<uint8_t>(verifier, VT_SCORE_SINGLE_TOKEN_SPANS_AS_ZERO, 1) &&
3795            verifier.EndTable();
3796   }
3797   BoundsSensitiveFeaturesT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const;
3798   void UnPackTo(BoundsSensitiveFeaturesT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const;
3799   static flatbuffers::Offset<BoundsSensitiveFeatures> Pack(flatbuffers::FlatBufferBuilder &_fbb, const BoundsSensitiveFeaturesT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
3800 };
3801 
3802 struct BoundsSensitiveFeaturesBuilder {
3803   typedef BoundsSensitiveFeatures Table;
3804   flatbuffers::FlatBufferBuilder &fbb_;
3805   flatbuffers::uoffset_t start_;
add_enabledBoundsSensitiveFeaturesBuilder3806   void add_enabled(bool enabled) {
3807     fbb_.AddElement<uint8_t>(BoundsSensitiveFeatures::VT_ENABLED, static_cast<uint8_t>(enabled), 0);
3808   }
add_num_tokens_beforeBoundsSensitiveFeaturesBuilder3809   void add_num_tokens_before(int32_t num_tokens_before) {
3810     fbb_.AddElement<int32_t>(BoundsSensitiveFeatures::VT_NUM_TOKENS_BEFORE, num_tokens_before, 0);
3811   }
add_num_tokens_inside_leftBoundsSensitiveFeaturesBuilder3812   void add_num_tokens_inside_left(int32_t num_tokens_inside_left) {
3813     fbb_.AddElement<int32_t>(BoundsSensitiveFeatures::VT_NUM_TOKENS_INSIDE_LEFT, num_tokens_inside_left, 0);
3814   }
add_num_tokens_inside_rightBoundsSensitiveFeaturesBuilder3815   void add_num_tokens_inside_right(int32_t num_tokens_inside_right) {
3816     fbb_.AddElement<int32_t>(BoundsSensitiveFeatures::VT_NUM_TOKENS_INSIDE_RIGHT, num_tokens_inside_right, 0);
3817   }
add_num_tokens_afterBoundsSensitiveFeaturesBuilder3818   void add_num_tokens_after(int32_t num_tokens_after) {
3819     fbb_.AddElement<int32_t>(BoundsSensitiveFeatures::VT_NUM_TOKENS_AFTER, num_tokens_after, 0);
3820   }
add_include_inside_bagBoundsSensitiveFeaturesBuilder3821   void add_include_inside_bag(bool include_inside_bag) {
3822     fbb_.AddElement<uint8_t>(BoundsSensitiveFeatures::VT_INCLUDE_INSIDE_BAG, static_cast<uint8_t>(include_inside_bag), 0);
3823   }
add_include_inside_lengthBoundsSensitiveFeaturesBuilder3824   void add_include_inside_length(bool include_inside_length) {
3825     fbb_.AddElement<uint8_t>(BoundsSensitiveFeatures::VT_INCLUDE_INSIDE_LENGTH, static_cast<uint8_t>(include_inside_length), 0);
3826   }
add_score_single_token_spans_as_zeroBoundsSensitiveFeaturesBuilder3827   void add_score_single_token_spans_as_zero(bool score_single_token_spans_as_zero) {
3828     fbb_.AddElement<uint8_t>(BoundsSensitiveFeatures::VT_SCORE_SINGLE_TOKEN_SPANS_AS_ZERO, static_cast<uint8_t>(score_single_token_spans_as_zero), 0);
3829   }
BoundsSensitiveFeaturesBuilderBoundsSensitiveFeaturesBuilder3830   explicit BoundsSensitiveFeaturesBuilder(flatbuffers::FlatBufferBuilder &_fbb)
3831         : fbb_(_fbb) {
3832     start_ = fbb_.StartTable();
3833   }
FinishBoundsSensitiveFeaturesBuilder3834   flatbuffers::Offset<BoundsSensitiveFeatures> Finish() {
3835     const auto end = fbb_.EndTable(start_);
3836     auto o = flatbuffers::Offset<BoundsSensitiveFeatures>(end);
3837     return o;
3838   }
3839 };
3840 
3841 inline flatbuffers::Offset<BoundsSensitiveFeatures> CreateBoundsSensitiveFeatures(
3842     flatbuffers::FlatBufferBuilder &_fbb,
3843     bool enabled = false,
3844     int32_t num_tokens_before = 0,
3845     int32_t num_tokens_inside_left = 0,
3846     int32_t num_tokens_inside_right = 0,
3847     int32_t num_tokens_after = 0,
3848     bool include_inside_bag = false,
3849     bool include_inside_length = false,
3850     bool score_single_token_spans_as_zero = false) {
3851   BoundsSensitiveFeaturesBuilder builder_(_fbb);
3852   builder_.add_num_tokens_after(num_tokens_after);
3853   builder_.add_num_tokens_inside_right(num_tokens_inside_right);
3854   builder_.add_num_tokens_inside_left(num_tokens_inside_left);
3855   builder_.add_num_tokens_before(num_tokens_before);
3856   builder_.add_score_single_token_spans_as_zero(score_single_token_spans_as_zero);
3857   builder_.add_include_inside_length(include_inside_length);
3858   builder_.add_include_inside_bag(include_inside_bag);
3859   builder_.add_enabled(enabled);
3860   return builder_.Finish();
3861 }
3862 
3863 flatbuffers::Offset<BoundsSensitiveFeatures> CreateBoundsSensitiveFeatures(flatbuffers::FlatBufferBuilder &_fbb, const BoundsSensitiveFeaturesT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
3864 
3865 }  // namespace FeatureProcessorOptions_
3866 
3867 struct FeatureProcessorOptionsT : public flatbuffers::NativeTable {
3868   typedef FeatureProcessorOptions TableType;
3869   int32_t num_buckets = -1;
3870   int32_t embedding_size = -1;
3871   int32_t embedding_quantization_bits = 8;
3872   int32_t context_size = -1;
3873   int32_t max_selection_span = -1;
3874   std::vector<int32_t> chargram_orders{};
3875   int32_t max_word_length = 20;
3876   bool unicode_aware_features = false;
3877   bool extract_case_feature = false;
3878   bool extract_selection_mask_feature = false;
3879   std::vector<std::string> regexp_feature{};
3880   bool remap_digits = false;
3881   bool lowercase_tokens = false;
3882   bool selection_reduced_output_space = true;
3883   std::vector<std::string> collections{};
3884   int32_t default_collection = -1;
3885   bool only_use_line_with_click = false;
3886   bool split_tokens_on_selection_boundaries = false;
3887   std::vector<std::unique_ptr<libtextclassifier3::TokenizationCodepointRangeT>> tokenization_codepoint_config{};
3888   libtextclassifier3::FeatureProcessorOptions_::CenterTokenSelectionMethod center_token_selection_method = libtextclassifier3::FeatureProcessorOptions_::CenterTokenSelectionMethod_DEFAULT_CENTER_TOKEN_METHOD;
3889   bool snap_label_span_boundaries_to_containing_tokens = false;
3890   std::vector<std::unique_ptr<libtextclassifier3::CodepointRangeT>> supported_codepoint_ranges{};
3891   std::vector<std::unique_ptr<libtextclassifier3::CodepointRangeT>> internal_tokenizer_codepoint_ranges{};
3892   float min_supported_codepoint_ratio = 0.0f;
3893   int32_t feature_version = 0;
3894   libtextclassifier3::TokenizationType tokenization_type = libtextclassifier3::TokenizationType_INTERNAL_TOKENIZER;
3895   bool icu_preserve_whitespace_tokens = false;
3896   std::vector<int32_t> ignored_span_boundary_codepoints{};
3897   std::unique_ptr<libtextclassifier3::FeatureProcessorOptions_::BoundsSensitiveFeaturesT> bounds_sensitive_features{};
3898   std::vector<std::string> allowed_chargrams{};
3899   bool tokenize_on_script_change = false;
3900   bool use_pipe_character_for_newline = true;
3901   FeatureProcessorOptionsT() = default;
3902   FeatureProcessorOptionsT(const FeatureProcessorOptionsT &o);
3903   FeatureProcessorOptionsT(FeatureProcessorOptionsT&&) FLATBUFFERS_NOEXCEPT = default;
3904   FeatureProcessorOptionsT &operator=(FeatureProcessorOptionsT o) FLATBUFFERS_NOEXCEPT;
3905 };
3906 
3907 struct FeatureProcessorOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
3908   typedef FeatureProcessorOptionsT NativeTableType;
3909   typedef FeatureProcessorOptionsBuilder Builder;
3910   enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
3911     VT_NUM_BUCKETS = 4,
3912     VT_EMBEDDING_SIZE = 6,
3913     VT_EMBEDDING_QUANTIZATION_BITS = 8,
3914     VT_CONTEXT_SIZE = 10,
3915     VT_MAX_SELECTION_SPAN = 12,
3916     VT_CHARGRAM_ORDERS = 14,
3917     VT_MAX_WORD_LENGTH = 16,
3918     VT_UNICODE_AWARE_FEATURES = 18,
3919     VT_EXTRACT_CASE_FEATURE = 20,
3920     VT_EXTRACT_SELECTION_MASK_FEATURE = 22,
3921     VT_REGEXP_FEATURE = 24,
3922     VT_REMAP_DIGITS = 26,
3923     VT_LOWERCASE_TOKENS = 28,
3924     VT_SELECTION_REDUCED_OUTPUT_SPACE = 30,
3925     VT_COLLECTIONS = 32,
3926     VT_DEFAULT_COLLECTION = 34,
3927     VT_ONLY_USE_LINE_WITH_CLICK = 36,
3928     VT_SPLIT_TOKENS_ON_SELECTION_BOUNDARIES = 38,
3929     VT_TOKENIZATION_CODEPOINT_CONFIG = 40,
3930     VT_CENTER_TOKEN_SELECTION_METHOD = 42,
3931     VT_SNAP_LABEL_SPAN_BOUNDARIES_TO_CONTAINING_TOKENS = 44,
3932     VT_SUPPORTED_CODEPOINT_RANGES = 46,
3933     VT_INTERNAL_TOKENIZER_CODEPOINT_RANGES = 48,
3934     VT_MIN_SUPPORTED_CODEPOINT_RATIO = 50,
3935     VT_FEATURE_VERSION = 52,
3936     VT_TOKENIZATION_TYPE = 54,
3937     VT_ICU_PRESERVE_WHITESPACE_TOKENS = 56,
3938     VT_IGNORED_SPAN_BOUNDARY_CODEPOINTS = 58,
3939     VT_BOUNDS_SENSITIVE_FEATURES = 60,
3940     VT_ALLOWED_CHARGRAMS = 62,
3941     VT_TOKENIZE_ON_SCRIPT_CHANGE = 64,
3942     VT_USE_PIPE_CHARACTER_FOR_NEWLINE = 66
3943   };
num_bucketsFLATBUFFERS_FINAL_CLASS3944   int32_t num_buckets() const {
3945     return GetField<int32_t>(VT_NUM_BUCKETS, -1);
3946   }
embedding_sizeFLATBUFFERS_FINAL_CLASS3947   int32_t embedding_size() const {
3948     return GetField<int32_t>(VT_EMBEDDING_SIZE, -1);
3949   }
embedding_quantization_bitsFLATBUFFERS_FINAL_CLASS3950   int32_t embedding_quantization_bits() const {
3951     return GetField<int32_t>(VT_EMBEDDING_QUANTIZATION_BITS, 8);
3952   }
context_sizeFLATBUFFERS_FINAL_CLASS3953   int32_t context_size() const {
3954     return GetField<int32_t>(VT_CONTEXT_SIZE, -1);
3955   }
max_selection_spanFLATBUFFERS_FINAL_CLASS3956   int32_t max_selection_span() const {
3957     return GetField<int32_t>(VT_MAX_SELECTION_SPAN, -1);
3958   }
chargram_ordersFLATBUFFERS_FINAL_CLASS3959   const flatbuffers::Vector<int32_t> *chargram_orders() const {
3960     return GetPointer<const flatbuffers::Vector<int32_t> *>(VT_CHARGRAM_ORDERS);
3961   }
max_word_lengthFLATBUFFERS_FINAL_CLASS3962   int32_t max_word_length() const {
3963     return GetField<int32_t>(VT_MAX_WORD_LENGTH, 20);
3964   }
unicode_aware_featuresFLATBUFFERS_FINAL_CLASS3965   bool unicode_aware_features() const {
3966     return GetField<uint8_t>(VT_UNICODE_AWARE_FEATURES, 0) != 0;
3967   }
extract_case_featureFLATBUFFERS_FINAL_CLASS3968   bool extract_case_feature() const {
3969     return GetField<uint8_t>(VT_EXTRACT_CASE_FEATURE, 0) != 0;
3970   }
extract_selection_mask_featureFLATBUFFERS_FINAL_CLASS3971   bool extract_selection_mask_feature() const {
3972     return GetField<uint8_t>(VT_EXTRACT_SELECTION_MASK_FEATURE, 0) != 0;
3973   }
regexp_featureFLATBUFFERS_FINAL_CLASS3974   const flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>> *regexp_feature() const {
3975     return GetPointer<const flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>> *>(VT_REGEXP_FEATURE);
3976   }
remap_digitsFLATBUFFERS_FINAL_CLASS3977   bool remap_digits() const {
3978     return GetField<uint8_t>(VT_REMAP_DIGITS, 0) != 0;
3979   }
lowercase_tokensFLATBUFFERS_FINAL_CLASS3980   bool lowercase_tokens() const {
3981     return GetField<uint8_t>(VT_LOWERCASE_TOKENS, 0) != 0;
3982   }
selection_reduced_output_spaceFLATBUFFERS_FINAL_CLASS3983   bool selection_reduced_output_space() const {
3984     return GetField<uint8_t>(VT_SELECTION_REDUCED_OUTPUT_SPACE, 1) != 0;
3985   }
collectionsFLATBUFFERS_FINAL_CLASS3986   const flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>> *collections() const {
3987     return GetPointer<const flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>> *>(VT_COLLECTIONS);
3988   }
default_collectionFLATBUFFERS_FINAL_CLASS3989   int32_t default_collection() const {
3990     return GetField<int32_t>(VT_DEFAULT_COLLECTION, -1);
3991   }
only_use_line_with_clickFLATBUFFERS_FINAL_CLASS3992   bool only_use_line_with_click() const {
3993     return GetField<uint8_t>(VT_ONLY_USE_LINE_WITH_CLICK, 0) != 0;
3994   }
split_tokens_on_selection_boundariesFLATBUFFERS_FINAL_CLASS3995   bool split_tokens_on_selection_boundaries() const {
3996     return GetField<uint8_t>(VT_SPLIT_TOKENS_ON_SELECTION_BOUNDARIES, 0) != 0;
3997   }
tokenization_codepoint_configFLATBUFFERS_FINAL_CLASS3998   const flatbuffers::Vector<flatbuffers::Offset<libtextclassifier3::TokenizationCodepointRange>> *tokenization_codepoint_config() const {
3999     return GetPointer<const flatbuffers::Vector<flatbuffers::Offset<libtextclassifier3::TokenizationCodepointRange>> *>(VT_TOKENIZATION_CODEPOINT_CONFIG);
4000   }
center_token_selection_methodFLATBUFFERS_FINAL_CLASS4001   libtextclassifier3::FeatureProcessorOptions_::CenterTokenSelectionMethod center_token_selection_method() const {
4002     return static_cast<libtextclassifier3::FeatureProcessorOptions_::CenterTokenSelectionMethod>(GetField<int32_t>(VT_CENTER_TOKEN_SELECTION_METHOD, 0));
4003   }
snap_label_span_boundaries_to_containing_tokensFLATBUFFERS_FINAL_CLASS4004   bool snap_label_span_boundaries_to_containing_tokens() const {
4005     return GetField<uint8_t>(VT_SNAP_LABEL_SPAN_BOUNDARIES_TO_CONTAINING_TOKENS, 0) != 0;
4006   }
supported_codepoint_rangesFLATBUFFERS_FINAL_CLASS4007   const flatbuffers::Vector<flatbuffers::Offset<libtextclassifier3::CodepointRange>> *supported_codepoint_ranges() const {
4008     return GetPointer<const flatbuffers::Vector<flatbuffers::Offset<libtextclassifier3::CodepointRange>> *>(VT_SUPPORTED_CODEPOINT_RANGES);
4009   }
internal_tokenizer_codepoint_rangesFLATBUFFERS_FINAL_CLASS4010   const flatbuffers::Vector<flatbuffers::Offset<libtextclassifier3::CodepointRange>> *internal_tokenizer_codepoint_ranges() const {
4011     return GetPointer<const flatbuffers::Vector<flatbuffers::Offset<libtextclassifier3::CodepointRange>> *>(VT_INTERNAL_TOKENIZER_CODEPOINT_RANGES);
4012   }
min_supported_codepoint_ratioFLATBUFFERS_FINAL_CLASS4013   float min_supported_codepoint_ratio() const {
4014     return GetField<float>(VT_MIN_SUPPORTED_CODEPOINT_RATIO, 0.0f);
4015   }
feature_versionFLATBUFFERS_FINAL_CLASS4016   int32_t feature_version() const {
4017     return GetField<int32_t>(VT_FEATURE_VERSION, 0);
4018   }
tokenization_typeFLATBUFFERS_FINAL_CLASS4019   libtextclassifier3::TokenizationType tokenization_type() const {
4020     return static_cast<libtextclassifier3::TokenizationType>(GetField<int32_t>(VT_TOKENIZATION_TYPE, 1));
4021   }
icu_preserve_whitespace_tokensFLATBUFFERS_FINAL_CLASS4022   bool icu_preserve_whitespace_tokens() const {
4023     return GetField<uint8_t>(VT_ICU_PRESERVE_WHITESPACE_TOKENS, 0) != 0;
4024   }
ignored_span_boundary_codepointsFLATBUFFERS_FINAL_CLASS4025   const flatbuffers::Vector<int32_t> *ignored_span_boundary_codepoints() const {
4026     return GetPointer<const flatbuffers::Vector<int32_t> *>(VT_IGNORED_SPAN_BOUNDARY_CODEPOINTS);
4027   }
bounds_sensitive_featuresFLATBUFFERS_FINAL_CLASS4028   const libtextclassifier3::FeatureProcessorOptions_::BoundsSensitiveFeatures *bounds_sensitive_features() const {
4029     return GetPointer<const libtextclassifier3::FeatureProcessorOptions_::BoundsSensitiveFeatures *>(VT_BOUNDS_SENSITIVE_FEATURES);
4030   }
allowed_chargramsFLATBUFFERS_FINAL_CLASS4031   const flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>> *allowed_chargrams() const {
4032     return GetPointer<const flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>> *>(VT_ALLOWED_CHARGRAMS);
4033   }
tokenize_on_script_changeFLATBUFFERS_FINAL_CLASS4034   bool tokenize_on_script_change() const {
4035     return GetField<uint8_t>(VT_TOKENIZE_ON_SCRIPT_CHANGE, 0) != 0;
4036   }
use_pipe_character_for_newlineFLATBUFFERS_FINAL_CLASS4037   bool use_pipe_character_for_newline() const {
4038     return GetField<uint8_t>(VT_USE_PIPE_CHARACTER_FOR_NEWLINE, 1) != 0;
4039   }
VerifyFLATBUFFERS_FINAL_CLASS4040   bool Verify(flatbuffers::Verifier &verifier) const {
4041     return VerifyTableStart(verifier) &&
4042            VerifyField<int32_t>(verifier, VT_NUM_BUCKETS, 4) &&
4043            VerifyField<int32_t>(verifier, VT_EMBEDDING_SIZE, 4) &&
4044            VerifyField<int32_t>(verifier, VT_EMBEDDING_QUANTIZATION_BITS, 4) &&
4045            VerifyField<int32_t>(verifier, VT_CONTEXT_SIZE, 4) &&
4046            VerifyField<int32_t>(verifier, VT_MAX_SELECTION_SPAN, 4) &&
4047            VerifyOffset(verifier, VT_CHARGRAM_ORDERS) &&
4048            verifier.VerifyVector(chargram_orders()) &&
4049            VerifyField<int32_t>(verifier, VT_MAX_WORD_LENGTH, 4) &&
4050            VerifyField<uint8_t>(verifier, VT_UNICODE_AWARE_FEATURES, 1) &&
4051            VerifyField<uint8_t>(verifier, VT_EXTRACT_CASE_FEATURE, 1) &&
4052            VerifyField<uint8_t>(verifier, VT_EXTRACT_SELECTION_MASK_FEATURE, 1) &&
4053            VerifyOffset(verifier, VT_REGEXP_FEATURE) &&
4054            verifier.VerifyVector(regexp_feature()) &&
4055            verifier.VerifyVectorOfStrings(regexp_feature()) &&
4056            VerifyField<uint8_t>(verifier, VT_REMAP_DIGITS, 1) &&
4057            VerifyField<uint8_t>(verifier, VT_LOWERCASE_TOKENS, 1) &&
4058            VerifyField<uint8_t>(verifier, VT_SELECTION_REDUCED_OUTPUT_SPACE, 1) &&
4059            VerifyOffset(verifier, VT_COLLECTIONS) &&
4060            verifier.VerifyVector(collections()) &&
4061            verifier.VerifyVectorOfStrings(collections()) &&
4062            VerifyField<int32_t>(verifier, VT_DEFAULT_COLLECTION, 4) &&
4063            VerifyField<uint8_t>(verifier, VT_ONLY_USE_LINE_WITH_CLICK, 1) &&
4064            VerifyField<uint8_t>(verifier, VT_SPLIT_TOKENS_ON_SELECTION_BOUNDARIES, 1) &&
4065            VerifyOffset(verifier, VT_TOKENIZATION_CODEPOINT_CONFIG) &&
4066            verifier.VerifyVector(tokenization_codepoint_config()) &&
4067            verifier.VerifyVectorOfTables(tokenization_codepoint_config()) &&
4068            VerifyField<int32_t>(verifier, VT_CENTER_TOKEN_SELECTION_METHOD, 4) &&
4069            VerifyField<uint8_t>(verifier, VT_SNAP_LABEL_SPAN_BOUNDARIES_TO_CONTAINING_TOKENS, 1) &&
4070            VerifyOffset(verifier, VT_SUPPORTED_CODEPOINT_RANGES) &&
4071            verifier.VerifyVector(supported_codepoint_ranges()) &&
4072            verifier.VerifyVectorOfTables(supported_codepoint_ranges()) &&
4073            VerifyOffset(verifier, VT_INTERNAL_TOKENIZER_CODEPOINT_RANGES) &&
4074            verifier.VerifyVector(internal_tokenizer_codepoint_ranges()) &&
4075            verifier.VerifyVectorOfTables(internal_tokenizer_codepoint_ranges()) &&
4076            VerifyField<float>(verifier, VT_MIN_SUPPORTED_CODEPOINT_RATIO, 4) &&
4077            VerifyField<int32_t>(verifier, VT_FEATURE_VERSION, 4) &&
4078            VerifyField<int32_t>(verifier, VT_TOKENIZATION_TYPE, 4) &&
4079            VerifyField<uint8_t>(verifier, VT_ICU_PRESERVE_WHITESPACE_TOKENS, 1) &&
4080            VerifyOffset(verifier, VT_IGNORED_SPAN_BOUNDARY_CODEPOINTS) &&
4081            verifier.VerifyVector(ignored_span_boundary_codepoints()) &&
4082            VerifyOffset(verifier, VT_BOUNDS_SENSITIVE_FEATURES) &&
4083            verifier.VerifyTable(bounds_sensitive_features()) &&
4084            VerifyOffset(verifier, VT_ALLOWED_CHARGRAMS) &&
4085            verifier.VerifyVector(allowed_chargrams()) &&
4086            verifier.VerifyVectorOfStrings(allowed_chargrams()) &&
4087            VerifyField<uint8_t>(verifier, VT_TOKENIZE_ON_SCRIPT_CHANGE, 1) &&
4088            VerifyField<uint8_t>(verifier, VT_USE_PIPE_CHARACTER_FOR_NEWLINE, 1) &&
4089            verifier.EndTable();
4090   }
4091   FeatureProcessorOptionsT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const;
4092   void UnPackTo(FeatureProcessorOptionsT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const;
4093   static flatbuffers::Offset<FeatureProcessorOptions> Pack(flatbuffers::FlatBufferBuilder &_fbb, const FeatureProcessorOptionsT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
4094 };
4095 
4096 struct FeatureProcessorOptionsBuilder {
4097   typedef FeatureProcessorOptions Table;
4098   flatbuffers::FlatBufferBuilder &fbb_;
4099   flatbuffers::uoffset_t start_;
add_num_bucketsFeatureProcessorOptionsBuilder4100   void add_num_buckets(int32_t num_buckets) {
4101     fbb_.AddElement<int32_t>(FeatureProcessorOptions::VT_NUM_BUCKETS, num_buckets, -1);
4102   }
add_embedding_sizeFeatureProcessorOptionsBuilder4103   void add_embedding_size(int32_t embedding_size) {
4104     fbb_.AddElement<int32_t>(FeatureProcessorOptions::VT_EMBEDDING_SIZE, embedding_size, -1);
4105   }
add_embedding_quantization_bitsFeatureProcessorOptionsBuilder4106   void add_embedding_quantization_bits(int32_t embedding_quantization_bits) {
4107     fbb_.AddElement<int32_t>(FeatureProcessorOptions::VT_EMBEDDING_QUANTIZATION_BITS, embedding_quantization_bits, 8);
4108   }
add_context_sizeFeatureProcessorOptionsBuilder4109   void add_context_size(int32_t context_size) {
4110     fbb_.AddElement<int32_t>(FeatureProcessorOptions::VT_CONTEXT_SIZE, context_size, -1);
4111   }
add_max_selection_spanFeatureProcessorOptionsBuilder4112   void add_max_selection_span(int32_t max_selection_span) {
4113     fbb_.AddElement<int32_t>(FeatureProcessorOptions::VT_MAX_SELECTION_SPAN, max_selection_span, -1);
4114   }
add_chargram_ordersFeatureProcessorOptionsBuilder4115   void add_chargram_orders(flatbuffers::Offset<flatbuffers::Vector<int32_t>> chargram_orders) {
4116     fbb_.AddOffset(FeatureProcessorOptions::VT_CHARGRAM_ORDERS, chargram_orders);
4117   }
add_max_word_lengthFeatureProcessorOptionsBuilder4118   void add_max_word_length(int32_t max_word_length) {
4119     fbb_.AddElement<int32_t>(FeatureProcessorOptions::VT_MAX_WORD_LENGTH, max_word_length, 20);
4120   }
add_unicode_aware_featuresFeatureProcessorOptionsBuilder4121   void add_unicode_aware_features(bool unicode_aware_features) {
4122     fbb_.AddElement<uint8_t>(FeatureProcessorOptions::VT_UNICODE_AWARE_FEATURES, static_cast<uint8_t>(unicode_aware_features), 0);
4123   }
add_extract_case_featureFeatureProcessorOptionsBuilder4124   void add_extract_case_feature(bool extract_case_feature) {
4125     fbb_.AddElement<uint8_t>(FeatureProcessorOptions::VT_EXTRACT_CASE_FEATURE, static_cast<uint8_t>(extract_case_feature), 0);
4126   }
add_extract_selection_mask_featureFeatureProcessorOptionsBuilder4127   void add_extract_selection_mask_feature(bool extract_selection_mask_feature) {
4128     fbb_.AddElement<uint8_t>(FeatureProcessorOptions::VT_EXTRACT_SELECTION_MASK_FEATURE, static_cast<uint8_t>(extract_selection_mask_feature), 0);
4129   }
add_regexp_featureFeatureProcessorOptionsBuilder4130   void add_regexp_feature(flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>>> regexp_feature) {
4131     fbb_.AddOffset(FeatureProcessorOptions::VT_REGEXP_FEATURE, regexp_feature);
4132   }
add_remap_digitsFeatureProcessorOptionsBuilder4133   void add_remap_digits(bool remap_digits) {
4134     fbb_.AddElement<uint8_t>(FeatureProcessorOptions::VT_REMAP_DIGITS, static_cast<uint8_t>(remap_digits), 0);
4135   }
add_lowercase_tokensFeatureProcessorOptionsBuilder4136   void add_lowercase_tokens(bool lowercase_tokens) {
4137     fbb_.AddElement<uint8_t>(FeatureProcessorOptions::VT_LOWERCASE_TOKENS, static_cast<uint8_t>(lowercase_tokens), 0);
4138   }
add_selection_reduced_output_spaceFeatureProcessorOptionsBuilder4139   void add_selection_reduced_output_space(bool selection_reduced_output_space) {
4140     fbb_.AddElement<uint8_t>(FeatureProcessorOptions::VT_SELECTION_REDUCED_OUTPUT_SPACE, static_cast<uint8_t>(selection_reduced_output_space), 1);
4141   }
add_collectionsFeatureProcessorOptionsBuilder4142   void add_collections(flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>>> collections) {
4143     fbb_.AddOffset(FeatureProcessorOptions::VT_COLLECTIONS, collections);
4144   }
add_default_collectionFeatureProcessorOptionsBuilder4145   void add_default_collection(int32_t default_collection) {
4146     fbb_.AddElement<int32_t>(FeatureProcessorOptions::VT_DEFAULT_COLLECTION, default_collection, -1);
4147   }
add_only_use_line_with_clickFeatureProcessorOptionsBuilder4148   void add_only_use_line_with_click(bool only_use_line_with_click) {
4149     fbb_.AddElement<uint8_t>(FeatureProcessorOptions::VT_ONLY_USE_LINE_WITH_CLICK, static_cast<uint8_t>(only_use_line_with_click), 0);
4150   }
add_split_tokens_on_selection_boundariesFeatureProcessorOptionsBuilder4151   void add_split_tokens_on_selection_boundaries(bool split_tokens_on_selection_boundaries) {
4152     fbb_.AddElement<uint8_t>(FeatureProcessorOptions::VT_SPLIT_TOKENS_ON_SELECTION_BOUNDARIES, static_cast<uint8_t>(split_tokens_on_selection_boundaries), 0);
4153   }
add_tokenization_codepoint_configFeatureProcessorOptionsBuilder4154   void add_tokenization_codepoint_config(flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<libtextclassifier3::TokenizationCodepointRange>>> tokenization_codepoint_config) {
4155     fbb_.AddOffset(FeatureProcessorOptions::VT_TOKENIZATION_CODEPOINT_CONFIG, tokenization_codepoint_config);
4156   }
add_center_token_selection_methodFeatureProcessorOptionsBuilder4157   void add_center_token_selection_method(libtextclassifier3::FeatureProcessorOptions_::CenterTokenSelectionMethod center_token_selection_method) {
4158     fbb_.AddElement<int32_t>(FeatureProcessorOptions::VT_CENTER_TOKEN_SELECTION_METHOD, static_cast<int32_t>(center_token_selection_method), 0);
4159   }
add_snap_label_span_boundaries_to_containing_tokensFeatureProcessorOptionsBuilder4160   void add_snap_label_span_boundaries_to_containing_tokens(bool snap_label_span_boundaries_to_containing_tokens) {
4161     fbb_.AddElement<uint8_t>(FeatureProcessorOptions::VT_SNAP_LABEL_SPAN_BOUNDARIES_TO_CONTAINING_TOKENS, static_cast<uint8_t>(snap_label_span_boundaries_to_containing_tokens), 0);
4162   }
add_supported_codepoint_rangesFeatureProcessorOptionsBuilder4163   void add_supported_codepoint_ranges(flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<libtextclassifier3::CodepointRange>>> supported_codepoint_ranges) {
4164     fbb_.AddOffset(FeatureProcessorOptions::VT_SUPPORTED_CODEPOINT_RANGES, supported_codepoint_ranges);
4165   }
add_internal_tokenizer_codepoint_rangesFeatureProcessorOptionsBuilder4166   void add_internal_tokenizer_codepoint_ranges(flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<libtextclassifier3::CodepointRange>>> internal_tokenizer_codepoint_ranges) {
4167     fbb_.AddOffset(FeatureProcessorOptions::VT_INTERNAL_TOKENIZER_CODEPOINT_RANGES, internal_tokenizer_codepoint_ranges);
4168   }
add_min_supported_codepoint_ratioFeatureProcessorOptionsBuilder4169   void add_min_supported_codepoint_ratio(float min_supported_codepoint_ratio) {
4170     fbb_.AddElement<float>(FeatureProcessorOptions::VT_MIN_SUPPORTED_CODEPOINT_RATIO, min_supported_codepoint_ratio, 0.0f);
4171   }
add_feature_versionFeatureProcessorOptionsBuilder4172   void add_feature_version(int32_t feature_version) {
4173     fbb_.AddElement<int32_t>(FeatureProcessorOptions::VT_FEATURE_VERSION, feature_version, 0);
4174   }
add_tokenization_typeFeatureProcessorOptionsBuilder4175   void add_tokenization_type(libtextclassifier3::TokenizationType tokenization_type) {
4176     fbb_.AddElement<int32_t>(FeatureProcessorOptions::VT_TOKENIZATION_TYPE, static_cast<int32_t>(tokenization_type), 1);
4177   }
add_icu_preserve_whitespace_tokensFeatureProcessorOptionsBuilder4178   void add_icu_preserve_whitespace_tokens(bool icu_preserve_whitespace_tokens) {
4179     fbb_.AddElement<uint8_t>(FeatureProcessorOptions::VT_ICU_PRESERVE_WHITESPACE_TOKENS, static_cast<uint8_t>(icu_preserve_whitespace_tokens), 0);
4180   }
add_ignored_span_boundary_codepointsFeatureProcessorOptionsBuilder4181   void add_ignored_span_boundary_codepoints(flatbuffers::Offset<flatbuffers::Vector<int32_t>> ignored_span_boundary_codepoints) {
4182     fbb_.AddOffset(FeatureProcessorOptions::VT_IGNORED_SPAN_BOUNDARY_CODEPOINTS, ignored_span_boundary_codepoints);
4183   }
add_bounds_sensitive_featuresFeatureProcessorOptionsBuilder4184   void add_bounds_sensitive_features(flatbuffers::Offset<libtextclassifier3::FeatureProcessorOptions_::BoundsSensitiveFeatures> bounds_sensitive_features) {
4185     fbb_.AddOffset(FeatureProcessorOptions::VT_BOUNDS_SENSITIVE_FEATURES, bounds_sensitive_features);
4186   }
add_allowed_chargramsFeatureProcessorOptionsBuilder4187   void add_allowed_chargrams(flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>>> allowed_chargrams) {
4188     fbb_.AddOffset(FeatureProcessorOptions::VT_ALLOWED_CHARGRAMS, allowed_chargrams);
4189   }
add_tokenize_on_script_changeFeatureProcessorOptionsBuilder4190   void add_tokenize_on_script_change(bool tokenize_on_script_change) {
4191     fbb_.AddElement<uint8_t>(FeatureProcessorOptions::VT_TOKENIZE_ON_SCRIPT_CHANGE, static_cast<uint8_t>(tokenize_on_script_change), 0);
4192   }
add_use_pipe_character_for_newlineFeatureProcessorOptionsBuilder4193   void add_use_pipe_character_for_newline(bool use_pipe_character_for_newline) {
4194     fbb_.AddElement<uint8_t>(FeatureProcessorOptions::VT_USE_PIPE_CHARACTER_FOR_NEWLINE, static_cast<uint8_t>(use_pipe_character_for_newline), 1);
4195   }
FeatureProcessorOptionsBuilderFeatureProcessorOptionsBuilder4196   explicit FeatureProcessorOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb)
4197         : fbb_(_fbb) {
4198     start_ = fbb_.StartTable();
4199   }
FinishFeatureProcessorOptionsBuilder4200   flatbuffers::Offset<FeatureProcessorOptions> Finish() {
4201     const auto end = fbb_.EndTable(start_);
4202     auto o = flatbuffers::Offset<FeatureProcessorOptions>(end);
4203     return o;
4204   }
4205 };
4206 
4207 inline flatbuffers::Offset<FeatureProcessorOptions> CreateFeatureProcessorOptions(
4208     flatbuffers::FlatBufferBuilder &_fbb,
4209     int32_t num_buckets = -1,
4210     int32_t embedding_size = -1,
4211     int32_t embedding_quantization_bits = 8,
4212     int32_t context_size = -1,
4213     int32_t max_selection_span = -1,
4214     flatbuffers::Offset<flatbuffers::Vector<int32_t>> chargram_orders = 0,
4215     int32_t max_word_length = 20,
4216     bool unicode_aware_features = false,
4217     bool extract_case_feature = false,
4218     bool extract_selection_mask_feature = false,
4219     flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>>> regexp_feature = 0,
4220     bool remap_digits = false,
4221     bool lowercase_tokens = false,
4222     bool selection_reduced_output_space = true,
4223     flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>>> collections = 0,
4224     int32_t default_collection = -1,
4225     bool only_use_line_with_click = false,
4226     bool split_tokens_on_selection_boundaries = false,
4227     flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<libtextclassifier3::TokenizationCodepointRange>>> tokenization_codepoint_config = 0,
4228     libtextclassifier3::FeatureProcessorOptions_::CenterTokenSelectionMethod center_token_selection_method = libtextclassifier3::FeatureProcessorOptions_::CenterTokenSelectionMethod_DEFAULT_CENTER_TOKEN_METHOD,
4229     bool snap_label_span_boundaries_to_containing_tokens = false,
4230     flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<libtextclassifier3::CodepointRange>>> supported_codepoint_ranges = 0,
4231     flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<libtextclassifier3::CodepointRange>>> internal_tokenizer_codepoint_ranges = 0,
4232     float min_supported_codepoint_ratio = 0.0f,
4233     int32_t feature_version = 0,
4234     libtextclassifier3::TokenizationType tokenization_type = libtextclassifier3::TokenizationType_INTERNAL_TOKENIZER,
4235     bool icu_preserve_whitespace_tokens = false,
4236     flatbuffers::Offset<flatbuffers::Vector<int32_t>> ignored_span_boundary_codepoints = 0,
4237     flatbuffers::Offset<libtextclassifier3::FeatureProcessorOptions_::BoundsSensitiveFeatures> bounds_sensitive_features = 0,
4238     flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>>> allowed_chargrams = 0,
4239     bool tokenize_on_script_change = false,
4240     bool use_pipe_character_for_newline = true) {
4241   FeatureProcessorOptionsBuilder builder_(_fbb);
4242   builder_.add_allowed_chargrams(allowed_chargrams);
4243   builder_.add_bounds_sensitive_features(bounds_sensitive_features);
4244   builder_.add_ignored_span_boundary_codepoints(ignored_span_boundary_codepoints);
4245   builder_.add_tokenization_type(tokenization_type);
4246   builder_.add_feature_version(feature_version);
4247   builder_.add_min_supported_codepoint_ratio(min_supported_codepoint_ratio);
4248   builder_.add_internal_tokenizer_codepoint_ranges(internal_tokenizer_codepoint_ranges);
4249   builder_.add_supported_codepoint_ranges(supported_codepoint_ranges);
4250   builder_.add_center_token_selection_method(center_token_selection_method);
4251   builder_.add_tokenization_codepoint_config(tokenization_codepoint_config);
4252   builder_.add_default_collection(default_collection);
4253   builder_.add_collections(collections);
4254   builder_.add_regexp_feature(regexp_feature);
4255   builder_.add_max_word_length(max_word_length);
4256   builder_.add_chargram_orders(chargram_orders);
4257   builder_.add_max_selection_span(max_selection_span);
4258   builder_.add_context_size(context_size);
4259   builder_.add_embedding_quantization_bits(embedding_quantization_bits);
4260   builder_.add_embedding_size(embedding_size);
4261   builder_.add_num_buckets(num_buckets);
4262   builder_.add_use_pipe_character_for_newline(use_pipe_character_for_newline);
4263   builder_.add_tokenize_on_script_change(tokenize_on_script_change);
4264   builder_.add_icu_preserve_whitespace_tokens(icu_preserve_whitespace_tokens);
4265   builder_.add_snap_label_span_boundaries_to_containing_tokens(snap_label_span_boundaries_to_containing_tokens);
4266   builder_.add_split_tokens_on_selection_boundaries(split_tokens_on_selection_boundaries);
4267   builder_.add_only_use_line_with_click(only_use_line_with_click);
4268   builder_.add_selection_reduced_output_space(selection_reduced_output_space);
4269   builder_.add_lowercase_tokens(lowercase_tokens);
4270   builder_.add_remap_digits(remap_digits);
4271   builder_.add_extract_selection_mask_feature(extract_selection_mask_feature);
4272   builder_.add_extract_case_feature(extract_case_feature);
4273   builder_.add_unicode_aware_features(unicode_aware_features);
4274   return builder_.Finish();
4275 }
4276 
4277 inline flatbuffers::Offset<FeatureProcessorOptions> CreateFeatureProcessorOptionsDirect(
4278     flatbuffers::FlatBufferBuilder &_fbb,
4279     int32_t num_buckets = -1,
4280     int32_t embedding_size = -1,
4281     int32_t embedding_quantization_bits = 8,
4282     int32_t context_size = -1,
4283     int32_t max_selection_span = -1,
4284     const std::vector<int32_t> *chargram_orders = nullptr,
4285     int32_t max_word_length = 20,
4286     bool unicode_aware_features = false,
4287     bool extract_case_feature = false,
4288     bool extract_selection_mask_feature = false,
4289     const std::vector<flatbuffers::Offset<flatbuffers::String>> *regexp_feature = nullptr,
4290     bool remap_digits = false,
4291     bool lowercase_tokens = false,
4292     bool selection_reduced_output_space = true,
4293     const std::vector<flatbuffers::Offset<flatbuffers::String>> *collections = nullptr,
4294     int32_t default_collection = -1,
4295     bool only_use_line_with_click = false,
4296     bool split_tokens_on_selection_boundaries = false,
4297     const std::vector<flatbuffers::Offset<libtextclassifier3::TokenizationCodepointRange>> *tokenization_codepoint_config = nullptr,
4298     libtextclassifier3::FeatureProcessorOptions_::CenterTokenSelectionMethod center_token_selection_method = libtextclassifier3::FeatureProcessorOptions_::CenterTokenSelectionMethod_DEFAULT_CENTER_TOKEN_METHOD,
4299     bool snap_label_span_boundaries_to_containing_tokens = false,
4300     const std::vector<flatbuffers::Offset<libtextclassifier3::CodepointRange>> *supported_codepoint_ranges = nullptr,
4301     const std::vector<flatbuffers::Offset<libtextclassifier3::CodepointRange>> *internal_tokenizer_codepoint_ranges = nullptr,
4302     float min_supported_codepoint_ratio = 0.0f,
4303     int32_t feature_version = 0,
4304     libtextclassifier3::TokenizationType tokenization_type = libtextclassifier3::TokenizationType_INTERNAL_TOKENIZER,
4305     bool icu_preserve_whitespace_tokens = false,
4306     const std::vector<int32_t> *ignored_span_boundary_codepoints = nullptr,
4307     flatbuffers::Offset<libtextclassifier3::FeatureProcessorOptions_::BoundsSensitiveFeatures> bounds_sensitive_features = 0,
4308     const std::vector<flatbuffers::Offset<flatbuffers::String>> *allowed_chargrams = nullptr,
4309     bool tokenize_on_script_change = false,
4310     bool use_pipe_character_for_newline = true) {
4311   auto chargram_orders__ = chargram_orders ? _fbb.CreateVector<int32_t>(*chargram_orders) : 0;
4312   auto regexp_feature__ = regexp_feature ? _fbb.CreateVector<flatbuffers::Offset<flatbuffers::String>>(*regexp_feature) : 0;
4313   auto collections__ = collections ? _fbb.CreateVector<flatbuffers::Offset<flatbuffers::String>>(*collections) : 0;
4314   auto tokenization_codepoint_config__ = tokenization_codepoint_config ? _fbb.CreateVector<flatbuffers::Offset<libtextclassifier3::TokenizationCodepointRange>>(*tokenization_codepoint_config) : 0;
4315   auto supported_codepoint_ranges__ = supported_codepoint_ranges ? _fbb.CreateVector<flatbuffers::Offset<libtextclassifier3::CodepointRange>>(*supported_codepoint_ranges) : 0;
4316   auto internal_tokenizer_codepoint_ranges__ = internal_tokenizer_codepoint_ranges ? _fbb.CreateVector<flatbuffers::Offset<libtextclassifier3::CodepointRange>>(*internal_tokenizer_codepoint_ranges) : 0;
4317   auto ignored_span_boundary_codepoints__ = ignored_span_boundary_codepoints ? _fbb.CreateVector<int32_t>(*ignored_span_boundary_codepoints) : 0;
4318   auto allowed_chargrams__ = allowed_chargrams ? _fbb.CreateVector<flatbuffers::Offset<flatbuffers::String>>(*allowed_chargrams) : 0;
4319   return libtextclassifier3::CreateFeatureProcessorOptions(
4320       _fbb,
4321       num_buckets,
4322       embedding_size,
4323       embedding_quantization_bits,
4324       context_size,
4325       max_selection_span,
4326       chargram_orders__,
4327       max_word_length,
4328       unicode_aware_features,
4329       extract_case_feature,
4330       extract_selection_mask_feature,
4331       regexp_feature__,
4332       remap_digits,
4333       lowercase_tokens,
4334       selection_reduced_output_space,
4335       collections__,
4336       default_collection,
4337       only_use_line_with_click,
4338       split_tokens_on_selection_boundaries,
4339       tokenization_codepoint_config__,
4340       center_token_selection_method,
4341       snap_label_span_boundaries_to_containing_tokens,
4342       supported_codepoint_ranges__,
4343       internal_tokenizer_codepoint_ranges__,
4344       min_supported_codepoint_ratio,
4345       feature_version,
4346       tokenization_type,
4347       icu_preserve_whitespace_tokens,
4348       ignored_span_boundary_codepoints__,
4349       bounds_sensitive_features,
4350       allowed_chargrams__,
4351       tokenize_on_script_change,
4352       use_pipe_character_for_newline);
4353 }
4354 
4355 flatbuffers::Offset<FeatureProcessorOptions> CreateFeatureProcessorOptions(flatbuffers::FlatBufferBuilder &_fbb, const FeatureProcessorOptionsT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
4356 
4357 struct NumberAnnotatorOptionsT : public flatbuffers::NativeTable {
4358   typedef NumberAnnotatorOptions TableType;
4359   bool enabled = false;
4360   float score = 1.0f;
4361   float priority_score = 0.0f;
4362   libtextclassifier3::ModeFlag enabled_modes = libtextclassifier3::ModeFlag_ALL;
4363   uint32_t enabled_annotation_usecases = 4294967295;
4364   std::vector<int32_t> allowed_prefix_codepoints{};
4365   std::vector<int32_t> allowed_suffix_codepoints{};
4366   std::vector<int32_t> ignored_prefix_span_boundary_codepoints{};
4367   std::vector<int32_t> ignored_suffix_span_boundary_codepoints{};
4368   bool enable_percentage = false;
4369   std::string percentage_pieces_string{};
4370   std::vector<int32_t> percentage_pieces_offsets{};
4371   float percentage_priority_score = 1.0f;
4372   float float_number_priority_score = 0.0f;
4373   int32_t max_number_of_digits = 20;
4374   uint32_t percentage_annotation_usecases = 2;
4375 };
4376 
4377 struct NumberAnnotatorOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
4378   typedef NumberAnnotatorOptionsT NativeTableType;
4379   typedef NumberAnnotatorOptionsBuilder Builder;
4380   enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
4381     VT_ENABLED = 4,
4382     VT_SCORE = 6,
4383     VT_PRIORITY_SCORE = 8,
4384     VT_ENABLED_MODES = 10,
4385     VT_ENABLED_ANNOTATION_USECASES = 12,
4386     VT_ALLOWED_PREFIX_CODEPOINTS = 14,
4387     VT_ALLOWED_SUFFIX_CODEPOINTS = 16,
4388     VT_IGNORED_PREFIX_SPAN_BOUNDARY_CODEPOINTS = 18,
4389     VT_IGNORED_SUFFIX_SPAN_BOUNDARY_CODEPOINTS = 20,
4390     VT_ENABLE_PERCENTAGE = 22,
4391     VT_PERCENTAGE_PIECES_STRING = 24,
4392     VT_PERCENTAGE_PIECES_OFFSETS = 26,
4393     VT_PERCENTAGE_PRIORITY_SCORE = 28,
4394     VT_FLOAT_NUMBER_PRIORITY_SCORE = 30,
4395     VT_MAX_NUMBER_OF_DIGITS = 32,
4396     VT_PERCENTAGE_ANNOTATION_USECASES = 34
4397   };
enabledFLATBUFFERS_FINAL_CLASS4398   bool enabled() const {
4399     return GetField<uint8_t>(VT_ENABLED, 0) != 0;
4400   }
scoreFLATBUFFERS_FINAL_CLASS4401   float score() const {
4402     return GetField<float>(VT_SCORE, 1.0f);
4403   }
priority_scoreFLATBUFFERS_FINAL_CLASS4404   float priority_score() const {
4405     return GetField<float>(VT_PRIORITY_SCORE, 0.0f);
4406   }
enabled_modesFLATBUFFERS_FINAL_CLASS4407   libtextclassifier3::ModeFlag enabled_modes() const {
4408     return static_cast<libtextclassifier3::ModeFlag>(GetField<int32_t>(VT_ENABLED_MODES, 7));
4409   }
enabled_annotation_usecasesFLATBUFFERS_FINAL_CLASS4410   uint32_t enabled_annotation_usecases() const {
4411     return GetField<uint32_t>(VT_ENABLED_ANNOTATION_USECASES, 4294967295);
4412   }
allowed_prefix_codepointsFLATBUFFERS_FINAL_CLASS4413   const flatbuffers::Vector<int32_t> *allowed_prefix_codepoints() const {
4414     return GetPointer<const flatbuffers::Vector<int32_t> *>(VT_ALLOWED_PREFIX_CODEPOINTS);
4415   }
allowed_suffix_codepointsFLATBUFFERS_FINAL_CLASS4416   const flatbuffers::Vector<int32_t> *allowed_suffix_codepoints() const {
4417     return GetPointer<const flatbuffers::Vector<int32_t> *>(VT_ALLOWED_SUFFIX_CODEPOINTS);
4418   }
ignored_prefix_span_boundary_codepointsFLATBUFFERS_FINAL_CLASS4419   const flatbuffers::Vector<int32_t> *ignored_prefix_span_boundary_codepoints() const {
4420     return GetPointer<const flatbuffers::Vector<int32_t> *>(VT_IGNORED_PREFIX_SPAN_BOUNDARY_CODEPOINTS);
4421   }
ignored_suffix_span_boundary_codepointsFLATBUFFERS_FINAL_CLASS4422   const flatbuffers::Vector<int32_t> *ignored_suffix_span_boundary_codepoints() const {
4423     return GetPointer<const flatbuffers::Vector<int32_t> *>(VT_IGNORED_SUFFIX_SPAN_BOUNDARY_CODEPOINTS);
4424   }
enable_percentageFLATBUFFERS_FINAL_CLASS4425   bool enable_percentage() const {
4426     return GetField<uint8_t>(VT_ENABLE_PERCENTAGE, 0) != 0;
4427   }
percentage_pieces_stringFLATBUFFERS_FINAL_CLASS4428   const flatbuffers::String *percentage_pieces_string() const {
4429     return GetPointer<const flatbuffers::String *>(VT_PERCENTAGE_PIECES_STRING);
4430   }
percentage_pieces_offsetsFLATBUFFERS_FINAL_CLASS4431   const flatbuffers::Vector<int32_t> *percentage_pieces_offsets() const {
4432     return GetPointer<const flatbuffers::Vector<int32_t> *>(VT_PERCENTAGE_PIECES_OFFSETS);
4433   }
percentage_priority_scoreFLATBUFFERS_FINAL_CLASS4434   float percentage_priority_score() const {
4435     return GetField<float>(VT_PERCENTAGE_PRIORITY_SCORE, 1.0f);
4436   }
float_number_priority_scoreFLATBUFFERS_FINAL_CLASS4437   float float_number_priority_score() const {
4438     return GetField<float>(VT_FLOAT_NUMBER_PRIORITY_SCORE, 0.0f);
4439   }
max_number_of_digitsFLATBUFFERS_FINAL_CLASS4440   int32_t max_number_of_digits() const {
4441     return GetField<int32_t>(VT_MAX_NUMBER_OF_DIGITS, 20);
4442   }
percentage_annotation_usecasesFLATBUFFERS_FINAL_CLASS4443   uint32_t percentage_annotation_usecases() const {
4444     return GetField<uint32_t>(VT_PERCENTAGE_ANNOTATION_USECASES, 2);
4445   }
VerifyFLATBUFFERS_FINAL_CLASS4446   bool Verify(flatbuffers::Verifier &verifier) const {
4447     return VerifyTableStart(verifier) &&
4448            VerifyField<uint8_t>(verifier, VT_ENABLED, 1) &&
4449            VerifyField<float>(verifier, VT_SCORE, 4) &&
4450            VerifyField<float>(verifier, VT_PRIORITY_SCORE, 4) &&
4451            VerifyField<int32_t>(verifier, VT_ENABLED_MODES, 4) &&
4452            VerifyField<uint32_t>(verifier, VT_ENABLED_ANNOTATION_USECASES, 4) &&
4453            VerifyOffset(verifier, VT_ALLOWED_PREFIX_CODEPOINTS) &&
4454            verifier.VerifyVector(allowed_prefix_codepoints()) &&
4455            VerifyOffset(verifier, VT_ALLOWED_SUFFIX_CODEPOINTS) &&
4456            verifier.VerifyVector(allowed_suffix_codepoints()) &&
4457            VerifyOffset(verifier, VT_IGNORED_PREFIX_SPAN_BOUNDARY_CODEPOINTS) &&
4458            verifier.VerifyVector(ignored_prefix_span_boundary_codepoints()) &&
4459            VerifyOffset(verifier, VT_IGNORED_SUFFIX_SPAN_BOUNDARY_CODEPOINTS) &&
4460            verifier.VerifyVector(ignored_suffix_span_boundary_codepoints()) &&
4461            VerifyField<uint8_t>(verifier, VT_ENABLE_PERCENTAGE, 1) &&
4462            VerifyOffset(verifier, VT_PERCENTAGE_PIECES_STRING) &&
4463            verifier.VerifyString(percentage_pieces_string()) &&
4464            VerifyOffset(verifier, VT_PERCENTAGE_PIECES_OFFSETS) &&
4465            verifier.VerifyVector(percentage_pieces_offsets()) &&
4466            VerifyField<float>(verifier, VT_PERCENTAGE_PRIORITY_SCORE, 4) &&
4467            VerifyField<float>(verifier, VT_FLOAT_NUMBER_PRIORITY_SCORE, 4) &&
4468            VerifyField<int32_t>(verifier, VT_MAX_NUMBER_OF_DIGITS, 4) &&
4469            VerifyField<uint32_t>(verifier, VT_PERCENTAGE_ANNOTATION_USECASES, 4) &&
4470            verifier.EndTable();
4471   }
4472   NumberAnnotatorOptionsT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const;
4473   void UnPackTo(NumberAnnotatorOptionsT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const;
4474   static flatbuffers::Offset<NumberAnnotatorOptions> Pack(flatbuffers::FlatBufferBuilder &_fbb, const NumberAnnotatorOptionsT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
4475 };
4476 
4477 struct NumberAnnotatorOptionsBuilder {
4478   typedef NumberAnnotatorOptions Table;
4479   flatbuffers::FlatBufferBuilder &fbb_;
4480   flatbuffers::uoffset_t start_;
add_enabledNumberAnnotatorOptionsBuilder4481   void add_enabled(bool enabled) {
4482     fbb_.AddElement<uint8_t>(NumberAnnotatorOptions::VT_ENABLED, static_cast<uint8_t>(enabled), 0);
4483   }
add_scoreNumberAnnotatorOptionsBuilder4484   void add_score(float score) {
4485     fbb_.AddElement<float>(NumberAnnotatorOptions::VT_SCORE, score, 1.0f);
4486   }
add_priority_scoreNumberAnnotatorOptionsBuilder4487   void add_priority_score(float priority_score) {
4488     fbb_.AddElement<float>(NumberAnnotatorOptions::VT_PRIORITY_SCORE, priority_score, 0.0f);
4489   }
add_enabled_modesNumberAnnotatorOptionsBuilder4490   void add_enabled_modes(libtextclassifier3::ModeFlag enabled_modes) {
4491     fbb_.AddElement<int32_t>(NumberAnnotatorOptions::VT_ENABLED_MODES, static_cast<int32_t>(enabled_modes), 7);
4492   }
add_enabled_annotation_usecasesNumberAnnotatorOptionsBuilder4493   void add_enabled_annotation_usecases(uint32_t enabled_annotation_usecases) {
4494     fbb_.AddElement<uint32_t>(NumberAnnotatorOptions::VT_ENABLED_ANNOTATION_USECASES, enabled_annotation_usecases, 4294967295);
4495   }
add_allowed_prefix_codepointsNumberAnnotatorOptionsBuilder4496   void add_allowed_prefix_codepoints(flatbuffers::Offset<flatbuffers::Vector<int32_t>> allowed_prefix_codepoints) {
4497     fbb_.AddOffset(NumberAnnotatorOptions::VT_ALLOWED_PREFIX_CODEPOINTS, allowed_prefix_codepoints);
4498   }
add_allowed_suffix_codepointsNumberAnnotatorOptionsBuilder4499   void add_allowed_suffix_codepoints(flatbuffers::Offset<flatbuffers::Vector<int32_t>> allowed_suffix_codepoints) {
4500     fbb_.AddOffset(NumberAnnotatorOptions::VT_ALLOWED_SUFFIX_CODEPOINTS, allowed_suffix_codepoints);
4501   }
add_ignored_prefix_span_boundary_codepointsNumberAnnotatorOptionsBuilder4502   void add_ignored_prefix_span_boundary_codepoints(flatbuffers::Offset<flatbuffers::Vector<int32_t>> ignored_prefix_span_boundary_codepoints) {
4503     fbb_.AddOffset(NumberAnnotatorOptions::VT_IGNORED_PREFIX_SPAN_BOUNDARY_CODEPOINTS, ignored_prefix_span_boundary_codepoints);
4504   }
add_ignored_suffix_span_boundary_codepointsNumberAnnotatorOptionsBuilder4505   void add_ignored_suffix_span_boundary_codepoints(flatbuffers::Offset<flatbuffers::Vector<int32_t>> ignored_suffix_span_boundary_codepoints) {
4506     fbb_.AddOffset(NumberAnnotatorOptions::VT_IGNORED_SUFFIX_SPAN_BOUNDARY_CODEPOINTS, ignored_suffix_span_boundary_codepoints);
4507   }
add_enable_percentageNumberAnnotatorOptionsBuilder4508   void add_enable_percentage(bool enable_percentage) {
4509     fbb_.AddElement<uint8_t>(NumberAnnotatorOptions::VT_ENABLE_PERCENTAGE, static_cast<uint8_t>(enable_percentage), 0);
4510   }
add_percentage_pieces_stringNumberAnnotatorOptionsBuilder4511   void add_percentage_pieces_string(flatbuffers::Offset<flatbuffers::String> percentage_pieces_string) {
4512     fbb_.AddOffset(NumberAnnotatorOptions::VT_PERCENTAGE_PIECES_STRING, percentage_pieces_string);
4513   }
add_percentage_pieces_offsetsNumberAnnotatorOptionsBuilder4514   void add_percentage_pieces_offsets(flatbuffers::Offset<flatbuffers::Vector<int32_t>> percentage_pieces_offsets) {
4515     fbb_.AddOffset(NumberAnnotatorOptions::VT_PERCENTAGE_PIECES_OFFSETS, percentage_pieces_offsets);
4516   }
add_percentage_priority_scoreNumberAnnotatorOptionsBuilder4517   void add_percentage_priority_score(float percentage_priority_score) {
4518     fbb_.AddElement<float>(NumberAnnotatorOptions::VT_PERCENTAGE_PRIORITY_SCORE, percentage_priority_score, 1.0f);
4519   }
add_float_number_priority_scoreNumberAnnotatorOptionsBuilder4520   void add_float_number_priority_score(float float_number_priority_score) {
4521     fbb_.AddElement<float>(NumberAnnotatorOptions::VT_FLOAT_NUMBER_PRIORITY_SCORE, float_number_priority_score, 0.0f);
4522   }
add_max_number_of_digitsNumberAnnotatorOptionsBuilder4523   void add_max_number_of_digits(int32_t max_number_of_digits) {
4524     fbb_.AddElement<int32_t>(NumberAnnotatorOptions::VT_MAX_NUMBER_OF_DIGITS, max_number_of_digits, 20);
4525   }
add_percentage_annotation_usecasesNumberAnnotatorOptionsBuilder4526   void add_percentage_annotation_usecases(uint32_t percentage_annotation_usecases) {
4527     fbb_.AddElement<uint32_t>(NumberAnnotatorOptions::VT_PERCENTAGE_ANNOTATION_USECASES, percentage_annotation_usecases, 2);
4528   }
NumberAnnotatorOptionsBuilderNumberAnnotatorOptionsBuilder4529   explicit NumberAnnotatorOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb)
4530         : fbb_(_fbb) {
4531     start_ = fbb_.StartTable();
4532   }
FinishNumberAnnotatorOptionsBuilder4533   flatbuffers::Offset<NumberAnnotatorOptions> Finish() {
4534     const auto end = fbb_.EndTable(start_);
4535     auto o = flatbuffers::Offset<NumberAnnotatorOptions>(end);
4536     return o;
4537   }
4538 };
4539 
4540 inline flatbuffers::Offset<NumberAnnotatorOptions> CreateNumberAnnotatorOptions(
4541     flatbuffers::FlatBufferBuilder &_fbb,
4542     bool enabled = false,
4543     float score = 1.0f,
4544     float priority_score = 0.0f,
4545     libtextclassifier3::ModeFlag enabled_modes = libtextclassifier3::ModeFlag_ALL,
4546     uint32_t enabled_annotation_usecases = 4294967295,
4547     flatbuffers::Offset<flatbuffers::Vector<int32_t>> allowed_prefix_codepoints = 0,
4548     flatbuffers::Offset<flatbuffers::Vector<int32_t>> allowed_suffix_codepoints = 0,
4549     flatbuffers::Offset<flatbuffers::Vector<int32_t>> ignored_prefix_span_boundary_codepoints = 0,
4550     flatbuffers::Offset<flatbuffers::Vector<int32_t>> ignored_suffix_span_boundary_codepoints = 0,
4551     bool enable_percentage = false,
4552     flatbuffers::Offset<flatbuffers::String> percentage_pieces_string = 0,
4553     flatbuffers::Offset<flatbuffers::Vector<int32_t>> percentage_pieces_offsets = 0,
4554     float percentage_priority_score = 1.0f,
4555     float float_number_priority_score = 0.0f,
4556     int32_t max_number_of_digits = 20,
4557     uint32_t percentage_annotation_usecases = 2) {
4558   NumberAnnotatorOptionsBuilder builder_(_fbb);
4559   builder_.add_percentage_annotation_usecases(percentage_annotation_usecases);
4560   builder_.add_max_number_of_digits(max_number_of_digits);
4561   builder_.add_float_number_priority_score(float_number_priority_score);
4562   builder_.add_percentage_priority_score(percentage_priority_score);
4563   builder_.add_percentage_pieces_offsets(percentage_pieces_offsets);
4564   builder_.add_percentage_pieces_string(percentage_pieces_string);
4565   builder_.add_ignored_suffix_span_boundary_codepoints(ignored_suffix_span_boundary_codepoints);
4566   builder_.add_ignored_prefix_span_boundary_codepoints(ignored_prefix_span_boundary_codepoints);
4567   builder_.add_allowed_suffix_codepoints(allowed_suffix_codepoints);
4568   builder_.add_allowed_prefix_codepoints(allowed_prefix_codepoints);
4569   builder_.add_enabled_annotation_usecases(enabled_annotation_usecases);
4570   builder_.add_enabled_modes(enabled_modes);
4571   builder_.add_priority_score(priority_score);
4572   builder_.add_score(score);
4573   builder_.add_enable_percentage(enable_percentage);
4574   builder_.add_enabled(enabled);
4575   return builder_.Finish();
4576 }
4577 
4578 inline flatbuffers::Offset<NumberAnnotatorOptions> CreateNumberAnnotatorOptionsDirect(
4579     flatbuffers::FlatBufferBuilder &_fbb,
4580     bool enabled = false,
4581     float score = 1.0f,
4582     float priority_score = 0.0f,
4583     libtextclassifier3::ModeFlag enabled_modes = libtextclassifier3::ModeFlag_ALL,
4584     uint32_t enabled_annotation_usecases = 4294967295,
4585     const std::vector<int32_t> *allowed_prefix_codepoints = nullptr,
4586     const std::vector<int32_t> *allowed_suffix_codepoints = nullptr,
4587     const std::vector<int32_t> *ignored_prefix_span_boundary_codepoints = nullptr,
4588     const std::vector<int32_t> *ignored_suffix_span_boundary_codepoints = nullptr,
4589     bool enable_percentage = false,
4590     const char *percentage_pieces_string = nullptr,
4591     const std::vector<int32_t> *percentage_pieces_offsets = nullptr,
4592     float percentage_priority_score = 1.0f,
4593     float float_number_priority_score = 0.0f,
4594     int32_t max_number_of_digits = 20,
4595     uint32_t percentage_annotation_usecases = 2) {
4596   auto allowed_prefix_codepoints__ = allowed_prefix_codepoints ? _fbb.CreateVector<int32_t>(*allowed_prefix_codepoints) : 0;
4597   auto allowed_suffix_codepoints__ = allowed_suffix_codepoints ? _fbb.CreateVector<int32_t>(*allowed_suffix_codepoints) : 0;
4598   auto ignored_prefix_span_boundary_codepoints__ = ignored_prefix_span_boundary_codepoints ? _fbb.CreateVector<int32_t>(*ignored_prefix_span_boundary_codepoints) : 0;
4599   auto ignored_suffix_span_boundary_codepoints__ = ignored_suffix_span_boundary_codepoints ? _fbb.CreateVector<int32_t>(*ignored_suffix_span_boundary_codepoints) : 0;
4600   auto percentage_pieces_string__ = percentage_pieces_string ? _fbb.CreateSharedString(percentage_pieces_string) : 0;
4601   auto percentage_pieces_offsets__ = percentage_pieces_offsets ? _fbb.CreateVector<int32_t>(*percentage_pieces_offsets) : 0;
4602   return libtextclassifier3::CreateNumberAnnotatorOptions(
4603       _fbb,
4604       enabled,
4605       score,
4606       priority_score,
4607       enabled_modes,
4608       enabled_annotation_usecases,
4609       allowed_prefix_codepoints__,
4610       allowed_suffix_codepoints__,
4611       ignored_prefix_span_boundary_codepoints__,
4612       ignored_suffix_span_boundary_codepoints__,
4613       enable_percentage,
4614       percentage_pieces_string__,
4615       percentage_pieces_offsets__,
4616       percentage_priority_score,
4617       float_number_priority_score,
4618       max_number_of_digits,
4619       percentage_annotation_usecases);
4620 }
4621 
4622 flatbuffers::Offset<NumberAnnotatorOptions> CreateNumberAnnotatorOptions(flatbuffers::FlatBufferBuilder &_fbb, const NumberAnnotatorOptionsT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
4623 
4624 struct DurationAnnotatorOptionsT : public flatbuffers::NativeTable {
4625   typedef DurationAnnotatorOptions TableType;
4626   bool enabled = false;
4627   float score = 1.0f;
4628   float priority_score = 0.0f;
4629   libtextclassifier3::ModeFlag enabled_modes = libtextclassifier3::ModeFlag_ALL;
4630   uint32_t enabled_annotation_usecases = 4294967295;
4631   std::vector<std::string> week_expressions{};
4632   std::vector<std::string> day_expressions{};
4633   std::vector<std::string> hour_expressions{};
4634   std::vector<std::string> minute_expressions{};
4635   std::vector<std::string> second_expressions{};
4636   std::vector<std::string> filler_expressions{};
4637   std::vector<std::string> half_expressions{};
4638   std::vector<int32_t> sub_token_separator_codepoints{};
4639   bool require_quantity = false;
4640   bool enable_dangling_quantity_interpretation = true;
4641 };
4642 
4643 struct DurationAnnotatorOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
4644   typedef DurationAnnotatorOptionsT NativeTableType;
4645   typedef DurationAnnotatorOptionsBuilder Builder;
4646   enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
4647     VT_ENABLED = 4,
4648     VT_SCORE = 6,
4649     VT_PRIORITY_SCORE = 8,
4650     VT_ENABLED_MODES = 10,
4651     VT_ENABLED_ANNOTATION_USECASES = 12,
4652     VT_WEEK_EXPRESSIONS = 14,
4653     VT_DAY_EXPRESSIONS = 16,
4654     VT_HOUR_EXPRESSIONS = 18,
4655     VT_MINUTE_EXPRESSIONS = 20,
4656     VT_SECOND_EXPRESSIONS = 22,
4657     VT_FILLER_EXPRESSIONS = 24,
4658     VT_HALF_EXPRESSIONS = 26,
4659     VT_SUB_TOKEN_SEPARATOR_CODEPOINTS = 28,
4660     VT_REQUIRE_QUANTITY = 30,
4661     VT_ENABLE_DANGLING_QUANTITY_INTERPRETATION = 32
4662   };
enabledFLATBUFFERS_FINAL_CLASS4663   bool enabled() const {
4664     return GetField<uint8_t>(VT_ENABLED, 0) != 0;
4665   }
scoreFLATBUFFERS_FINAL_CLASS4666   float score() const {
4667     return GetField<float>(VT_SCORE, 1.0f);
4668   }
priority_scoreFLATBUFFERS_FINAL_CLASS4669   float priority_score() const {
4670     return GetField<float>(VT_PRIORITY_SCORE, 0.0f);
4671   }
enabled_modesFLATBUFFERS_FINAL_CLASS4672   libtextclassifier3::ModeFlag enabled_modes() const {
4673     return static_cast<libtextclassifier3::ModeFlag>(GetField<int32_t>(VT_ENABLED_MODES, 7));
4674   }
enabled_annotation_usecasesFLATBUFFERS_FINAL_CLASS4675   uint32_t enabled_annotation_usecases() const {
4676     return GetField<uint32_t>(VT_ENABLED_ANNOTATION_USECASES, 4294967295);
4677   }
week_expressionsFLATBUFFERS_FINAL_CLASS4678   const flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>> *week_expressions() const {
4679     return GetPointer<const flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>> *>(VT_WEEK_EXPRESSIONS);
4680   }
day_expressionsFLATBUFFERS_FINAL_CLASS4681   const flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>> *day_expressions() const {
4682     return GetPointer<const flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>> *>(VT_DAY_EXPRESSIONS);
4683   }
hour_expressionsFLATBUFFERS_FINAL_CLASS4684   const flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>> *hour_expressions() const {
4685     return GetPointer<const flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>> *>(VT_HOUR_EXPRESSIONS);
4686   }
minute_expressionsFLATBUFFERS_FINAL_CLASS4687   const flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>> *minute_expressions() const {
4688     return GetPointer<const flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>> *>(VT_MINUTE_EXPRESSIONS);
4689   }
second_expressionsFLATBUFFERS_FINAL_CLASS4690   const flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>> *second_expressions() const {
4691     return GetPointer<const flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>> *>(VT_SECOND_EXPRESSIONS);
4692   }
filler_expressionsFLATBUFFERS_FINAL_CLASS4693   const flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>> *filler_expressions() const {
4694     return GetPointer<const flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>> *>(VT_FILLER_EXPRESSIONS);
4695   }
half_expressionsFLATBUFFERS_FINAL_CLASS4696   const flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>> *half_expressions() const {
4697     return GetPointer<const flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>> *>(VT_HALF_EXPRESSIONS);
4698   }
sub_token_separator_codepointsFLATBUFFERS_FINAL_CLASS4699   const flatbuffers::Vector<int32_t> *sub_token_separator_codepoints() const {
4700     return GetPointer<const flatbuffers::Vector<int32_t> *>(VT_SUB_TOKEN_SEPARATOR_CODEPOINTS);
4701   }
require_quantityFLATBUFFERS_FINAL_CLASS4702   bool require_quantity() const {
4703     return GetField<uint8_t>(VT_REQUIRE_QUANTITY, 0) != 0;
4704   }
enable_dangling_quantity_interpretationFLATBUFFERS_FINAL_CLASS4705   bool enable_dangling_quantity_interpretation() const {
4706     return GetField<uint8_t>(VT_ENABLE_DANGLING_QUANTITY_INTERPRETATION, 1) != 0;
4707   }
VerifyFLATBUFFERS_FINAL_CLASS4708   bool Verify(flatbuffers::Verifier &verifier) const {
4709     return VerifyTableStart(verifier) &&
4710            VerifyField<uint8_t>(verifier, VT_ENABLED, 1) &&
4711            VerifyField<float>(verifier, VT_SCORE, 4) &&
4712            VerifyField<float>(verifier, VT_PRIORITY_SCORE, 4) &&
4713            VerifyField<int32_t>(verifier, VT_ENABLED_MODES, 4) &&
4714            VerifyField<uint32_t>(verifier, VT_ENABLED_ANNOTATION_USECASES, 4) &&
4715            VerifyOffset(verifier, VT_WEEK_EXPRESSIONS) &&
4716            verifier.VerifyVector(week_expressions()) &&
4717            verifier.VerifyVectorOfStrings(week_expressions()) &&
4718            VerifyOffset(verifier, VT_DAY_EXPRESSIONS) &&
4719            verifier.VerifyVector(day_expressions()) &&
4720            verifier.VerifyVectorOfStrings(day_expressions()) &&
4721            VerifyOffset(verifier, VT_HOUR_EXPRESSIONS) &&
4722            verifier.VerifyVector(hour_expressions()) &&
4723            verifier.VerifyVectorOfStrings(hour_expressions()) &&
4724            VerifyOffset(verifier, VT_MINUTE_EXPRESSIONS) &&
4725            verifier.VerifyVector(minute_expressions()) &&
4726            verifier.VerifyVectorOfStrings(minute_expressions()) &&
4727            VerifyOffset(verifier, VT_SECOND_EXPRESSIONS) &&
4728            verifier.VerifyVector(second_expressions()) &&
4729            verifier.VerifyVectorOfStrings(second_expressions()) &&
4730            VerifyOffset(verifier, VT_FILLER_EXPRESSIONS) &&
4731            verifier.VerifyVector(filler_expressions()) &&
4732            verifier.VerifyVectorOfStrings(filler_expressions()) &&
4733            VerifyOffset(verifier, VT_HALF_EXPRESSIONS) &&
4734            verifier.VerifyVector(half_expressions()) &&
4735            verifier.VerifyVectorOfStrings(half_expressions()) &&
4736            VerifyOffset(verifier, VT_SUB_TOKEN_SEPARATOR_CODEPOINTS) &&
4737            verifier.VerifyVector(sub_token_separator_codepoints()) &&
4738            VerifyField<uint8_t>(verifier, VT_REQUIRE_QUANTITY, 1) &&
4739            VerifyField<uint8_t>(verifier, VT_ENABLE_DANGLING_QUANTITY_INTERPRETATION, 1) &&
4740            verifier.EndTable();
4741   }
4742   DurationAnnotatorOptionsT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const;
4743   void UnPackTo(DurationAnnotatorOptionsT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const;
4744   static flatbuffers::Offset<DurationAnnotatorOptions> Pack(flatbuffers::FlatBufferBuilder &_fbb, const DurationAnnotatorOptionsT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
4745 };
4746 
4747 struct DurationAnnotatorOptionsBuilder {
4748   typedef DurationAnnotatorOptions Table;
4749   flatbuffers::FlatBufferBuilder &fbb_;
4750   flatbuffers::uoffset_t start_;
add_enabledDurationAnnotatorOptionsBuilder4751   void add_enabled(bool enabled) {
4752     fbb_.AddElement<uint8_t>(DurationAnnotatorOptions::VT_ENABLED, static_cast<uint8_t>(enabled), 0);
4753   }
add_scoreDurationAnnotatorOptionsBuilder4754   void add_score(float score) {
4755     fbb_.AddElement<float>(DurationAnnotatorOptions::VT_SCORE, score, 1.0f);
4756   }
add_priority_scoreDurationAnnotatorOptionsBuilder4757   void add_priority_score(float priority_score) {
4758     fbb_.AddElement<float>(DurationAnnotatorOptions::VT_PRIORITY_SCORE, priority_score, 0.0f);
4759   }
add_enabled_modesDurationAnnotatorOptionsBuilder4760   void add_enabled_modes(libtextclassifier3::ModeFlag enabled_modes) {
4761     fbb_.AddElement<int32_t>(DurationAnnotatorOptions::VT_ENABLED_MODES, static_cast<int32_t>(enabled_modes), 7);
4762   }
add_enabled_annotation_usecasesDurationAnnotatorOptionsBuilder4763   void add_enabled_annotation_usecases(uint32_t enabled_annotation_usecases) {
4764     fbb_.AddElement<uint32_t>(DurationAnnotatorOptions::VT_ENABLED_ANNOTATION_USECASES, enabled_annotation_usecases, 4294967295);
4765   }
add_week_expressionsDurationAnnotatorOptionsBuilder4766   void add_week_expressions(flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>>> week_expressions) {
4767     fbb_.AddOffset(DurationAnnotatorOptions::VT_WEEK_EXPRESSIONS, week_expressions);
4768   }
add_day_expressionsDurationAnnotatorOptionsBuilder4769   void add_day_expressions(flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>>> day_expressions) {
4770     fbb_.AddOffset(DurationAnnotatorOptions::VT_DAY_EXPRESSIONS, day_expressions);
4771   }
add_hour_expressionsDurationAnnotatorOptionsBuilder4772   void add_hour_expressions(flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>>> hour_expressions) {
4773     fbb_.AddOffset(DurationAnnotatorOptions::VT_HOUR_EXPRESSIONS, hour_expressions);
4774   }
add_minute_expressionsDurationAnnotatorOptionsBuilder4775   void add_minute_expressions(flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>>> minute_expressions) {
4776     fbb_.AddOffset(DurationAnnotatorOptions::VT_MINUTE_EXPRESSIONS, minute_expressions);
4777   }
add_second_expressionsDurationAnnotatorOptionsBuilder4778   void add_second_expressions(flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>>> second_expressions) {
4779     fbb_.AddOffset(DurationAnnotatorOptions::VT_SECOND_EXPRESSIONS, second_expressions);
4780   }
add_filler_expressionsDurationAnnotatorOptionsBuilder4781   void add_filler_expressions(flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>>> filler_expressions) {
4782     fbb_.AddOffset(DurationAnnotatorOptions::VT_FILLER_EXPRESSIONS, filler_expressions);
4783   }
add_half_expressionsDurationAnnotatorOptionsBuilder4784   void add_half_expressions(flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>>> half_expressions) {
4785     fbb_.AddOffset(DurationAnnotatorOptions::VT_HALF_EXPRESSIONS, half_expressions);
4786   }
add_sub_token_separator_codepointsDurationAnnotatorOptionsBuilder4787   void add_sub_token_separator_codepoints(flatbuffers::Offset<flatbuffers::Vector<int32_t>> sub_token_separator_codepoints) {
4788     fbb_.AddOffset(DurationAnnotatorOptions::VT_SUB_TOKEN_SEPARATOR_CODEPOINTS, sub_token_separator_codepoints);
4789   }
add_require_quantityDurationAnnotatorOptionsBuilder4790   void add_require_quantity(bool require_quantity) {
4791     fbb_.AddElement<uint8_t>(DurationAnnotatorOptions::VT_REQUIRE_QUANTITY, static_cast<uint8_t>(require_quantity), 0);
4792   }
add_enable_dangling_quantity_interpretationDurationAnnotatorOptionsBuilder4793   void add_enable_dangling_quantity_interpretation(bool enable_dangling_quantity_interpretation) {
4794     fbb_.AddElement<uint8_t>(DurationAnnotatorOptions::VT_ENABLE_DANGLING_QUANTITY_INTERPRETATION, static_cast<uint8_t>(enable_dangling_quantity_interpretation), 1);
4795   }
DurationAnnotatorOptionsBuilderDurationAnnotatorOptionsBuilder4796   explicit DurationAnnotatorOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb)
4797         : fbb_(_fbb) {
4798     start_ = fbb_.StartTable();
4799   }
FinishDurationAnnotatorOptionsBuilder4800   flatbuffers::Offset<DurationAnnotatorOptions> Finish() {
4801     const auto end = fbb_.EndTable(start_);
4802     auto o = flatbuffers::Offset<DurationAnnotatorOptions>(end);
4803     return o;
4804   }
4805 };
4806 
4807 inline flatbuffers::Offset<DurationAnnotatorOptions> CreateDurationAnnotatorOptions(
4808     flatbuffers::FlatBufferBuilder &_fbb,
4809     bool enabled = false,
4810     float score = 1.0f,
4811     float priority_score = 0.0f,
4812     libtextclassifier3::ModeFlag enabled_modes = libtextclassifier3::ModeFlag_ALL,
4813     uint32_t enabled_annotation_usecases = 4294967295,
4814     flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>>> week_expressions = 0,
4815     flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>>> day_expressions = 0,
4816     flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>>> hour_expressions = 0,
4817     flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>>> minute_expressions = 0,
4818     flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>>> second_expressions = 0,
4819     flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>>> filler_expressions = 0,
4820     flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>>> half_expressions = 0,
4821     flatbuffers::Offset<flatbuffers::Vector<int32_t>> sub_token_separator_codepoints = 0,
4822     bool require_quantity = false,
4823     bool enable_dangling_quantity_interpretation = true) {
4824   DurationAnnotatorOptionsBuilder builder_(_fbb);
4825   builder_.add_sub_token_separator_codepoints(sub_token_separator_codepoints);
4826   builder_.add_half_expressions(half_expressions);
4827   builder_.add_filler_expressions(filler_expressions);
4828   builder_.add_second_expressions(second_expressions);
4829   builder_.add_minute_expressions(minute_expressions);
4830   builder_.add_hour_expressions(hour_expressions);
4831   builder_.add_day_expressions(day_expressions);
4832   builder_.add_week_expressions(week_expressions);
4833   builder_.add_enabled_annotation_usecases(enabled_annotation_usecases);
4834   builder_.add_enabled_modes(enabled_modes);
4835   builder_.add_priority_score(priority_score);
4836   builder_.add_score(score);
4837   builder_.add_enable_dangling_quantity_interpretation(enable_dangling_quantity_interpretation);
4838   builder_.add_require_quantity(require_quantity);
4839   builder_.add_enabled(enabled);
4840   return builder_.Finish();
4841 }
4842 
4843 inline flatbuffers::Offset<DurationAnnotatorOptions> CreateDurationAnnotatorOptionsDirect(
4844     flatbuffers::FlatBufferBuilder &_fbb,
4845     bool enabled = false,
4846     float score = 1.0f,
4847     float priority_score = 0.0f,
4848     libtextclassifier3::ModeFlag enabled_modes = libtextclassifier3::ModeFlag_ALL,
4849     uint32_t enabled_annotation_usecases = 4294967295,
4850     const std::vector<flatbuffers::Offset<flatbuffers::String>> *week_expressions = nullptr,
4851     const std::vector<flatbuffers::Offset<flatbuffers::String>> *day_expressions = nullptr,
4852     const std::vector<flatbuffers::Offset<flatbuffers::String>> *hour_expressions = nullptr,
4853     const std::vector<flatbuffers::Offset<flatbuffers::String>> *minute_expressions = nullptr,
4854     const std::vector<flatbuffers::Offset<flatbuffers::String>> *second_expressions = nullptr,
4855     const std::vector<flatbuffers::Offset<flatbuffers::String>> *filler_expressions = nullptr,
4856     const std::vector<flatbuffers::Offset<flatbuffers::String>> *half_expressions = nullptr,
4857     const std::vector<int32_t> *sub_token_separator_codepoints = nullptr,
4858     bool require_quantity = false,
4859     bool enable_dangling_quantity_interpretation = true) {
4860   auto week_expressions__ = week_expressions ? _fbb.CreateVector<flatbuffers::Offset<flatbuffers::String>>(*week_expressions) : 0;
4861   auto day_expressions__ = day_expressions ? _fbb.CreateVector<flatbuffers::Offset<flatbuffers::String>>(*day_expressions) : 0;
4862   auto hour_expressions__ = hour_expressions ? _fbb.CreateVector<flatbuffers::Offset<flatbuffers::String>>(*hour_expressions) : 0;
4863   auto minute_expressions__ = minute_expressions ? _fbb.CreateVector<flatbuffers::Offset<flatbuffers::String>>(*minute_expressions) : 0;
4864   auto second_expressions__ = second_expressions ? _fbb.CreateVector<flatbuffers::Offset<flatbuffers::String>>(*second_expressions) : 0;
4865   auto filler_expressions__ = filler_expressions ? _fbb.CreateVector<flatbuffers::Offset<flatbuffers::String>>(*filler_expressions) : 0;
4866   auto half_expressions__ = half_expressions ? _fbb.CreateVector<flatbuffers::Offset<flatbuffers::String>>(*half_expressions) : 0;
4867   auto sub_token_separator_codepoints__ = sub_token_separator_codepoints ? _fbb.CreateVector<int32_t>(*sub_token_separator_codepoints) : 0;
4868   return libtextclassifier3::CreateDurationAnnotatorOptions(
4869       _fbb,
4870       enabled,
4871       score,
4872       priority_score,
4873       enabled_modes,
4874       enabled_annotation_usecases,
4875       week_expressions__,
4876       day_expressions__,
4877       hour_expressions__,
4878       minute_expressions__,
4879       second_expressions__,
4880       filler_expressions__,
4881       half_expressions__,
4882       sub_token_separator_codepoints__,
4883       require_quantity,
4884       enable_dangling_quantity_interpretation);
4885 }
4886 
4887 flatbuffers::Offset<DurationAnnotatorOptions> CreateDurationAnnotatorOptions(flatbuffers::FlatBufferBuilder &_fbb, const DurationAnnotatorOptionsT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
4888 
4889 struct ContactAnnotatorOptionsT : public flatbuffers::NativeTable {
4890   typedef ContactAnnotatorOptions TableType;
4891   bool enable_declension = false;
4892   std::string language{};
4893   libtextclassifier3::ModeFlag enabled_modes = libtextclassifier3::ModeFlag_ALL;
4894 };
4895 
4896 struct ContactAnnotatorOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
4897   typedef ContactAnnotatorOptionsT NativeTableType;
4898   typedef ContactAnnotatorOptionsBuilder Builder;
4899   enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
4900     VT_ENABLE_DECLENSION = 4,
4901     VT_LANGUAGE = 6,
4902     VT_ENABLED_MODES = 8
4903   };
enable_declensionFLATBUFFERS_FINAL_CLASS4904   bool enable_declension() const {
4905     return GetField<uint8_t>(VT_ENABLE_DECLENSION, 0) != 0;
4906   }
languageFLATBUFFERS_FINAL_CLASS4907   const flatbuffers::String *language() const {
4908     return GetPointer<const flatbuffers::String *>(VT_LANGUAGE);
4909   }
enabled_modesFLATBUFFERS_FINAL_CLASS4910   libtextclassifier3::ModeFlag enabled_modes() const {
4911     return static_cast<libtextclassifier3::ModeFlag>(GetField<int32_t>(VT_ENABLED_MODES, 7));
4912   }
VerifyFLATBUFFERS_FINAL_CLASS4913   bool Verify(flatbuffers::Verifier &verifier) const {
4914     return VerifyTableStart(verifier) &&
4915            VerifyField<uint8_t>(verifier, VT_ENABLE_DECLENSION, 1) &&
4916            VerifyOffset(verifier, VT_LANGUAGE) &&
4917            verifier.VerifyString(language()) &&
4918            VerifyField<int32_t>(verifier, VT_ENABLED_MODES, 4) &&
4919            verifier.EndTable();
4920   }
4921   ContactAnnotatorOptionsT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const;
4922   void UnPackTo(ContactAnnotatorOptionsT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const;
4923   static flatbuffers::Offset<ContactAnnotatorOptions> Pack(flatbuffers::FlatBufferBuilder &_fbb, const ContactAnnotatorOptionsT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
4924 };
4925 
4926 struct ContactAnnotatorOptionsBuilder {
4927   typedef ContactAnnotatorOptions Table;
4928   flatbuffers::FlatBufferBuilder &fbb_;
4929   flatbuffers::uoffset_t start_;
add_enable_declensionContactAnnotatorOptionsBuilder4930   void add_enable_declension(bool enable_declension) {
4931     fbb_.AddElement<uint8_t>(ContactAnnotatorOptions::VT_ENABLE_DECLENSION, static_cast<uint8_t>(enable_declension), 0);
4932   }
add_languageContactAnnotatorOptionsBuilder4933   void add_language(flatbuffers::Offset<flatbuffers::String> language) {
4934     fbb_.AddOffset(ContactAnnotatorOptions::VT_LANGUAGE, language);
4935   }
add_enabled_modesContactAnnotatorOptionsBuilder4936   void add_enabled_modes(libtextclassifier3::ModeFlag enabled_modes) {
4937     fbb_.AddElement<int32_t>(ContactAnnotatorOptions::VT_ENABLED_MODES, static_cast<int32_t>(enabled_modes), 7);
4938   }
ContactAnnotatorOptionsBuilderContactAnnotatorOptionsBuilder4939   explicit ContactAnnotatorOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb)
4940         : fbb_(_fbb) {
4941     start_ = fbb_.StartTable();
4942   }
FinishContactAnnotatorOptionsBuilder4943   flatbuffers::Offset<ContactAnnotatorOptions> Finish() {
4944     const auto end = fbb_.EndTable(start_);
4945     auto o = flatbuffers::Offset<ContactAnnotatorOptions>(end);
4946     return o;
4947   }
4948 };
4949 
4950 inline flatbuffers::Offset<ContactAnnotatorOptions> CreateContactAnnotatorOptions(
4951     flatbuffers::FlatBufferBuilder &_fbb,
4952     bool enable_declension = false,
4953     flatbuffers::Offset<flatbuffers::String> language = 0,
4954     libtextclassifier3::ModeFlag enabled_modes = libtextclassifier3::ModeFlag_ALL) {
4955   ContactAnnotatorOptionsBuilder builder_(_fbb);
4956   builder_.add_enabled_modes(enabled_modes);
4957   builder_.add_language(language);
4958   builder_.add_enable_declension(enable_declension);
4959   return builder_.Finish();
4960 }
4961 
4962 inline flatbuffers::Offset<ContactAnnotatorOptions> CreateContactAnnotatorOptionsDirect(
4963     flatbuffers::FlatBufferBuilder &_fbb,
4964     bool enable_declension = false,
4965     const char *language = nullptr,
4966     libtextclassifier3::ModeFlag enabled_modes = libtextclassifier3::ModeFlag_ALL) {
4967   auto language__ = language ? _fbb.CreateSharedString(language) : 0;
4968   return libtextclassifier3::CreateContactAnnotatorOptions(
4969       _fbb,
4970       enable_declension,
4971       language__,
4972       enabled_modes);
4973 }
4974 
4975 flatbuffers::Offset<ContactAnnotatorOptions> CreateContactAnnotatorOptions(flatbuffers::FlatBufferBuilder &_fbb, const ContactAnnotatorOptionsT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
4976 
4977 namespace TranslateAnnotatorOptions_ {
4978 
4979 struct BackoffOptionsT : public flatbuffers::NativeTable {
4980   typedef BackoffOptions TableType;
4981   int32_t min_text_size = 20;
4982   float penalize_ratio = 1.0f;
4983   float subject_text_score_ratio = 0.4f;
4984 };
4985 
4986 struct BackoffOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
4987   typedef BackoffOptionsT NativeTableType;
4988   typedef BackoffOptionsBuilder Builder;
4989   enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
4990     VT_MIN_TEXT_SIZE = 4,
4991     VT_PENALIZE_RATIO = 6,
4992     VT_SUBJECT_TEXT_SCORE_RATIO = 8
4993   };
min_text_sizeFLATBUFFERS_FINAL_CLASS4994   int32_t min_text_size() const {
4995     return GetField<int32_t>(VT_MIN_TEXT_SIZE, 20);
4996   }
penalize_ratioFLATBUFFERS_FINAL_CLASS4997   float penalize_ratio() const {
4998     return GetField<float>(VT_PENALIZE_RATIO, 1.0f);
4999   }
subject_text_score_ratioFLATBUFFERS_FINAL_CLASS5000   float subject_text_score_ratio() const {
5001     return GetField<float>(VT_SUBJECT_TEXT_SCORE_RATIO, 0.4f);
5002   }
VerifyFLATBUFFERS_FINAL_CLASS5003   bool Verify(flatbuffers::Verifier &verifier) const {
5004     return VerifyTableStart(verifier) &&
5005            VerifyField<int32_t>(verifier, VT_MIN_TEXT_SIZE, 4) &&
5006            VerifyField<float>(verifier, VT_PENALIZE_RATIO, 4) &&
5007            VerifyField<float>(verifier, VT_SUBJECT_TEXT_SCORE_RATIO, 4) &&
5008            verifier.EndTable();
5009   }
5010   BackoffOptionsT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const;
5011   void UnPackTo(BackoffOptionsT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const;
5012   static flatbuffers::Offset<BackoffOptions> Pack(flatbuffers::FlatBufferBuilder &_fbb, const BackoffOptionsT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
5013 };
5014 
5015 struct BackoffOptionsBuilder {
5016   typedef BackoffOptions Table;
5017   flatbuffers::FlatBufferBuilder &fbb_;
5018   flatbuffers::uoffset_t start_;
add_min_text_sizeBackoffOptionsBuilder5019   void add_min_text_size(int32_t min_text_size) {
5020     fbb_.AddElement<int32_t>(BackoffOptions::VT_MIN_TEXT_SIZE, min_text_size, 20);
5021   }
add_penalize_ratioBackoffOptionsBuilder5022   void add_penalize_ratio(float penalize_ratio) {
5023     fbb_.AddElement<float>(BackoffOptions::VT_PENALIZE_RATIO, penalize_ratio, 1.0f);
5024   }
add_subject_text_score_ratioBackoffOptionsBuilder5025   void add_subject_text_score_ratio(float subject_text_score_ratio) {
5026     fbb_.AddElement<float>(BackoffOptions::VT_SUBJECT_TEXT_SCORE_RATIO, subject_text_score_ratio, 0.4f);
5027   }
BackoffOptionsBuilderBackoffOptionsBuilder5028   explicit BackoffOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb)
5029         : fbb_(_fbb) {
5030     start_ = fbb_.StartTable();
5031   }
FinishBackoffOptionsBuilder5032   flatbuffers::Offset<BackoffOptions> Finish() {
5033     const auto end = fbb_.EndTable(start_);
5034     auto o = flatbuffers::Offset<BackoffOptions>(end);
5035     return o;
5036   }
5037 };
5038 
5039 inline flatbuffers::Offset<BackoffOptions> CreateBackoffOptions(
5040     flatbuffers::FlatBufferBuilder &_fbb,
5041     int32_t min_text_size = 20,
5042     float penalize_ratio = 1.0f,
5043     float subject_text_score_ratio = 0.4f) {
5044   BackoffOptionsBuilder builder_(_fbb);
5045   builder_.add_subject_text_score_ratio(subject_text_score_ratio);
5046   builder_.add_penalize_ratio(penalize_ratio);
5047   builder_.add_min_text_size(min_text_size);
5048   return builder_.Finish();
5049 }
5050 
5051 flatbuffers::Offset<BackoffOptions> CreateBackoffOptions(flatbuffers::FlatBufferBuilder &_fbb, const BackoffOptionsT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
5052 
5053 }  // namespace TranslateAnnotatorOptions_
5054 
5055 struct TranslateAnnotatorOptionsT : public flatbuffers::NativeTable {
5056   typedef TranslateAnnotatorOptions TableType;
5057   bool enabled = false;
5058   float score = 1.0f;
5059   float priority_score = 0.0f;
5060   libtextclassifier3::TranslateAnnotatorOptions_::Algorithm algorithm = libtextclassifier3::TranslateAnnotatorOptions_::Algorithm_DEFAULT_ALGORITHM;
5061   std::unique_ptr<libtextclassifier3::TranslateAnnotatorOptions_::BackoffOptionsT> backoff_options{};
5062   libtextclassifier3::ModeFlag enabled_modes = libtextclassifier3::ModeFlag_CLASSIFICATION;
5063   TranslateAnnotatorOptionsT() = default;
5064   TranslateAnnotatorOptionsT(const TranslateAnnotatorOptionsT &o);
5065   TranslateAnnotatorOptionsT(TranslateAnnotatorOptionsT&&) FLATBUFFERS_NOEXCEPT = default;
5066   TranslateAnnotatorOptionsT &operator=(TranslateAnnotatorOptionsT o) FLATBUFFERS_NOEXCEPT;
5067 };
5068 
5069 struct TranslateAnnotatorOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
5070   typedef TranslateAnnotatorOptionsT NativeTableType;
5071   typedef TranslateAnnotatorOptionsBuilder Builder;
5072   enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
5073     VT_ENABLED = 4,
5074     VT_SCORE = 6,
5075     VT_PRIORITY_SCORE = 8,
5076     VT_ALGORITHM = 10,
5077     VT_BACKOFF_OPTIONS = 12,
5078     VT_ENABLED_MODES = 14
5079   };
enabledFLATBUFFERS_FINAL_CLASS5080   bool enabled() const {
5081     return GetField<uint8_t>(VT_ENABLED, 0) != 0;
5082   }
scoreFLATBUFFERS_FINAL_CLASS5083   float score() const {
5084     return GetField<float>(VT_SCORE, 1.0f);
5085   }
priority_scoreFLATBUFFERS_FINAL_CLASS5086   float priority_score() const {
5087     return GetField<float>(VT_PRIORITY_SCORE, 0.0f);
5088   }
algorithmFLATBUFFERS_FINAL_CLASS5089   libtextclassifier3::TranslateAnnotatorOptions_::Algorithm algorithm() const {
5090     return static_cast<libtextclassifier3::TranslateAnnotatorOptions_::Algorithm>(GetField<int32_t>(VT_ALGORITHM, 0));
5091   }
backoff_optionsFLATBUFFERS_FINAL_CLASS5092   const libtextclassifier3::TranslateAnnotatorOptions_::BackoffOptions *backoff_options() const {
5093     return GetPointer<const libtextclassifier3::TranslateAnnotatorOptions_::BackoffOptions *>(VT_BACKOFF_OPTIONS);
5094   }
enabled_modesFLATBUFFERS_FINAL_CLASS5095   libtextclassifier3::ModeFlag enabled_modes() const {
5096     return static_cast<libtextclassifier3::ModeFlag>(GetField<int32_t>(VT_ENABLED_MODES, 2));
5097   }
VerifyFLATBUFFERS_FINAL_CLASS5098   bool Verify(flatbuffers::Verifier &verifier) const {
5099     return VerifyTableStart(verifier) &&
5100            VerifyField<uint8_t>(verifier, VT_ENABLED, 1) &&
5101            VerifyField<float>(verifier, VT_SCORE, 4) &&
5102            VerifyField<float>(verifier, VT_PRIORITY_SCORE, 4) &&
5103            VerifyField<int32_t>(verifier, VT_ALGORITHM, 4) &&
5104            VerifyOffset(verifier, VT_BACKOFF_OPTIONS) &&
5105            verifier.VerifyTable(backoff_options()) &&
5106            VerifyField<int32_t>(verifier, VT_ENABLED_MODES, 4) &&
5107            verifier.EndTable();
5108   }
5109   TranslateAnnotatorOptionsT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const;
5110   void UnPackTo(TranslateAnnotatorOptionsT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const;
5111   static flatbuffers::Offset<TranslateAnnotatorOptions> Pack(flatbuffers::FlatBufferBuilder &_fbb, const TranslateAnnotatorOptionsT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
5112 };
5113 
5114 struct TranslateAnnotatorOptionsBuilder {
5115   typedef TranslateAnnotatorOptions Table;
5116   flatbuffers::FlatBufferBuilder &fbb_;
5117   flatbuffers::uoffset_t start_;
add_enabledTranslateAnnotatorOptionsBuilder5118   void add_enabled(bool enabled) {
5119     fbb_.AddElement<uint8_t>(TranslateAnnotatorOptions::VT_ENABLED, static_cast<uint8_t>(enabled), 0);
5120   }
add_scoreTranslateAnnotatorOptionsBuilder5121   void add_score(float score) {
5122     fbb_.AddElement<float>(TranslateAnnotatorOptions::VT_SCORE, score, 1.0f);
5123   }
add_priority_scoreTranslateAnnotatorOptionsBuilder5124   void add_priority_score(float priority_score) {
5125     fbb_.AddElement<float>(TranslateAnnotatorOptions::VT_PRIORITY_SCORE, priority_score, 0.0f);
5126   }
add_algorithmTranslateAnnotatorOptionsBuilder5127   void add_algorithm(libtextclassifier3::TranslateAnnotatorOptions_::Algorithm algorithm) {
5128     fbb_.AddElement<int32_t>(TranslateAnnotatorOptions::VT_ALGORITHM, static_cast<int32_t>(algorithm), 0);
5129   }
add_backoff_optionsTranslateAnnotatorOptionsBuilder5130   void add_backoff_options(flatbuffers::Offset<libtextclassifier3::TranslateAnnotatorOptions_::BackoffOptions> backoff_options) {
5131     fbb_.AddOffset(TranslateAnnotatorOptions::VT_BACKOFF_OPTIONS, backoff_options);
5132   }
add_enabled_modesTranslateAnnotatorOptionsBuilder5133   void add_enabled_modes(libtextclassifier3::ModeFlag enabled_modes) {
5134     fbb_.AddElement<int32_t>(TranslateAnnotatorOptions::VT_ENABLED_MODES, static_cast<int32_t>(enabled_modes), 2);
5135   }
TranslateAnnotatorOptionsBuilderTranslateAnnotatorOptionsBuilder5136   explicit TranslateAnnotatorOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb)
5137         : fbb_(_fbb) {
5138     start_ = fbb_.StartTable();
5139   }
FinishTranslateAnnotatorOptionsBuilder5140   flatbuffers::Offset<TranslateAnnotatorOptions> Finish() {
5141     const auto end = fbb_.EndTable(start_);
5142     auto o = flatbuffers::Offset<TranslateAnnotatorOptions>(end);
5143     return o;
5144   }
5145 };
5146 
5147 inline flatbuffers::Offset<TranslateAnnotatorOptions> CreateTranslateAnnotatorOptions(
5148     flatbuffers::FlatBufferBuilder &_fbb,
5149     bool enabled = false,
5150     float score = 1.0f,
5151     float priority_score = 0.0f,
5152     libtextclassifier3::TranslateAnnotatorOptions_::Algorithm algorithm = libtextclassifier3::TranslateAnnotatorOptions_::Algorithm_DEFAULT_ALGORITHM,
5153     flatbuffers::Offset<libtextclassifier3::TranslateAnnotatorOptions_::BackoffOptions> backoff_options = 0,
5154     libtextclassifier3::ModeFlag enabled_modes = libtextclassifier3::ModeFlag_CLASSIFICATION) {
5155   TranslateAnnotatorOptionsBuilder builder_(_fbb);
5156   builder_.add_enabled_modes(enabled_modes);
5157   builder_.add_backoff_options(backoff_options);
5158   builder_.add_algorithm(algorithm);
5159   builder_.add_priority_score(priority_score);
5160   builder_.add_score(score);
5161   builder_.add_enabled(enabled);
5162   return builder_.Finish();
5163 }
5164 
5165 flatbuffers::Offset<TranslateAnnotatorOptions> CreateTranslateAnnotatorOptions(flatbuffers::FlatBufferBuilder &_fbb, const TranslateAnnotatorOptionsT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
5166 
5167 namespace PodNerModel_ {
5168 
5169 struct CollectionT : public flatbuffers::NativeTable {
5170   typedef Collection TableType;
5171   std::string name{};
5172   float single_token_priority_score = 0.0f;
5173   float multi_token_priority_score = 0.0f;
5174 };
5175 
5176 struct Collection FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
5177   typedef CollectionT NativeTableType;
5178   typedef CollectionBuilder Builder;
5179   enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
5180     VT_NAME = 4,
5181     VT_SINGLE_TOKEN_PRIORITY_SCORE = 6,
5182     VT_MULTI_TOKEN_PRIORITY_SCORE = 8
5183   };
nameFLATBUFFERS_FINAL_CLASS5184   const flatbuffers::String *name() const {
5185     return GetPointer<const flatbuffers::String *>(VT_NAME);
5186   }
single_token_priority_scoreFLATBUFFERS_FINAL_CLASS5187   float single_token_priority_score() const {
5188     return GetField<float>(VT_SINGLE_TOKEN_PRIORITY_SCORE, 0.0f);
5189   }
multi_token_priority_scoreFLATBUFFERS_FINAL_CLASS5190   float multi_token_priority_score() const {
5191     return GetField<float>(VT_MULTI_TOKEN_PRIORITY_SCORE, 0.0f);
5192   }
VerifyFLATBUFFERS_FINAL_CLASS5193   bool Verify(flatbuffers::Verifier &verifier) const {
5194     return VerifyTableStart(verifier) &&
5195            VerifyOffset(verifier, VT_NAME) &&
5196            verifier.VerifyString(name()) &&
5197            VerifyField<float>(verifier, VT_SINGLE_TOKEN_PRIORITY_SCORE, 4) &&
5198            VerifyField<float>(verifier, VT_MULTI_TOKEN_PRIORITY_SCORE, 4) &&
5199            verifier.EndTable();
5200   }
5201   CollectionT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const;
5202   void UnPackTo(CollectionT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const;
5203   static flatbuffers::Offset<Collection> Pack(flatbuffers::FlatBufferBuilder &_fbb, const CollectionT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
5204 };
5205 
5206 struct CollectionBuilder {
5207   typedef Collection Table;
5208   flatbuffers::FlatBufferBuilder &fbb_;
5209   flatbuffers::uoffset_t start_;
add_nameCollectionBuilder5210   void add_name(flatbuffers::Offset<flatbuffers::String> name) {
5211     fbb_.AddOffset(Collection::VT_NAME, name);
5212   }
add_single_token_priority_scoreCollectionBuilder5213   void add_single_token_priority_score(float single_token_priority_score) {
5214     fbb_.AddElement<float>(Collection::VT_SINGLE_TOKEN_PRIORITY_SCORE, single_token_priority_score, 0.0f);
5215   }
add_multi_token_priority_scoreCollectionBuilder5216   void add_multi_token_priority_score(float multi_token_priority_score) {
5217     fbb_.AddElement<float>(Collection::VT_MULTI_TOKEN_PRIORITY_SCORE, multi_token_priority_score, 0.0f);
5218   }
CollectionBuilderCollectionBuilder5219   explicit CollectionBuilder(flatbuffers::FlatBufferBuilder &_fbb)
5220         : fbb_(_fbb) {
5221     start_ = fbb_.StartTable();
5222   }
FinishCollectionBuilder5223   flatbuffers::Offset<Collection> Finish() {
5224     const auto end = fbb_.EndTable(start_);
5225     auto o = flatbuffers::Offset<Collection>(end);
5226     return o;
5227   }
5228 };
5229 
5230 inline flatbuffers::Offset<Collection> CreateCollection(
5231     flatbuffers::FlatBufferBuilder &_fbb,
5232     flatbuffers::Offset<flatbuffers::String> name = 0,
5233     float single_token_priority_score = 0.0f,
5234     float multi_token_priority_score = 0.0f) {
5235   CollectionBuilder builder_(_fbb);
5236   builder_.add_multi_token_priority_score(multi_token_priority_score);
5237   builder_.add_single_token_priority_score(single_token_priority_score);
5238   builder_.add_name(name);
5239   return builder_.Finish();
5240 }
5241 
5242 inline flatbuffers::Offset<Collection> CreateCollectionDirect(
5243     flatbuffers::FlatBufferBuilder &_fbb,
5244     const char *name = nullptr,
5245     float single_token_priority_score = 0.0f,
5246     float multi_token_priority_score = 0.0f) {
5247   auto name__ = name ? _fbb.CreateSharedString(name) : 0;
5248   return libtextclassifier3::PodNerModel_::CreateCollection(
5249       _fbb,
5250       name__,
5251       single_token_priority_score,
5252       multi_token_priority_score);
5253 }
5254 
5255 flatbuffers::Offset<Collection> CreateCollection(flatbuffers::FlatBufferBuilder &_fbb, const CollectionT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
5256 
5257 struct LabelT : public flatbuffers::NativeTable {
5258   typedef Label TableType;
5259   libtextclassifier3::PodNerModel_::Label_::BoiseType boise_type = libtextclassifier3::PodNerModel_::Label_::BoiseType_NONE;
5260   libtextclassifier3::PodNerModel_::Label_::MentionType mention_type = libtextclassifier3::PodNerModel_::Label_::MentionType_UNDEFINED;
5261   int32_t collection_id = 0;
5262 };
5263 
5264 struct Label FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
5265   typedef LabelT NativeTableType;
5266   typedef LabelBuilder Builder;
5267   enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
5268     VT_BOISE_TYPE = 4,
5269     VT_MENTION_TYPE = 6,
5270     VT_COLLECTION_ID = 8
5271   };
boise_typeFLATBUFFERS_FINAL_CLASS5272   libtextclassifier3::PodNerModel_::Label_::BoiseType boise_type() const {
5273     return static_cast<libtextclassifier3::PodNerModel_::Label_::BoiseType>(GetField<int32_t>(VT_BOISE_TYPE, 0));
5274   }
mention_typeFLATBUFFERS_FINAL_CLASS5275   libtextclassifier3::PodNerModel_::Label_::MentionType mention_type() const {
5276     return static_cast<libtextclassifier3::PodNerModel_::Label_::MentionType>(GetField<int32_t>(VT_MENTION_TYPE, 0));
5277   }
collection_idFLATBUFFERS_FINAL_CLASS5278   int32_t collection_id() const {
5279     return GetField<int32_t>(VT_COLLECTION_ID, 0);
5280   }
VerifyFLATBUFFERS_FINAL_CLASS5281   bool Verify(flatbuffers::Verifier &verifier) const {
5282     return VerifyTableStart(verifier) &&
5283            VerifyField<int32_t>(verifier, VT_BOISE_TYPE, 4) &&
5284            VerifyField<int32_t>(verifier, VT_MENTION_TYPE, 4) &&
5285            VerifyField<int32_t>(verifier, VT_COLLECTION_ID, 4) &&
5286            verifier.EndTable();
5287   }
5288   LabelT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const;
5289   void UnPackTo(LabelT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const;
5290   static flatbuffers::Offset<Label> Pack(flatbuffers::FlatBufferBuilder &_fbb, const LabelT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
5291 };
5292 
5293 struct LabelBuilder {
5294   typedef Label Table;
5295   flatbuffers::FlatBufferBuilder &fbb_;
5296   flatbuffers::uoffset_t start_;
add_boise_typeLabelBuilder5297   void add_boise_type(libtextclassifier3::PodNerModel_::Label_::BoiseType boise_type) {
5298     fbb_.AddElement<int32_t>(Label::VT_BOISE_TYPE, static_cast<int32_t>(boise_type), 0);
5299   }
add_mention_typeLabelBuilder5300   void add_mention_type(libtextclassifier3::PodNerModel_::Label_::MentionType mention_type) {
5301     fbb_.AddElement<int32_t>(Label::VT_MENTION_TYPE, static_cast<int32_t>(mention_type), 0);
5302   }
add_collection_idLabelBuilder5303   void add_collection_id(int32_t collection_id) {
5304     fbb_.AddElement<int32_t>(Label::VT_COLLECTION_ID, collection_id, 0);
5305   }
LabelBuilderLabelBuilder5306   explicit LabelBuilder(flatbuffers::FlatBufferBuilder &_fbb)
5307         : fbb_(_fbb) {
5308     start_ = fbb_.StartTable();
5309   }
FinishLabelBuilder5310   flatbuffers::Offset<Label> Finish() {
5311     const auto end = fbb_.EndTable(start_);
5312     auto o = flatbuffers::Offset<Label>(end);
5313     return o;
5314   }
5315 };
5316 
5317 inline flatbuffers::Offset<Label> CreateLabel(
5318     flatbuffers::FlatBufferBuilder &_fbb,
5319     libtextclassifier3::PodNerModel_::Label_::BoiseType boise_type = libtextclassifier3::PodNerModel_::Label_::BoiseType_NONE,
5320     libtextclassifier3::PodNerModel_::Label_::MentionType mention_type = libtextclassifier3::PodNerModel_::Label_::MentionType_UNDEFINED,
5321     int32_t collection_id = 0) {
5322   LabelBuilder builder_(_fbb);
5323   builder_.add_collection_id(collection_id);
5324   builder_.add_mention_type(mention_type);
5325   builder_.add_boise_type(boise_type);
5326   return builder_.Finish();
5327 }
5328 
5329 flatbuffers::Offset<Label> CreateLabel(flatbuffers::FlatBufferBuilder &_fbb, const LabelT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
5330 
5331 }  // namespace PodNerModel_
5332 
5333 struct PodNerModelT : public flatbuffers::NativeTable {
5334   typedef PodNerModel TableType;
5335   std::vector<uint8_t> tflite_model{};
5336   std::vector<uint8_t> word_piece_vocab{};
5337   bool lowercase_input = true;
5338   int32_t logits_index_in_output_tensor = 0;
5339   bool append_final_period = false;
5340   float priority_score = 0.0f;
5341   int32_t max_num_wordpieces = 128;
5342   int32_t sliding_window_num_wordpieces_overlap = 20;
5343   std::vector<std::unique_ptr<libtextclassifier3::PodNerModel_::LabelT>> labels{};
5344   float max_ratio_unknown_wordpieces = 0.1f;
5345   std::vector<std::unique_ptr<libtextclassifier3::PodNerModel_::CollectionT>> collections{};
5346   int32_t min_number_of_tokens = 1;
5347   int32_t min_number_of_wordpieces = 1;
5348   libtextclassifier3::ModeFlag enabled_modes = libtextclassifier3::ModeFlag_ALL;
5349   PodNerModelT() = default;
5350   PodNerModelT(const PodNerModelT &o);
5351   PodNerModelT(PodNerModelT&&) FLATBUFFERS_NOEXCEPT = default;
5352   PodNerModelT &operator=(PodNerModelT o) FLATBUFFERS_NOEXCEPT;
5353 };
5354 
5355 struct PodNerModel FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
5356   typedef PodNerModelT NativeTableType;
5357   typedef PodNerModelBuilder Builder;
5358   enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
5359     VT_TFLITE_MODEL = 4,
5360     VT_WORD_PIECE_VOCAB = 6,
5361     VT_LOWERCASE_INPUT = 8,
5362     VT_LOGITS_INDEX_IN_OUTPUT_TENSOR = 10,
5363     VT_APPEND_FINAL_PERIOD = 12,
5364     VT_PRIORITY_SCORE = 14,
5365     VT_MAX_NUM_WORDPIECES = 16,
5366     VT_SLIDING_WINDOW_NUM_WORDPIECES_OVERLAP = 18,
5367     VT_LABELS = 22,
5368     VT_MAX_RATIO_UNKNOWN_WORDPIECES = 24,
5369     VT_COLLECTIONS = 26,
5370     VT_MIN_NUMBER_OF_TOKENS = 28,
5371     VT_MIN_NUMBER_OF_WORDPIECES = 30,
5372     VT_ENABLED_MODES = 32
5373   };
tflite_modelFLATBUFFERS_FINAL_CLASS5374   const flatbuffers::Vector<uint8_t> *tflite_model() const {
5375     return GetPointer<const flatbuffers::Vector<uint8_t> *>(VT_TFLITE_MODEL);
5376   }
word_piece_vocabFLATBUFFERS_FINAL_CLASS5377   const flatbuffers::Vector<uint8_t> *word_piece_vocab() const {
5378     return GetPointer<const flatbuffers::Vector<uint8_t> *>(VT_WORD_PIECE_VOCAB);
5379   }
lowercase_inputFLATBUFFERS_FINAL_CLASS5380   bool lowercase_input() const {
5381     return GetField<uint8_t>(VT_LOWERCASE_INPUT, 1) != 0;
5382   }
logits_index_in_output_tensorFLATBUFFERS_FINAL_CLASS5383   int32_t logits_index_in_output_tensor() const {
5384     return GetField<int32_t>(VT_LOGITS_INDEX_IN_OUTPUT_TENSOR, 0);
5385   }
append_final_periodFLATBUFFERS_FINAL_CLASS5386   bool append_final_period() const {
5387     return GetField<uint8_t>(VT_APPEND_FINAL_PERIOD, 0) != 0;
5388   }
priority_scoreFLATBUFFERS_FINAL_CLASS5389   float priority_score() const {
5390     return GetField<float>(VT_PRIORITY_SCORE, 0.0f);
5391   }
max_num_wordpiecesFLATBUFFERS_FINAL_CLASS5392   int32_t max_num_wordpieces() const {
5393     return GetField<int32_t>(VT_MAX_NUM_WORDPIECES, 128);
5394   }
sliding_window_num_wordpieces_overlapFLATBUFFERS_FINAL_CLASS5395   int32_t sliding_window_num_wordpieces_overlap() const {
5396     return GetField<int32_t>(VT_SLIDING_WINDOW_NUM_WORDPIECES_OVERLAP, 20);
5397   }
labelsFLATBUFFERS_FINAL_CLASS5398   const flatbuffers::Vector<flatbuffers::Offset<libtextclassifier3::PodNerModel_::Label>> *labels() const {
5399     return GetPointer<const flatbuffers::Vector<flatbuffers::Offset<libtextclassifier3::PodNerModel_::Label>> *>(VT_LABELS);
5400   }
max_ratio_unknown_wordpiecesFLATBUFFERS_FINAL_CLASS5401   float max_ratio_unknown_wordpieces() const {
5402     return GetField<float>(VT_MAX_RATIO_UNKNOWN_WORDPIECES, 0.1f);
5403   }
collectionsFLATBUFFERS_FINAL_CLASS5404   const flatbuffers::Vector<flatbuffers::Offset<libtextclassifier3::PodNerModel_::Collection>> *collections() const {
5405     return GetPointer<const flatbuffers::Vector<flatbuffers::Offset<libtextclassifier3::PodNerModel_::Collection>> *>(VT_COLLECTIONS);
5406   }
min_number_of_tokensFLATBUFFERS_FINAL_CLASS5407   int32_t min_number_of_tokens() const {
5408     return GetField<int32_t>(VT_MIN_NUMBER_OF_TOKENS, 1);
5409   }
min_number_of_wordpiecesFLATBUFFERS_FINAL_CLASS5410   int32_t min_number_of_wordpieces() const {
5411     return GetField<int32_t>(VT_MIN_NUMBER_OF_WORDPIECES, 1);
5412   }
enabled_modesFLATBUFFERS_FINAL_CLASS5413   libtextclassifier3::ModeFlag enabled_modes() const {
5414     return static_cast<libtextclassifier3::ModeFlag>(GetField<int32_t>(VT_ENABLED_MODES, 7));
5415   }
VerifyFLATBUFFERS_FINAL_CLASS5416   bool Verify(flatbuffers::Verifier &verifier) const {
5417     return VerifyTableStart(verifier) &&
5418            VerifyOffset(verifier, VT_TFLITE_MODEL) &&
5419            verifier.VerifyVector(tflite_model()) &&
5420            VerifyOffset(verifier, VT_WORD_PIECE_VOCAB) &&
5421            verifier.VerifyVector(word_piece_vocab()) &&
5422            VerifyField<uint8_t>(verifier, VT_LOWERCASE_INPUT, 1) &&
5423            VerifyField<int32_t>(verifier, VT_LOGITS_INDEX_IN_OUTPUT_TENSOR, 4) &&
5424            VerifyField<uint8_t>(verifier, VT_APPEND_FINAL_PERIOD, 1) &&
5425            VerifyField<float>(verifier, VT_PRIORITY_SCORE, 4) &&
5426            VerifyField<int32_t>(verifier, VT_MAX_NUM_WORDPIECES, 4) &&
5427            VerifyField<int32_t>(verifier, VT_SLIDING_WINDOW_NUM_WORDPIECES_OVERLAP, 4) &&
5428            VerifyOffset(verifier, VT_LABELS) &&
5429            verifier.VerifyVector(labels()) &&
5430            verifier.VerifyVectorOfTables(labels()) &&
5431            VerifyField<float>(verifier, VT_MAX_RATIO_UNKNOWN_WORDPIECES, 4) &&
5432            VerifyOffset(verifier, VT_COLLECTIONS) &&
5433            verifier.VerifyVector(collections()) &&
5434            verifier.VerifyVectorOfTables(collections()) &&
5435            VerifyField<int32_t>(verifier, VT_MIN_NUMBER_OF_TOKENS, 4) &&
5436            VerifyField<int32_t>(verifier, VT_MIN_NUMBER_OF_WORDPIECES, 4) &&
5437            VerifyField<int32_t>(verifier, VT_ENABLED_MODES, 4) &&
5438            verifier.EndTable();
5439   }
5440   PodNerModelT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const;
5441   void UnPackTo(PodNerModelT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const;
5442   static flatbuffers::Offset<PodNerModel> Pack(flatbuffers::FlatBufferBuilder &_fbb, const PodNerModelT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
5443 };
5444 
5445 struct PodNerModelBuilder {
5446   typedef PodNerModel Table;
5447   flatbuffers::FlatBufferBuilder &fbb_;
5448   flatbuffers::uoffset_t start_;
add_tflite_modelPodNerModelBuilder5449   void add_tflite_model(flatbuffers::Offset<flatbuffers::Vector<uint8_t>> tflite_model) {
5450     fbb_.AddOffset(PodNerModel::VT_TFLITE_MODEL, tflite_model);
5451   }
add_word_piece_vocabPodNerModelBuilder5452   void add_word_piece_vocab(flatbuffers::Offset<flatbuffers::Vector<uint8_t>> word_piece_vocab) {
5453     fbb_.AddOffset(PodNerModel::VT_WORD_PIECE_VOCAB, word_piece_vocab);
5454   }
add_lowercase_inputPodNerModelBuilder5455   void add_lowercase_input(bool lowercase_input) {
5456     fbb_.AddElement<uint8_t>(PodNerModel::VT_LOWERCASE_INPUT, static_cast<uint8_t>(lowercase_input), 1);
5457   }
add_logits_index_in_output_tensorPodNerModelBuilder5458   void add_logits_index_in_output_tensor(int32_t logits_index_in_output_tensor) {
5459     fbb_.AddElement<int32_t>(PodNerModel::VT_LOGITS_INDEX_IN_OUTPUT_TENSOR, logits_index_in_output_tensor, 0);
5460   }
add_append_final_periodPodNerModelBuilder5461   void add_append_final_period(bool append_final_period) {
5462     fbb_.AddElement<uint8_t>(PodNerModel::VT_APPEND_FINAL_PERIOD, static_cast<uint8_t>(append_final_period), 0);
5463   }
add_priority_scorePodNerModelBuilder5464   void add_priority_score(float priority_score) {
5465     fbb_.AddElement<float>(PodNerModel::VT_PRIORITY_SCORE, priority_score, 0.0f);
5466   }
add_max_num_wordpiecesPodNerModelBuilder5467   void add_max_num_wordpieces(int32_t max_num_wordpieces) {
5468     fbb_.AddElement<int32_t>(PodNerModel::VT_MAX_NUM_WORDPIECES, max_num_wordpieces, 128);
5469   }
add_sliding_window_num_wordpieces_overlapPodNerModelBuilder5470   void add_sliding_window_num_wordpieces_overlap(int32_t sliding_window_num_wordpieces_overlap) {
5471     fbb_.AddElement<int32_t>(PodNerModel::VT_SLIDING_WINDOW_NUM_WORDPIECES_OVERLAP, sliding_window_num_wordpieces_overlap, 20);
5472   }
add_labelsPodNerModelBuilder5473   void add_labels(flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<libtextclassifier3::PodNerModel_::Label>>> labels) {
5474     fbb_.AddOffset(PodNerModel::VT_LABELS, labels);
5475   }
add_max_ratio_unknown_wordpiecesPodNerModelBuilder5476   void add_max_ratio_unknown_wordpieces(float max_ratio_unknown_wordpieces) {
5477     fbb_.AddElement<float>(PodNerModel::VT_MAX_RATIO_UNKNOWN_WORDPIECES, max_ratio_unknown_wordpieces, 0.1f);
5478   }
add_collectionsPodNerModelBuilder5479   void add_collections(flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<libtextclassifier3::PodNerModel_::Collection>>> collections) {
5480     fbb_.AddOffset(PodNerModel::VT_COLLECTIONS, collections);
5481   }
add_min_number_of_tokensPodNerModelBuilder5482   void add_min_number_of_tokens(int32_t min_number_of_tokens) {
5483     fbb_.AddElement<int32_t>(PodNerModel::VT_MIN_NUMBER_OF_TOKENS, min_number_of_tokens, 1);
5484   }
add_min_number_of_wordpiecesPodNerModelBuilder5485   void add_min_number_of_wordpieces(int32_t min_number_of_wordpieces) {
5486     fbb_.AddElement<int32_t>(PodNerModel::VT_MIN_NUMBER_OF_WORDPIECES, min_number_of_wordpieces, 1);
5487   }
add_enabled_modesPodNerModelBuilder5488   void add_enabled_modes(libtextclassifier3::ModeFlag enabled_modes) {
5489     fbb_.AddElement<int32_t>(PodNerModel::VT_ENABLED_MODES, static_cast<int32_t>(enabled_modes), 7);
5490   }
PodNerModelBuilderPodNerModelBuilder5491   explicit PodNerModelBuilder(flatbuffers::FlatBufferBuilder &_fbb)
5492         : fbb_(_fbb) {
5493     start_ = fbb_.StartTable();
5494   }
FinishPodNerModelBuilder5495   flatbuffers::Offset<PodNerModel> Finish() {
5496     const auto end = fbb_.EndTable(start_);
5497     auto o = flatbuffers::Offset<PodNerModel>(end);
5498     return o;
5499   }
5500 };
5501 
5502 inline flatbuffers::Offset<PodNerModel> CreatePodNerModel(
5503     flatbuffers::FlatBufferBuilder &_fbb,
5504     flatbuffers::Offset<flatbuffers::Vector<uint8_t>> tflite_model = 0,
5505     flatbuffers::Offset<flatbuffers::Vector<uint8_t>> word_piece_vocab = 0,
5506     bool lowercase_input = true,
5507     int32_t logits_index_in_output_tensor = 0,
5508     bool append_final_period = false,
5509     float priority_score = 0.0f,
5510     int32_t max_num_wordpieces = 128,
5511     int32_t sliding_window_num_wordpieces_overlap = 20,
5512     flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<libtextclassifier3::PodNerModel_::Label>>> labels = 0,
5513     float max_ratio_unknown_wordpieces = 0.1f,
5514     flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<libtextclassifier3::PodNerModel_::Collection>>> collections = 0,
5515     int32_t min_number_of_tokens = 1,
5516     int32_t min_number_of_wordpieces = 1,
5517     libtextclassifier3::ModeFlag enabled_modes = libtextclassifier3::ModeFlag_ALL) {
5518   PodNerModelBuilder builder_(_fbb);
5519   builder_.add_enabled_modes(enabled_modes);
5520   builder_.add_min_number_of_wordpieces(min_number_of_wordpieces);
5521   builder_.add_min_number_of_tokens(min_number_of_tokens);
5522   builder_.add_collections(collections);
5523   builder_.add_max_ratio_unknown_wordpieces(max_ratio_unknown_wordpieces);
5524   builder_.add_labels(labels);
5525   builder_.add_sliding_window_num_wordpieces_overlap(sliding_window_num_wordpieces_overlap);
5526   builder_.add_max_num_wordpieces(max_num_wordpieces);
5527   builder_.add_priority_score(priority_score);
5528   builder_.add_logits_index_in_output_tensor(logits_index_in_output_tensor);
5529   builder_.add_word_piece_vocab(word_piece_vocab);
5530   builder_.add_tflite_model(tflite_model);
5531   builder_.add_append_final_period(append_final_period);
5532   builder_.add_lowercase_input(lowercase_input);
5533   return builder_.Finish();
5534 }
5535 
5536 inline flatbuffers::Offset<PodNerModel> CreatePodNerModelDirect(
5537     flatbuffers::FlatBufferBuilder &_fbb,
5538     const std::vector<uint8_t> *tflite_model = nullptr,
5539     const std::vector<uint8_t> *word_piece_vocab = nullptr,
5540     bool lowercase_input = true,
5541     int32_t logits_index_in_output_tensor = 0,
5542     bool append_final_period = false,
5543     float priority_score = 0.0f,
5544     int32_t max_num_wordpieces = 128,
5545     int32_t sliding_window_num_wordpieces_overlap = 20,
5546     const std::vector<flatbuffers::Offset<libtextclassifier3::PodNerModel_::Label>> *labels = nullptr,
5547     float max_ratio_unknown_wordpieces = 0.1f,
5548     const std::vector<flatbuffers::Offset<libtextclassifier3::PodNerModel_::Collection>> *collections = nullptr,
5549     int32_t min_number_of_tokens = 1,
5550     int32_t min_number_of_wordpieces = 1,
5551     libtextclassifier3::ModeFlag enabled_modes = libtextclassifier3::ModeFlag_ALL) {
5552   auto tflite_model__ = tflite_model ? _fbb.CreateVector<uint8_t>(*tflite_model) : 0;
5553   auto word_piece_vocab__ = word_piece_vocab ? _fbb.CreateVector<uint8_t>(*word_piece_vocab) : 0;
5554   auto labels__ = labels ? _fbb.CreateVector<flatbuffers::Offset<libtextclassifier3::PodNerModel_::Label>>(*labels) : 0;
5555   auto collections__ = collections ? _fbb.CreateVector<flatbuffers::Offset<libtextclassifier3::PodNerModel_::Collection>>(*collections) : 0;
5556   return libtextclassifier3::CreatePodNerModel(
5557       _fbb,
5558       tflite_model__,
5559       word_piece_vocab__,
5560       lowercase_input,
5561       logits_index_in_output_tensor,
5562       append_final_period,
5563       priority_score,
5564       max_num_wordpieces,
5565       sliding_window_num_wordpieces_overlap,
5566       labels__,
5567       max_ratio_unknown_wordpieces,
5568       collections__,
5569       min_number_of_tokens,
5570       min_number_of_wordpieces,
5571       enabled_modes);
5572 }
5573 
5574 flatbuffers::Offset<PodNerModel> CreatePodNerModel(flatbuffers::FlatBufferBuilder &_fbb, const PodNerModelT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
5575 
5576 struct VocabModelT : public flatbuffers::NativeTable {
5577   typedef VocabModel TableType;
5578   std::vector<uint8_t> vocab_trie{};
5579   std::unique_ptr<libtextclassifier3::BitVectorDataT> beginner_level{};
5580   std::unique_ptr<libtextclassifier3::BitVectorDataT> do_not_trigger_in_upper_case{};
5581   std::string triggering_locales{};
5582   float target_classification_score = 1.0f;
5583   float priority_score = 0.0f;
5584   libtextclassifier3::ModeFlag enabled_modes = libtextclassifier3::ModeFlag_ANNOTATION_AND_CLASSIFICATION;
5585   VocabModelT() = default;
5586   VocabModelT(const VocabModelT &o);
5587   VocabModelT(VocabModelT&&) FLATBUFFERS_NOEXCEPT = default;
5588   VocabModelT &operator=(VocabModelT o) FLATBUFFERS_NOEXCEPT;
5589 };
5590 
5591 struct VocabModel FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
5592   typedef VocabModelT NativeTableType;
5593   typedef VocabModelBuilder Builder;
5594   enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
5595     VT_VOCAB_TRIE = 4,
5596     VT_BEGINNER_LEVEL = 6,
5597     VT_DO_NOT_TRIGGER_IN_UPPER_CASE = 8,
5598     VT_TRIGGERING_LOCALES = 10,
5599     VT_TARGET_CLASSIFICATION_SCORE = 12,
5600     VT_PRIORITY_SCORE = 14,
5601     VT_ENABLED_MODES = 16
5602   };
vocab_trieFLATBUFFERS_FINAL_CLASS5603   const flatbuffers::Vector<uint8_t> *vocab_trie() const {
5604     return GetPointer<const flatbuffers::Vector<uint8_t> *>(VT_VOCAB_TRIE);
5605   }
beginner_levelFLATBUFFERS_FINAL_CLASS5606   const libtextclassifier3::BitVectorData *beginner_level() const {
5607     return GetPointer<const libtextclassifier3::BitVectorData *>(VT_BEGINNER_LEVEL);
5608   }
do_not_trigger_in_upper_caseFLATBUFFERS_FINAL_CLASS5609   const libtextclassifier3::BitVectorData *do_not_trigger_in_upper_case() const {
5610     return GetPointer<const libtextclassifier3::BitVectorData *>(VT_DO_NOT_TRIGGER_IN_UPPER_CASE);
5611   }
triggering_localesFLATBUFFERS_FINAL_CLASS5612   const flatbuffers::String *triggering_locales() const {
5613     return GetPointer<const flatbuffers::String *>(VT_TRIGGERING_LOCALES);
5614   }
target_classification_scoreFLATBUFFERS_FINAL_CLASS5615   float target_classification_score() const {
5616     return GetField<float>(VT_TARGET_CLASSIFICATION_SCORE, 1.0f);
5617   }
priority_scoreFLATBUFFERS_FINAL_CLASS5618   float priority_score() const {
5619     return GetField<float>(VT_PRIORITY_SCORE, 0.0f);
5620   }
enabled_modesFLATBUFFERS_FINAL_CLASS5621   libtextclassifier3::ModeFlag enabled_modes() const {
5622     return static_cast<libtextclassifier3::ModeFlag>(GetField<int32_t>(VT_ENABLED_MODES, 3));
5623   }
VerifyFLATBUFFERS_FINAL_CLASS5624   bool Verify(flatbuffers::Verifier &verifier) const {
5625     return VerifyTableStart(verifier) &&
5626            VerifyOffset(verifier, VT_VOCAB_TRIE) &&
5627            verifier.VerifyVector(vocab_trie()) &&
5628            VerifyOffset(verifier, VT_BEGINNER_LEVEL) &&
5629            verifier.VerifyTable(beginner_level()) &&
5630            VerifyOffset(verifier, VT_DO_NOT_TRIGGER_IN_UPPER_CASE) &&
5631            verifier.VerifyTable(do_not_trigger_in_upper_case()) &&
5632            VerifyOffset(verifier, VT_TRIGGERING_LOCALES) &&
5633            verifier.VerifyString(triggering_locales()) &&
5634            VerifyField<float>(verifier, VT_TARGET_CLASSIFICATION_SCORE, 4) &&
5635            VerifyField<float>(verifier, VT_PRIORITY_SCORE, 4) &&
5636            VerifyField<int32_t>(verifier, VT_ENABLED_MODES, 4) &&
5637            verifier.EndTable();
5638   }
5639   VocabModelT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const;
5640   void UnPackTo(VocabModelT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const;
5641   static flatbuffers::Offset<VocabModel> Pack(flatbuffers::FlatBufferBuilder &_fbb, const VocabModelT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
5642 };
5643 
5644 struct VocabModelBuilder {
5645   typedef VocabModel Table;
5646   flatbuffers::FlatBufferBuilder &fbb_;
5647   flatbuffers::uoffset_t start_;
add_vocab_trieVocabModelBuilder5648   void add_vocab_trie(flatbuffers::Offset<flatbuffers::Vector<uint8_t>> vocab_trie) {
5649     fbb_.AddOffset(VocabModel::VT_VOCAB_TRIE, vocab_trie);
5650   }
add_beginner_levelVocabModelBuilder5651   void add_beginner_level(flatbuffers::Offset<libtextclassifier3::BitVectorData> beginner_level) {
5652     fbb_.AddOffset(VocabModel::VT_BEGINNER_LEVEL, beginner_level);
5653   }
add_do_not_trigger_in_upper_caseVocabModelBuilder5654   void add_do_not_trigger_in_upper_case(flatbuffers::Offset<libtextclassifier3::BitVectorData> do_not_trigger_in_upper_case) {
5655     fbb_.AddOffset(VocabModel::VT_DO_NOT_TRIGGER_IN_UPPER_CASE, do_not_trigger_in_upper_case);
5656   }
add_triggering_localesVocabModelBuilder5657   void add_triggering_locales(flatbuffers::Offset<flatbuffers::String> triggering_locales) {
5658     fbb_.AddOffset(VocabModel::VT_TRIGGERING_LOCALES, triggering_locales);
5659   }
add_target_classification_scoreVocabModelBuilder5660   void add_target_classification_score(float target_classification_score) {
5661     fbb_.AddElement<float>(VocabModel::VT_TARGET_CLASSIFICATION_SCORE, target_classification_score, 1.0f);
5662   }
add_priority_scoreVocabModelBuilder5663   void add_priority_score(float priority_score) {
5664     fbb_.AddElement<float>(VocabModel::VT_PRIORITY_SCORE, priority_score, 0.0f);
5665   }
add_enabled_modesVocabModelBuilder5666   void add_enabled_modes(libtextclassifier3::ModeFlag enabled_modes) {
5667     fbb_.AddElement<int32_t>(VocabModel::VT_ENABLED_MODES, static_cast<int32_t>(enabled_modes), 3);
5668   }
VocabModelBuilderVocabModelBuilder5669   explicit VocabModelBuilder(flatbuffers::FlatBufferBuilder &_fbb)
5670         : fbb_(_fbb) {
5671     start_ = fbb_.StartTable();
5672   }
FinishVocabModelBuilder5673   flatbuffers::Offset<VocabModel> Finish() {
5674     const auto end = fbb_.EndTable(start_);
5675     auto o = flatbuffers::Offset<VocabModel>(end);
5676     return o;
5677   }
5678 };
5679 
5680 inline flatbuffers::Offset<VocabModel> CreateVocabModel(
5681     flatbuffers::FlatBufferBuilder &_fbb,
5682     flatbuffers::Offset<flatbuffers::Vector<uint8_t>> vocab_trie = 0,
5683     flatbuffers::Offset<libtextclassifier3::BitVectorData> beginner_level = 0,
5684     flatbuffers::Offset<libtextclassifier3::BitVectorData> do_not_trigger_in_upper_case = 0,
5685     flatbuffers::Offset<flatbuffers::String> triggering_locales = 0,
5686     float target_classification_score = 1.0f,
5687     float priority_score = 0.0f,
5688     libtextclassifier3::ModeFlag enabled_modes = libtextclassifier3::ModeFlag_ANNOTATION_AND_CLASSIFICATION) {
5689   VocabModelBuilder builder_(_fbb);
5690   builder_.add_enabled_modes(enabled_modes);
5691   builder_.add_priority_score(priority_score);
5692   builder_.add_target_classification_score(target_classification_score);
5693   builder_.add_triggering_locales(triggering_locales);
5694   builder_.add_do_not_trigger_in_upper_case(do_not_trigger_in_upper_case);
5695   builder_.add_beginner_level(beginner_level);
5696   builder_.add_vocab_trie(vocab_trie);
5697   return builder_.Finish();
5698 }
5699 
5700 inline flatbuffers::Offset<VocabModel> CreateVocabModelDirect(
5701     flatbuffers::FlatBufferBuilder &_fbb,
5702     const std::vector<uint8_t> *vocab_trie = nullptr,
5703     flatbuffers::Offset<libtextclassifier3::BitVectorData> beginner_level = 0,
5704     flatbuffers::Offset<libtextclassifier3::BitVectorData> do_not_trigger_in_upper_case = 0,
5705     const char *triggering_locales = nullptr,
5706     float target_classification_score = 1.0f,
5707     float priority_score = 0.0f,
5708     libtextclassifier3::ModeFlag enabled_modes = libtextclassifier3::ModeFlag_ANNOTATION_AND_CLASSIFICATION) {
5709   if (vocab_trie) { _fbb.ForceVectorAlignment(vocab_trie->size(), sizeof(uint8_t), 8); }
5710   auto vocab_trie__ = vocab_trie ? _fbb.CreateVector<uint8_t>(*vocab_trie) : 0;
5711   auto triggering_locales__ = triggering_locales ? _fbb.CreateSharedString(triggering_locales) : 0;
5712   return libtextclassifier3::CreateVocabModel(
5713       _fbb,
5714       vocab_trie__,
5715       beginner_level,
5716       do_not_trigger_in_upper_case,
5717       triggering_locales__,
5718       target_classification_score,
5719       priority_score,
5720       enabled_modes);
5721 }
5722 
5723 flatbuffers::Offset<VocabModel> CreateVocabModel(flatbuffers::FlatBufferBuilder &_fbb, const VocabModelT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
5724 
UnPack(const flatbuffers::resolver_function_t * _resolver)5725 inline SelectionModelOptionsT *SelectionModelOptions::UnPack(const flatbuffers::resolver_function_t *_resolver) const {
5726   auto _o = std::unique_ptr<SelectionModelOptionsT>(new SelectionModelOptionsT());
5727   UnPackTo(_o.get(), _resolver);
5728   return _o.release();
5729 }
5730 
UnPackTo(SelectionModelOptionsT * _o,const flatbuffers::resolver_function_t * _resolver)5731 inline void SelectionModelOptions::UnPackTo(SelectionModelOptionsT *_o, const flatbuffers::resolver_function_t *_resolver) const {
5732   (void)_o;
5733   (void)_resolver;
5734   { auto _e = strip_unpaired_brackets(); _o->strip_unpaired_brackets = _e; }
5735   { auto _e = symmetry_context_size(); _o->symmetry_context_size = _e; }
5736   { auto _e = batch_size(); _o->batch_size = _e; }
5737   { auto _e = always_classify_suggested_selection(); _o->always_classify_suggested_selection = _e; }
5738 }
5739 
Pack(flatbuffers::FlatBufferBuilder & _fbb,const SelectionModelOptionsT * _o,const flatbuffers::rehasher_function_t * _rehasher)5740 inline flatbuffers::Offset<SelectionModelOptions> SelectionModelOptions::Pack(flatbuffers::FlatBufferBuilder &_fbb, const SelectionModelOptionsT* _o, const flatbuffers::rehasher_function_t *_rehasher) {
5741   return CreateSelectionModelOptions(_fbb, _o, _rehasher);
5742 }
5743 
CreateSelectionModelOptions(flatbuffers::FlatBufferBuilder & _fbb,const SelectionModelOptionsT * _o,const flatbuffers::rehasher_function_t * _rehasher)5744 inline flatbuffers::Offset<SelectionModelOptions> CreateSelectionModelOptions(flatbuffers::FlatBufferBuilder &_fbb, const SelectionModelOptionsT *_o, const flatbuffers::rehasher_function_t *_rehasher) {
5745   (void)_rehasher;
5746   (void)_o;
5747   struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const SelectionModelOptionsT* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va;
5748   auto _strip_unpaired_brackets = _o->strip_unpaired_brackets;
5749   auto _symmetry_context_size = _o->symmetry_context_size;
5750   auto _batch_size = _o->batch_size;
5751   auto _always_classify_suggested_selection = _o->always_classify_suggested_selection;
5752   return libtextclassifier3::CreateSelectionModelOptions(
5753       _fbb,
5754       _strip_unpaired_brackets,
5755       _symmetry_context_size,
5756       _batch_size,
5757       _always_classify_suggested_selection);
5758 }
5759 
UnPack(const flatbuffers::resolver_function_t * _resolver)5760 inline ClassificationModelOptionsT *ClassificationModelOptions::UnPack(const flatbuffers::resolver_function_t *_resolver) const {
5761   auto _o = std::unique_ptr<ClassificationModelOptionsT>(new ClassificationModelOptionsT());
5762   UnPackTo(_o.get(), _resolver);
5763   return _o.release();
5764 }
5765 
UnPackTo(ClassificationModelOptionsT * _o,const flatbuffers::resolver_function_t * _resolver)5766 inline void ClassificationModelOptions::UnPackTo(ClassificationModelOptionsT *_o, const flatbuffers::resolver_function_t *_resolver) const {
5767   (void)_o;
5768   (void)_resolver;
5769   { auto _e = phone_min_num_digits(); _o->phone_min_num_digits = _e; }
5770   { auto _e = phone_max_num_digits(); _o->phone_max_num_digits = _e; }
5771   { auto _e = address_min_num_tokens(); _o->address_min_num_tokens = _e; }
5772   { auto _e = max_num_tokens(); _o->max_num_tokens = _e; }
5773 }
5774 
Pack(flatbuffers::FlatBufferBuilder & _fbb,const ClassificationModelOptionsT * _o,const flatbuffers::rehasher_function_t * _rehasher)5775 inline flatbuffers::Offset<ClassificationModelOptions> ClassificationModelOptions::Pack(flatbuffers::FlatBufferBuilder &_fbb, const ClassificationModelOptionsT* _o, const flatbuffers::rehasher_function_t *_rehasher) {
5776   return CreateClassificationModelOptions(_fbb, _o, _rehasher);
5777 }
5778 
CreateClassificationModelOptions(flatbuffers::FlatBufferBuilder & _fbb,const ClassificationModelOptionsT * _o,const flatbuffers::rehasher_function_t * _rehasher)5779 inline flatbuffers::Offset<ClassificationModelOptions> CreateClassificationModelOptions(flatbuffers::FlatBufferBuilder &_fbb, const ClassificationModelOptionsT *_o, const flatbuffers::rehasher_function_t *_rehasher) {
5780   (void)_rehasher;
5781   (void)_o;
5782   struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const ClassificationModelOptionsT* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va;
5783   auto _phone_min_num_digits = _o->phone_min_num_digits;
5784   auto _phone_max_num_digits = _o->phone_max_num_digits;
5785   auto _address_min_num_tokens = _o->address_min_num_tokens;
5786   auto _max_num_tokens = _o->max_num_tokens;
5787   return libtextclassifier3::CreateClassificationModelOptions(
5788       _fbb,
5789       _phone_min_num_digits,
5790       _phone_max_num_digits,
5791       _address_min_num_tokens,
5792       _max_num_tokens);
5793 }
5794 
UnPack(const flatbuffers::resolver_function_t * _resolver)5795 inline VerificationOptionsT *VerificationOptions::UnPack(const flatbuffers::resolver_function_t *_resolver) const {
5796   auto _o = std::unique_ptr<VerificationOptionsT>(new VerificationOptionsT());
5797   UnPackTo(_o.get(), _resolver);
5798   return _o.release();
5799 }
5800 
UnPackTo(VerificationOptionsT * _o,const flatbuffers::resolver_function_t * _resolver)5801 inline void VerificationOptions::UnPackTo(VerificationOptionsT *_o, const flatbuffers::resolver_function_t *_resolver) const {
5802   (void)_o;
5803   (void)_resolver;
5804   { auto _e = verify_luhn_checksum(); _o->verify_luhn_checksum = _e; }
5805   { auto _e = lua_verifier(); _o->lua_verifier = _e; }
5806 }
5807 
Pack(flatbuffers::FlatBufferBuilder & _fbb,const VerificationOptionsT * _o,const flatbuffers::rehasher_function_t * _rehasher)5808 inline flatbuffers::Offset<VerificationOptions> VerificationOptions::Pack(flatbuffers::FlatBufferBuilder &_fbb, const VerificationOptionsT* _o, const flatbuffers::rehasher_function_t *_rehasher) {
5809   return CreateVerificationOptions(_fbb, _o, _rehasher);
5810 }
5811 
CreateVerificationOptions(flatbuffers::FlatBufferBuilder & _fbb,const VerificationOptionsT * _o,const flatbuffers::rehasher_function_t * _rehasher)5812 inline flatbuffers::Offset<VerificationOptions> CreateVerificationOptions(flatbuffers::FlatBufferBuilder &_fbb, const VerificationOptionsT *_o, const flatbuffers::rehasher_function_t *_rehasher) {
5813   (void)_rehasher;
5814   (void)_o;
5815   struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const VerificationOptionsT* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va;
5816   auto _verify_luhn_checksum = _o->verify_luhn_checksum;
5817   auto _lua_verifier = _o->lua_verifier;
5818   return libtextclassifier3::CreateVerificationOptions(
5819       _fbb,
5820       _verify_luhn_checksum,
5821       _lua_verifier);
5822 }
5823 
CapturingGroupT(const CapturingGroupT & o)5824 inline CapturingGroupT::CapturingGroupT(const CapturingGroupT &o)
5825       : extend_selection(o.extend_selection),
5826         entity_field_path((o.entity_field_path) ? new libtextclassifier3::FlatbufferFieldPathT(*o.entity_field_path) : nullptr),
5827         serialized_entity_data(o.serialized_entity_data),
5828         normalization_options((o.normalization_options) ? new libtextclassifier3::NormalizationOptionsT(*o.normalization_options) : nullptr),
5829         entity_data((o.entity_data) ? new libtextclassifier3::EntityDataT(*o.entity_data) : nullptr) {
5830 }
5831 
5832 inline CapturingGroupT &CapturingGroupT::operator=(CapturingGroupT o) FLATBUFFERS_NOEXCEPT {
5833   std::swap(extend_selection, o.extend_selection);
5834   std::swap(entity_field_path, o.entity_field_path);
5835   std::swap(serialized_entity_data, o.serialized_entity_data);
5836   std::swap(normalization_options, o.normalization_options);
5837   std::swap(entity_data, o.entity_data);
5838   return *this;
5839 }
5840 
UnPack(const flatbuffers::resolver_function_t * _resolver)5841 inline CapturingGroupT *CapturingGroup::UnPack(const flatbuffers::resolver_function_t *_resolver) const {
5842   auto _o = std::unique_ptr<CapturingGroupT>(new CapturingGroupT());
5843   UnPackTo(_o.get(), _resolver);
5844   return _o.release();
5845 }
5846 
UnPackTo(CapturingGroupT * _o,const flatbuffers::resolver_function_t * _resolver)5847 inline void CapturingGroup::UnPackTo(CapturingGroupT *_o, const flatbuffers::resolver_function_t *_resolver) const {
5848   (void)_o;
5849   (void)_resolver;
5850   { auto _e = extend_selection(); _o->extend_selection = _e; }
5851   { auto _e = entity_field_path(); if (_e) _o->entity_field_path = std::unique_ptr<libtextclassifier3::FlatbufferFieldPathT>(_e->UnPack(_resolver)); }
5852   { auto _e = serialized_entity_data(); if (_e) _o->serialized_entity_data = _e->str(); }
5853   { auto _e = normalization_options(); if (_e) _o->normalization_options = std::unique_ptr<libtextclassifier3::NormalizationOptionsT>(_e->UnPack(_resolver)); }
5854   { auto _e = entity_data(); if (_e) _o->entity_data = std::unique_ptr<libtextclassifier3::EntityDataT>(_e->UnPack(_resolver)); }
5855 }
5856 
Pack(flatbuffers::FlatBufferBuilder & _fbb,const CapturingGroupT * _o,const flatbuffers::rehasher_function_t * _rehasher)5857 inline flatbuffers::Offset<CapturingGroup> CapturingGroup::Pack(flatbuffers::FlatBufferBuilder &_fbb, const CapturingGroupT* _o, const flatbuffers::rehasher_function_t *_rehasher) {
5858   return CreateCapturingGroup(_fbb, _o, _rehasher);
5859 }
5860 
CreateCapturingGroup(flatbuffers::FlatBufferBuilder & _fbb,const CapturingGroupT * _o,const flatbuffers::rehasher_function_t * _rehasher)5861 inline flatbuffers::Offset<CapturingGroup> CreateCapturingGroup(flatbuffers::FlatBufferBuilder &_fbb, const CapturingGroupT *_o, const flatbuffers::rehasher_function_t *_rehasher) {
5862   (void)_rehasher;
5863   (void)_o;
5864   struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const CapturingGroupT* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va;
5865   auto _extend_selection = _o->extend_selection;
5866   auto _entity_field_path = _o->entity_field_path ? CreateFlatbufferFieldPath(_fbb, _o->entity_field_path.get(), _rehasher) : 0;
5867   auto _serialized_entity_data = _o->serialized_entity_data.empty() ? 0 : _fbb.CreateSharedString(_o->serialized_entity_data);
5868   auto _normalization_options = _o->normalization_options ? CreateNormalizationOptions(_fbb, _o->normalization_options.get(), _rehasher) : 0;
5869   auto _entity_data = _o->entity_data ? CreateEntityData(_fbb, _o->entity_data.get(), _rehasher) : 0;
5870   return libtextclassifier3::CreateCapturingGroup(
5871       _fbb,
5872       _extend_selection,
5873       _entity_field_path,
5874       _serialized_entity_data,
5875       _normalization_options,
5876       _entity_data);
5877 }
5878 
5879 namespace RegexModel_ {
5880 
PatternT(const PatternT & o)5881 inline PatternT::PatternT(const PatternT &o)
5882       : collection_name(o.collection_name),
5883         pattern(o.pattern),
5884         enabled_modes(o.enabled_modes),
5885         target_classification_score(o.target_classification_score),
5886         priority_score(o.priority_score),
5887         use_approximate_matching(o.use_approximate_matching),
5888         compressed_pattern((o.compressed_pattern) ? new libtextclassifier3::CompressedBufferT(*o.compressed_pattern) : nullptr),
5889         verification_options((o.verification_options) ? new libtextclassifier3::VerificationOptionsT(*o.verification_options) : nullptr),
5890         serialized_entity_data(o.serialized_entity_data),
5891         entity_data((o.entity_data) ? new libtextclassifier3::EntityDataT(*o.entity_data) : nullptr) {
5892   capturing_group.reserve(o.capturing_group.size());
5893   for (const auto &capturing_group_ : o.capturing_group) { capturing_group.emplace_back((capturing_group_) ? new libtextclassifier3::CapturingGroupT(*capturing_group_) : nullptr); }
5894 }
5895 
5896 inline PatternT &PatternT::operator=(PatternT o) FLATBUFFERS_NOEXCEPT {
5897   std::swap(collection_name, o.collection_name);
5898   std::swap(pattern, o.pattern);
5899   std::swap(enabled_modes, o.enabled_modes);
5900   std::swap(target_classification_score, o.target_classification_score);
5901   std::swap(priority_score, o.priority_score);
5902   std::swap(use_approximate_matching, o.use_approximate_matching);
5903   std::swap(compressed_pattern, o.compressed_pattern);
5904   std::swap(verification_options, o.verification_options);
5905   std::swap(capturing_group, o.capturing_group);
5906   std::swap(serialized_entity_data, o.serialized_entity_data);
5907   std::swap(entity_data, o.entity_data);
5908   return *this;
5909 }
5910 
UnPack(const flatbuffers::resolver_function_t * _resolver)5911 inline PatternT *Pattern::UnPack(const flatbuffers::resolver_function_t *_resolver) const {
5912   auto _o = std::unique_ptr<PatternT>(new PatternT());
5913   UnPackTo(_o.get(), _resolver);
5914   return _o.release();
5915 }
5916 
UnPackTo(PatternT * _o,const flatbuffers::resolver_function_t * _resolver)5917 inline void Pattern::UnPackTo(PatternT *_o, const flatbuffers::resolver_function_t *_resolver) const {
5918   (void)_o;
5919   (void)_resolver;
5920   { auto _e = collection_name(); if (_e) _o->collection_name = _e->str(); }
5921   { auto _e = pattern(); if (_e) _o->pattern = _e->str(); }
5922   { auto _e = enabled_modes(); _o->enabled_modes = _e; }
5923   { auto _e = target_classification_score(); _o->target_classification_score = _e; }
5924   { auto _e = priority_score(); _o->priority_score = _e; }
5925   { auto _e = use_approximate_matching(); _o->use_approximate_matching = _e; }
5926   { auto _e = compressed_pattern(); if (_e) _o->compressed_pattern = std::unique_ptr<libtextclassifier3::CompressedBufferT>(_e->UnPack(_resolver)); }
5927   { auto _e = verification_options(); if (_e) _o->verification_options = std::unique_ptr<libtextclassifier3::VerificationOptionsT>(_e->UnPack(_resolver)); }
5928   { auto _e = capturing_group(); if (_e) { _o->capturing_group.resize(_e->size()); for (flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { _o->capturing_group[_i] = std::unique_ptr<libtextclassifier3::CapturingGroupT>(_e->Get(_i)->UnPack(_resolver)); } } }
5929   { auto _e = serialized_entity_data(); if (_e) _o->serialized_entity_data = _e->str(); }
5930   { auto _e = entity_data(); if (_e) _o->entity_data = std::unique_ptr<libtextclassifier3::EntityDataT>(_e->UnPack(_resolver)); }
5931 }
5932 
Pack(flatbuffers::FlatBufferBuilder & _fbb,const PatternT * _o,const flatbuffers::rehasher_function_t * _rehasher)5933 inline flatbuffers::Offset<Pattern> Pattern::Pack(flatbuffers::FlatBufferBuilder &_fbb, const PatternT* _o, const flatbuffers::rehasher_function_t *_rehasher) {
5934   return CreatePattern(_fbb, _o, _rehasher);
5935 }
5936 
CreatePattern(flatbuffers::FlatBufferBuilder & _fbb,const PatternT * _o,const flatbuffers::rehasher_function_t * _rehasher)5937 inline flatbuffers::Offset<Pattern> CreatePattern(flatbuffers::FlatBufferBuilder &_fbb, const PatternT *_o, const flatbuffers::rehasher_function_t *_rehasher) {
5938   (void)_rehasher;
5939   (void)_o;
5940   struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const PatternT* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va;
5941   auto _collection_name = _o->collection_name.empty() ? 0 : _fbb.CreateSharedString(_o->collection_name);
5942   auto _pattern = _o->pattern.empty() ? 0 : _fbb.CreateSharedString(_o->pattern);
5943   auto _enabled_modes = _o->enabled_modes;
5944   auto _target_classification_score = _o->target_classification_score;
5945   auto _priority_score = _o->priority_score;
5946   auto _use_approximate_matching = _o->use_approximate_matching;
5947   auto _compressed_pattern = _o->compressed_pattern ? CreateCompressedBuffer(_fbb, _o->compressed_pattern.get(), _rehasher) : 0;
5948   auto _verification_options = _o->verification_options ? CreateVerificationOptions(_fbb, _o->verification_options.get(), _rehasher) : 0;
5949   auto _capturing_group = _o->capturing_group.size() ? _fbb.CreateVector<flatbuffers::Offset<libtextclassifier3::CapturingGroup>> (_o->capturing_group.size(), [](size_t i, _VectorArgs *__va) { return CreateCapturingGroup(*__va->__fbb, __va->__o->capturing_group[i].get(), __va->__rehasher); }, &_va ) : 0;
5950   auto _serialized_entity_data = _o->serialized_entity_data.empty() ? 0 : _fbb.CreateSharedString(_o->serialized_entity_data);
5951   auto _entity_data = _o->entity_data ? CreateEntityData(_fbb, _o->entity_data.get(), _rehasher) : 0;
5952   return libtextclassifier3::RegexModel_::CreatePattern(
5953       _fbb,
5954       _collection_name,
5955       _pattern,
5956       _enabled_modes,
5957       _target_classification_score,
5958       _priority_score,
5959       _use_approximate_matching,
5960       _compressed_pattern,
5961       _verification_options,
5962       _capturing_group,
5963       _serialized_entity_data,
5964       _entity_data);
5965 }
5966 
5967 }  // namespace RegexModel_
5968 
RegexModelT(const RegexModelT & o)5969 inline RegexModelT::RegexModelT(const RegexModelT &o)
5970       : lazy_regex_compilation(o.lazy_regex_compilation),
5971         lua_verifier(o.lua_verifier) {
5972   patterns.reserve(o.patterns.size());
5973   for (const auto &patterns_ : o.patterns) { patterns.emplace_back((patterns_) ? new libtextclassifier3::RegexModel_::PatternT(*patterns_) : nullptr); }
5974 }
5975 
5976 inline RegexModelT &RegexModelT::operator=(RegexModelT o) FLATBUFFERS_NOEXCEPT {
5977   std::swap(patterns, o.patterns);
5978   std::swap(lazy_regex_compilation, o.lazy_regex_compilation);
5979   std::swap(lua_verifier, o.lua_verifier);
5980   return *this;
5981 }
5982 
UnPack(const flatbuffers::resolver_function_t * _resolver)5983 inline RegexModelT *RegexModel::UnPack(const flatbuffers::resolver_function_t *_resolver) const {
5984   auto _o = std::unique_ptr<RegexModelT>(new RegexModelT());
5985   UnPackTo(_o.get(), _resolver);
5986   return _o.release();
5987 }
5988 
UnPackTo(RegexModelT * _o,const flatbuffers::resolver_function_t * _resolver)5989 inline void RegexModel::UnPackTo(RegexModelT *_o, const flatbuffers::resolver_function_t *_resolver) const {
5990   (void)_o;
5991   (void)_resolver;
5992   { auto _e = patterns(); if (_e) { _o->patterns.resize(_e->size()); for (flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { _o->patterns[_i] = std::unique_ptr<libtextclassifier3::RegexModel_::PatternT>(_e->Get(_i)->UnPack(_resolver)); } } }
5993   { auto _e = lazy_regex_compilation(); _o->lazy_regex_compilation = _e; }
5994   { auto _e = lua_verifier(); if (_e) { _o->lua_verifier.resize(_e->size()); for (flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { _o->lua_verifier[_i] = _e->Get(_i)->str(); } } }
5995 }
5996 
Pack(flatbuffers::FlatBufferBuilder & _fbb,const RegexModelT * _o,const flatbuffers::rehasher_function_t * _rehasher)5997 inline flatbuffers::Offset<RegexModel> RegexModel::Pack(flatbuffers::FlatBufferBuilder &_fbb, const RegexModelT* _o, const flatbuffers::rehasher_function_t *_rehasher) {
5998   return CreateRegexModel(_fbb, _o, _rehasher);
5999 }
6000 
CreateRegexModel(flatbuffers::FlatBufferBuilder & _fbb,const RegexModelT * _o,const flatbuffers::rehasher_function_t * _rehasher)6001 inline flatbuffers::Offset<RegexModel> CreateRegexModel(flatbuffers::FlatBufferBuilder &_fbb, const RegexModelT *_o, const flatbuffers::rehasher_function_t *_rehasher) {
6002   (void)_rehasher;
6003   (void)_o;
6004   struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const RegexModelT* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va;
6005   auto _patterns = _o->patterns.size() ? _fbb.CreateVector<flatbuffers::Offset<libtextclassifier3::RegexModel_::Pattern>> (_o->patterns.size(), [](size_t i, _VectorArgs *__va) { return CreatePattern(*__va->__fbb, __va->__o->patterns[i].get(), __va->__rehasher); }, &_va ) : 0;
6006   auto _lazy_regex_compilation = _o->lazy_regex_compilation;
6007   auto _lua_verifier = _o->lua_verifier.size() ? _fbb.CreateVectorOfStrings(_o->lua_verifier) : 0;
6008   return libtextclassifier3::CreateRegexModel(
6009       _fbb,
6010       _patterns,
6011       _lazy_regex_compilation,
6012       _lua_verifier);
6013 }
6014 
6015 namespace DatetimeModelPattern_ {
6016 
RegexT(const RegexT & o)6017 inline RegexT::RegexT(const RegexT &o)
6018       : pattern(o.pattern),
6019         groups(o.groups),
6020         compressed_pattern((o.compressed_pattern) ? new libtextclassifier3::CompressedBufferT(*o.compressed_pattern) : nullptr) {
6021 }
6022 
6023 inline RegexT &RegexT::operator=(RegexT o) FLATBUFFERS_NOEXCEPT {
6024   std::swap(pattern, o.pattern);
6025   std::swap(groups, o.groups);
6026   std::swap(compressed_pattern, o.compressed_pattern);
6027   return *this;
6028 }
6029 
UnPack(const flatbuffers::resolver_function_t * _resolver)6030 inline RegexT *Regex::UnPack(const flatbuffers::resolver_function_t *_resolver) const {
6031   auto _o = std::unique_ptr<RegexT>(new RegexT());
6032   UnPackTo(_o.get(), _resolver);
6033   return _o.release();
6034 }
6035 
UnPackTo(RegexT * _o,const flatbuffers::resolver_function_t * _resolver)6036 inline void Regex::UnPackTo(RegexT *_o, const flatbuffers::resolver_function_t *_resolver) const {
6037   (void)_o;
6038   (void)_resolver;
6039   { auto _e = pattern(); if (_e) _o->pattern = _e->str(); }
6040   { auto _e = groups(); if (_e) { _o->groups.resize(_e->size()); for (flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { _o->groups[_i] = static_cast<libtextclassifier3::DatetimeGroupType>(_e->Get(_i)); } } }
6041   { auto _e = compressed_pattern(); if (_e) _o->compressed_pattern = std::unique_ptr<libtextclassifier3::CompressedBufferT>(_e->UnPack(_resolver)); }
6042 }
6043 
Pack(flatbuffers::FlatBufferBuilder & _fbb,const RegexT * _o,const flatbuffers::rehasher_function_t * _rehasher)6044 inline flatbuffers::Offset<Regex> Regex::Pack(flatbuffers::FlatBufferBuilder &_fbb, const RegexT* _o, const flatbuffers::rehasher_function_t *_rehasher) {
6045   return CreateRegex(_fbb, _o, _rehasher);
6046 }
6047 
CreateRegex(flatbuffers::FlatBufferBuilder & _fbb,const RegexT * _o,const flatbuffers::rehasher_function_t * _rehasher)6048 inline flatbuffers::Offset<Regex> CreateRegex(flatbuffers::FlatBufferBuilder &_fbb, const RegexT *_o, const flatbuffers::rehasher_function_t *_rehasher) {
6049   (void)_rehasher;
6050   (void)_o;
6051   struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const RegexT* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va;
6052   auto _pattern = _o->pattern.empty() ? 0 : _fbb.CreateSharedString(_o->pattern);
6053   auto _groups = _o->groups.size() ? _fbb.CreateVectorScalarCast<int32_t>(flatbuffers::data(_o->groups), _o->groups.size()) : 0;
6054   auto _compressed_pattern = _o->compressed_pattern ? CreateCompressedBuffer(_fbb, _o->compressed_pattern.get(), _rehasher) : 0;
6055   return libtextclassifier3::DatetimeModelPattern_::CreateRegex(
6056       _fbb,
6057       _pattern,
6058       _groups,
6059       _compressed_pattern);
6060 }
6061 
6062 }  // namespace DatetimeModelPattern_
6063 
DatetimeModelPatternT(const DatetimeModelPatternT & o)6064 inline DatetimeModelPatternT::DatetimeModelPatternT(const DatetimeModelPatternT &o)
6065       : locales(o.locales),
6066         target_classification_score(o.target_classification_score),
6067         priority_score(o.priority_score),
6068         enabled_modes(o.enabled_modes),
6069         enabled_annotation_usecases(o.enabled_annotation_usecases) {
6070   regexes.reserve(o.regexes.size());
6071   for (const auto &regexes_ : o.regexes) { regexes.emplace_back((regexes_) ? new libtextclassifier3::DatetimeModelPattern_::RegexT(*regexes_) : nullptr); }
6072 }
6073 
6074 inline DatetimeModelPatternT &DatetimeModelPatternT::operator=(DatetimeModelPatternT o) FLATBUFFERS_NOEXCEPT {
6075   std::swap(regexes, o.regexes);
6076   std::swap(locales, o.locales);
6077   std::swap(target_classification_score, o.target_classification_score);
6078   std::swap(priority_score, o.priority_score);
6079   std::swap(enabled_modes, o.enabled_modes);
6080   std::swap(enabled_annotation_usecases, o.enabled_annotation_usecases);
6081   return *this;
6082 }
6083 
UnPack(const flatbuffers::resolver_function_t * _resolver)6084 inline DatetimeModelPatternT *DatetimeModelPattern::UnPack(const flatbuffers::resolver_function_t *_resolver) const {
6085   auto _o = std::unique_ptr<DatetimeModelPatternT>(new DatetimeModelPatternT());
6086   UnPackTo(_o.get(), _resolver);
6087   return _o.release();
6088 }
6089 
UnPackTo(DatetimeModelPatternT * _o,const flatbuffers::resolver_function_t * _resolver)6090 inline void DatetimeModelPattern::UnPackTo(DatetimeModelPatternT *_o, const flatbuffers::resolver_function_t *_resolver) const {
6091   (void)_o;
6092   (void)_resolver;
6093   { auto _e = regexes(); if (_e) { _o->regexes.resize(_e->size()); for (flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { _o->regexes[_i] = std::unique_ptr<libtextclassifier3::DatetimeModelPattern_::RegexT>(_e->Get(_i)->UnPack(_resolver)); } } }
6094   { auto _e = locales(); if (_e) { _o->locales.resize(_e->size()); for (flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { _o->locales[_i] = _e->Get(_i); } } }
6095   { auto _e = target_classification_score(); _o->target_classification_score = _e; }
6096   { auto _e = priority_score(); _o->priority_score = _e; }
6097   { auto _e = enabled_modes(); _o->enabled_modes = _e; }
6098   { auto _e = enabled_annotation_usecases(); _o->enabled_annotation_usecases = _e; }
6099 }
6100 
Pack(flatbuffers::FlatBufferBuilder & _fbb,const DatetimeModelPatternT * _o,const flatbuffers::rehasher_function_t * _rehasher)6101 inline flatbuffers::Offset<DatetimeModelPattern> DatetimeModelPattern::Pack(flatbuffers::FlatBufferBuilder &_fbb, const DatetimeModelPatternT* _o, const flatbuffers::rehasher_function_t *_rehasher) {
6102   return CreateDatetimeModelPattern(_fbb, _o, _rehasher);
6103 }
6104 
CreateDatetimeModelPattern(flatbuffers::FlatBufferBuilder & _fbb,const DatetimeModelPatternT * _o,const flatbuffers::rehasher_function_t * _rehasher)6105 inline flatbuffers::Offset<DatetimeModelPattern> CreateDatetimeModelPattern(flatbuffers::FlatBufferBuilder &_fbb, const DatetimeModelPatternT *_o, const flatbuffers::rehasher_function_t *_rehasher) {
6106   (void)_rehasher;
6107   (void)_o;
6108   struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const DatetimeModelPatternT* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va;
6109   auto _regexes = _o->regexes.size() ? _fbb.CreateVector<flatbuffers::Offset<libtextclassifier3::DatetimeModelPattern_::Regex>> (_o->regexes.size(), [](size_t i, _VectorArgs *__va) { return CreateRegex(*__va->__fbb, __va->__o->regexes[i].get(), __va->__rehasher); }, &_va ) : 0;
6110   auto _locales = _o->locales.size() ? _fbb.CreateVector(_o->locales) : 0;
6111   auto _target_classification_score = _o->target_classification_score;
6112   auto _priority_score = _o->priority_score;
6113   auto _enabled_modes = _o->enabled_modes;
6114   auto _enabled_annotation_usecases = _o->enabled_annotation_usecases;
6115   return libtextclassifier3::CreateDatetimeModelPattern(
6116       _fbb,
6117       _regexes,
6118       _locales,
6119       _target_classification_score,
6120       _priority_score,
6121       _enabled_modes,
6122       _enabled_annotation_usecases);
6123 }
6124 
DatetimeModelExtractorT(const DatetimeModelExtractorT & o)6125 inline DatetimeModelExtractorT::DatetimeModelExtractorT(const DatetimeModelExtractorT &o)
6126       : extractor(o.extractor),
6127         pattern(o.pattern),
6128         locales(o.locales),
6129         compressed_pattern((o.compressed_pattern) ? new libtextclassifier3::CompressedBufferT(*o.compressed_pattern) : nullptr) {
6130 }
6131 
6132 inline DatetimeModelExtractorT &DatetimeModelExtractorT::operator=(DatetimeModelExtractorT o) FLATBUFFERS_NOEXCEPT {
6133   std::swap(extractor, o.extractor);
6134   std::swap(pattern, o.pattern);
6135   std::swap(locales, o.locales);
6136   std::swap(compressed_pattern, o.compressed_pattern);
6137   return *this;
6138 }
6139 
UnPack(const flatbuffers::resolver_function_t * _resolver)6140 inline DatetimeModelExtractorT *DatetimeModelExtractor::UnPack(const flatbuffers::resolver_function_t *_resolver) const {
6141   auto _o = std::unique_ptr<DatetimeModelExtractorT>(new DatetimeModelExtractorT());
6142   UnPackTo(_o.get(), _resolver);
6143   return _o.release();
6144 }
6145 
UnPackTo(DatetimeModelExtractorT * _o,const flatbuffers::resolver_function_t * _resolver)6146 inline void DatetimeModelExtractor::UnPackTo(DatetimeModelExtractorT *_o, const flatbuffers::resolver_function_t *_resolver) const {
6147   (void)_o;
6148   (void)_resolver;
6149   { auto _e = extractor(); _o->extractor = _e; }
6150   { auto _e = pattern(); if (_e) _o->pattern = _e->str(); }
6151   { auto _e = locales(); if (_e) { _o->locales.resize(_e->size()); for (flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { _o->locales[_i] = _e->Get(_i); } } }
6152   { auto _e = compressed_pattern(); if (_e) _o->compressed_pattern = std::unique_ptr<libtextclassifier3::CompressedBufferT>(_e->UnPack(_resolver)); }
6153 }
6154 
Pack(flatbuffers::FlatBufferBuilder & _fbb,const DatetimeModelExtractorT * _o,const flatbuffers::rehasher_function_t * _rehasher)6155 inline flatbuffers::Offset<DatetimeModelExtractor> DatetimeModelExtractor::Pack(flatbuffers::FlatBufferBuilder &_fbb, const DatetimeModelExtractorT* _o, const flatbuffers::rehasher_function_t *_rehasher) {
6156   return CreateDatetimeModelExtractor(_fbb, _o, _rehasher);
6157 }
6158 
CreateDatetimeModelExtractor(flatbuffers::FlatBufferBuilder & _fbb,const DatetimeModelExtractorT * _o,const flatbuffers::rehasher_function_t * _rehasher)6159 inline flatbuffers::Offset<DatetimeModelExtractor> CreateDatetimeModelExtractor(flatbuffers::FlatBufferBuilder &_fbb, const DatetimeModelExtractorT *_o, const flatbuffers::rehasher_function_t *_rehasher) {
6160   (void)_rehasher;
6161   (void)_o;
6162   struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const DatetimeModelExtractorT* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va;
6163   auto _extractor = _o->extractor;
6164   auto _pattern = _o->pattern.empty() ? 0 : _fbb.CreateSharedString(_o->pattern);
6165   auto _locales = _o->locales.size() ? _fbb.CreateVector(_o->locales) : 0;
6166   auto _compressed_pattern = _o->compressed_pattern ? CreateCompressedBuffer(_fbb, _o->compressed_pattern.get(), _rehasher) : 0;
6167   return libtextclassifier3::CreateDatetimeModelExtractor(
6168       _fbb,
6169       _extractor,
6170       _pattern,
6171       _locales,
6172       _compressed_pattern);
6173 }
6174 
DatetimeModelT(const DatetimeModelT & o)6175 inline DatetimeModelT::DatetimeModelT(const DatetimeModelT &o)
6176       : locales(o.locales),
6177         use_extractors_for_locating(o.use_extractors_for_locating),
6178         default_locales(o.default_locales),
6179         generate_alternative_interpretations_when_ambiguous(o.generate_alternative_interpretations_when_ambiguous),
6180         lazy_regex_compilation(o.lazy_regex_compilation),
6181         prefer_future_for_unspecified_date(o.prefer_future_for_unspecified_date) {
6182   patterns.reserve(o.patterns.size());
6183   for (const auto &patterns_ : o.patterns) { patterns.emplace_back((patterns_) ? new libtextclassifier3::DatetimeModelPatternT(*patterns_) : nullptr); }
6184   extractors.reserve(o.extractors.size());
6185   for (const auto &extractors_ : o.extractors) { extractors.emplace_back((extractors_) ? new libtextclassifier3::DatetimeModelExtractorT(*extractors_) : nullptr); }
6186 }
6187 
6188 inline DatetimeModelT &DatetimeModelT::operator=(DatetimeModelT o) FLATBUFFERS_NOEXCEPT {
6189   std::swap(locales, o.locales);
6190   std::swap(patterns, o.patterns);
6191   std::swap(extractors, o.extractors);
6192   std::swap(use_extractors_for_locating, o.use_extractors_for_locating);
6193   std::swap(default_locales, o.default_locales);
6194   std::swap(generate_alternative_interpretations_when_ambiguous, o.generate_alternative_interpretations_when_ambiguous);
6195   std::swap(lazy_regex_compilation, o.lazy_regex_compilation);
6196   std::swap(prefer_future_for_unspecified_date, o.prefer_future_for_unspecified_date);
6197   return *this;
6198 }
6199 
UnPack(const flatbuffers::resolver_function_t * _resolver)6200 inline DatetimeModelT *DatetimeModel::UnPack(const flatbuffers::resolver_function_t *_resolver) const {
6201   auto _o = std::unique_ptr<DatetimeModelT>(new DatetimeModelT());
6202   UnPackTo(_o.get(), _resolver);
6203   return _o.release();
6204 }
6205 
UnPackTo(DatetimeModelT * _o,const flatbuffers::resolver_function_t * _resolver)6206 inline void DatetimeModel::UnPackTo(DatetimeModelT *_o, const flatbuffers::resolver_function_t *_resolver) const {
6207   (void)_o;
6208   (void)_resolver;
6209   { auto _e = locales(); if (_e) { _o->locales.resize(_e->size()); for (flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { _o->locales[_i] = _e->Get(_i)->str(); } } }
6210   { auto _e = patterns(); if (_e) { _o->patterns.resize(_e->size()); for (flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { _o->patterns[_i] = std::unique_ptr<libtextclassifier3::DatetimeModelPatternT>(_e->Get(_i)->UnPack(_resolver)); } } }
6211   { auto _e = extractors(); if (_e) { _o->extractors.resize(_e->size()); for (flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { _o->extractors[_i] = std::unique_ptr<libtextclassifier3::DatetimeModelExtractorT>(_e->Get(_i)->UnPack(_resolver)); } } }
6212   { auto _e = use_extractors_for_locating(); _o->use_extractors_for_locating = _e; }
6213   { auto _e = default_locales(); if (_e) { _o->default_locales.resize(_e->size()); for (flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { _o->default_locales[_i] = _e->Get(_i); } } }
6214   { auto _e = generate_alternative_interpretations_when_ambiguous(); _o->generate_alternative_interpretations_when_ambiguous = _e; }
6215   { auto _e = lazy_regex_compilation(); _o->lazy_regex_compilation = _e; }
6216   { auto _e = prefer_future_for_unspecified_date(); _o->prefer_future_for_unspecified_date = _e; }
6217 }
6218 
Pack(flatbuffers::FlatBufferBuilder & _fbb,const DatetimeModelT * _o,const flatbuffers::rehasher_function_t * _rehasher)6219 inline flatbuffers::Offset<DatetimeModel> DatetimeModel::Pack(flatbuffers::FlatBufferBuilder &_fbb, const DatetimeModelT* _o, const flatbuffers::rehasher_function_t *_rehasher) {
6220   return CreateDatetimeModel(_fbb, _o, _rehasher);
6221 }
6222 
CreateDatetimeModel(flatbuffers::FlatBufferBuilder & _fbb,const DatetimeModelT * _o,const flatbuffers::rehasher_function_t * _rehasher)6223 inline flatbuffers::Offset<DatetimeModel> CreateDatetimeModel(flatbuffers::FlatBufferBuilder &_fbb, const DatetimeModelT *_o, const flatbuffers::rehasher_function_t *_rehasher) {
6224   (void)_rehasher;
6225   (void)_o;
6226   struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const DatetimeModelT* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va;
6227   auto _locales = _o->locales.size() ? _fbb.CreateVectorOfStrings(_o->locales) : 0;
6228   auto _patterns = _o->patterns.size() ? _fbb.CreateVector<flatbuffers::Offset<libtextclassifier3::DatetimeModelPattern>> (_o->patterns.size(), [](size_t i, _VectorArgs *__va) { return CreateDatetimeModelPattern(*__va->__fbb, __va->__o->patterns[i].get(), __va->__rehasher); }, &_va ) : 0;
6229   auto _extractors = _o->extractors.size() ? _fbb.CreateVector<flatbuffers::Offset<libtextclassifier3::DatetimeModelExtractor>> (_o->extractors.size(), [](size_t i, _VectorArgs *__va) { return CreateDatetimeModelExtractor(*__va->__fbb, __va->__o->extractors[i].get(), __va->__rehasher); }, &_va ) : 0;
6230   auto _use_extractors_for_locating = _o->use_extractors_for_locating;
6231   auto _default_locales = _o->default_locales.size() ? _fbb.CreateVector(_o->default_locales) : 0;
6232   auto _generate_alternative_interpretations_when_ambiguous = _o->generate_alternative_interpretations_when_ambiguous;
6233   auto _lazy_regex_compilation = _o->lazy_regex_compilation;
6234   auto _prefer_future_for_unspecified_date = _o->prefer_future_for_unspecified_date;
6235   return libtextclassifier3::CreateDatetimeModel(
6236       _fbb,
6237       _locales,
6238       _patterns,
6239       _extractors,
6240       _use_extractors_for_locating,
6241       _default_locales,
6242       _generate_alternative_interpretations_when_ambiguous,
6243       _lazy_regex_compilation,
6244       _prefer_future_for_unspecified_date);
6245 }
6246 
GrammarTokenizerOptionsT(const GrammarTokenizerOptionsT & o)6247 inline GrammarTokenizerOptionsT::GrammarTokenizerOptionsT(const GrammarTokenizerOptionsT &o)
6248       : tokenization_type(o.tokenization_type),
6249         icu_preserve_whitespace_tokens(o.icu_preserve_whitespace_tokens),
6250         tokenize_on_script_change(o.tokenize_on_script_change) {
6251   tokenization_codepoint_config.reserve(o.tokenization_codepoint_config.size());
6252   for (const auto &tokenization_codepoint_config_ : o.tokenization_codepoint_config) { tokenization_codepoint_config.emplace_back((tokenization_codepoint_config_) ? new libtextclassifier3::TokenizationCodepointRangeT(*tokenization_codepoint_config_) : nullptr); }
6253   internal_tokenizer_codepoint_ranges.reserve(o.internal_tokenizer_codepoint_ranges.size());
6254   for (const auto &internal_tokenizer_codepoint_ranges_ : o.internal_tokenizer_codepoint_ranges) { internal_tokenizer_codepoint_ranges.emplace_back((internal_tokenizer_codepoint_ranges_) ? new libtextclassifier3::CodepointRangeT(*internal_tokenizer_codepoint_ranges_) : nullptr); }
6255 }
6256 
6257 inline GrammarTokenizerOptionsT &GrammarTokenizerOptionsT::operator=(GrammarTokenizerOptionsT o) FLATBUFFERS_NOEXCEPT {
6258   std::swap(tokenization_type, o.tokenization_type);
6259   std::swap(icu_preserve_whitespace_tokens, o.icu_preserve_whitespace_tokens);
6260   std::swap(tokenization_codepoint_config, o.tokenization_codepoint_config);
6261   std::swap(internal_tokenizer_codepoint_ranges, o.internal_tokenizer_codepoint_ranges);
6262   std::swap(tokenize_on_script_change, o.tokenize_on_script_change);
6263   return *this;
6264 }
6265 
UnPack(const flatbuffers::resolver_function_t * _resolver)6266 inline GrammarTokenizerOptionsT *GrammarTokenizerOptions::UnPack(const flatbuffers::resolver_function_t *_resolver) const {
6267   auto _o = std::unique_ptr<GrammarTokenizerOptionsT>(new GrammarTokenizerOptionsT());
6268   UnPackTo(_o.get(), _resolver);
6269   return _o.release();
6270 }
6271 
UnPackTo(GrammarTokenizerOptionsT * _o,const flatbuffers::resolver_function_t * _resolver)6272 inline void GrammarTokenizerOptions::UnPackTo(GrammarTokenizerOptionsT *_o, const flatbuffers::resolver_function_t *_resolver) const {
6273   (void)_o;
6274   (void)_resolver;
6275   { auto _e = tokenization_type(); _o->tokenization_type = _e; }
6276   { auto _e = icu_preserve_whitespace_tokens(); _o->icu_preserve_whitespace_tokens = _e; }
6277   { auto _e = tokenization_codepoint_config(); if (_e) { _o->tokenization_codepoint_config.resize(_e->size()); for (flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { _o->tokenization_codepoint_config[_i] = std::unique_ptr<libtextclassifier3::TokenizationCodepointRangeT>(_e->Get(_i)->UnPack(_resolver)); } } }
6278   { auto _e = internal_tokenizer_codepoint_ranges(); if (_e) { _o->internal_tokenizer_codepoint_ranges.resize(_e->size()); for (flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { _o->internal_tokenizer_codepoint_ranges[_i] = std::unique_ptr<libtextclassifier3::CodepointRangeT>(_e->Get(_i)->UnPack(_resolver)); } } }
6279   { auto _e = tokenize_on_script_change(); _o->tokenize_on_script_change = _e; }
6280 }
6281 
Pack(flatbuffers::FlatBufferBuilder & _fbb,const GrammarTokenizerOptionsT * _o,const flatbuffers::rehasher_function_t * _rehasher)6282 inline flatbuffers::Offset<GrammarTokenizerOptions> GrammarTokenizerOptions::Pack(flatbuffers::FlatBufferBuilder &_fbb, const GrammarTokenizerOptionsT* _o, const flatbuffers::rehasher_function_t *_rehasher) {
6283   return CreateGrammarTokenizerOptions(_fbb, _o, _rehasher);
6284 }
6285 
CreateGrammarTokenizerOptions(flatbuffers::FlatBufferBuilder & _fbb,const GrammarTokenizerOptionsT * _o,const flatbuffers::rehasher_function_t * _rehasher)6286 inline flatbuffers::Offset<GrammarTokenizerOptions> CreateGrammarTokenizerOptions(flatbuffers::FlatBufferBuilder &_fbb, const GrammarTokenizerOptionsT *_o, const flatbuffers::rehasher_function_t *_rehasher) {
6287   (void)_rehasher;
6288   (void)_o;
6289   struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const GrammarTokenizerOptionsT* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va;
6290   auto _tokenization_type = _o->tokenization_type;
6291   auto _icu_preserve_whitespace_tokens = _o->icu_preserve_whitespace_tokens;
6292   auto _tokenization_codepoint_config = _o->tokenization_codepoint_config.size() ? _fbb.CreateVector<flatbuffers::Offset<libtextclassifier3::TokenizationCodepointRange>> (_o->tokenization_codepoint_config.size(), [](size_t i, _VectorArgs *__va) { return CreateTokenizationCodepointRange(*__va->__fbb, __va->__o->tokenization_codepoint_config[i].get(), __va->__rehasher); }, &_va ) : 0;
6293   auto _internal_tokenizer_codepoint_ranges = _o->internal_tokenizer_codepoint_ranges.size() ? _fbb.CreateVector<flatbuffers::Offset<libtextclassifier3::CodepointRange>> (_o->internal_tokenizer_codepoint_ranges.size(), [](size_t i, _VectorArgs *__va) { return CreateCodepointRange(*__va->__fbb, __va->__o->internal_tokenizer_codepoint_ranges[i].get(), __va->__rehasher); }, &_va ) : 0;
6294   auto _tokenize_on_script_change = _o->tokenize_on_script_change;
6295   return libtextclassifier3::CreateGrammarTokenizerOptions(
6296       _fbb,
6297       _tokenization_type,
6298       _icu_preserve_whitespace_tokens,
6299       _tokenization_codepoint_config,
6300       _internal_tokenizer_codepoint_ranges,
6301       _tokenize_on_script_change);
6302 }
6303 
6304 namespace DatetimeModelLibrary_ {
6305 
ItemT(const ItemT & o)6306 inline ItemT::ItemT(const ItemT &o)
6307       : key(o.key),
6308         value((o.value) ? new libtextclassifier3::DatetimeModelT(*o.value) : nullptr) {
6309 }
6310 
6311 inline ItemT &ItemT::operator=(ItemT o) FLATBUFFERS_NOEXCEPT {
6312   std::swap(key, o.key);
6313   std::swap(value, o.value);
6314   return *this;
6315 }
6316 
UnPack(const flatbuffers::resolver_function_t * _resolver)6317 inline ItemT *Item::UnPack(const flatbuffers::resolver_function_t *_resolver) const {
6318   auto _o = std::unique_ptr<ItemT>(new ItemT());
6319   UnPackTo(_o.get(), _resolver);
6320   return _o.release();
6321 }
6322 
UnPackTo(ItemT * _o,const flatbuffers::resolver_function_t * _resolver)6323 inline void Item::UnPackTo(ItemT *_o, const flatbuffers::resolver_function_t *_resolver) const {
6324   (void)_o;
6325   (void)_resolver;
6326   { auto _e = key(); if (_e) _o->key = _e->str(); }
6327   { auto _e = value(); if (_e) _o->value = std::unique_ptr<libtextclassifier3::DatetimeModelT>(_e->UnPack(_resolver)); }
6328 }
6329 
Pack(flatbuffers::FlatBufferBuilder & _fbb,const ItemT * _o,const flatbuffers::rehasher_function_t * _rehasher)6330 inline flatbuffers::Offset<Item> Item::Pack(flatbuffers::FlatBufferBuilder &_fbb, const ItemT* _o, const flatbuffers::rehasher_function_t *_rehasher) {
6331   return CreateItem(_fbb, _o, _rehasher);
6332 }
6333 
CreateItem(flatbuffers::FlatBufferBuilder & _fbb,const ItemT * _o,const flatbuffers::rehasher_function_t * _rehasher)6334 inline flatbuffers::Offset<Item> CreateItem(flatbuffers::FlatBufferBuilder &_fbb, const ItemT *_o, const flatbuffers::rehasher_function_t *_rehasher) {
6335   (void)_rehasher;
6336   (void)_o;
6337   struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const ItemT* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va;
6338   auto _key = _o->key.empty() ? 0 : _fbb.CreateSharedString(_o->key);
6339   auto _value = _o->value ? CreateDatetimeModel(_fbb, _o->value.get(), _rehasher) : 0;
6340   return libtextclassifier3::DatetimeModelLibrary_::CreateItem(
6341       _fbb,
6342       _key,
6343       _value);
6344 }
6345 
6346 }  // namespace DatetimeModelLibrary_
6347 
DatetimeModelLibraryT(const DatetimeModelLibraryT & o)6348 inline DatetimeModelLibraryT::DatetimeModelLibraryT(const DatetimeModelLibraryT &o) {
6349   models.reserve(o.models.size());
6350   for (const auto &models_ : o.models) { models.emplace_back((models_) ? new libtextclassifier3::DatetimeModelLibrary_::ItemT(*models_) : nullptr); }
6351 }
6352 
6353 inline DatetimeModelLibraryT &DatetimeModelLibraryT::operator=(DatetimeModelLibraryT o) FLATBUFFERS_NOEXCEPT {
6354   std::swap(models, o.models);
6355   return *this;
6356 }
6357 
UnPack(const flatbuffers::resolver_function_t * _resolver)6358 inline DatetimeModelLibraryT *DatetimeModelLibrary::UnPack(const flatbuffers::resolver_function_t *_resolver) const {
6359   auto _o = std::unique_ptr<DatetimeModelLibraryT>(new DatetimeModelLibraryT());
6360   UnPackTo(_o.get(), _resolver);
6361   return _o.release();
6362 }
6363 
UnPackTo(DatetimeModelLibraryT * _o,const flatbuffers::resolver_function_t * _resolver)6364 inline void DatetimeModelLibrary::UnPackTo(DatetimeModelLibraryT *_o, const flatbuffers::resolver_function_t *_resolver) const {
6365   (void)_o;
6366   (void)_resolver;
6367   { auto _e = models(); if (_e) { _o->models.resize(_e->size()); for (flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { _o->models[_i] = std::unique_ptr<libtextclassifier3::DatetimeModelLibrary_::ItemT>(_e->Get(_i)->UnPack(_resolver)); } } }
6368 }
6369 
Pack(flatbuffers::FlatBufferBuilder & _fbb,const DatetimeModelLibraryT * _o,const flatbuffers::rehasher_function_t * _rehasher)6370 inline flatbuffers::Offset<DatetimeModelLibrary> DatetimeModelLibrary::Pack(flatbuffers::FlatBufferBuilder &_fbb, const DatetimeModelLibraryT* _o, const flatbuffers::rehasher_function_t *_rehasher) {
6371   return CreateDatetimeModelLibrary(_fbb, _o, _rehasher);
6372 }
6373 
CreateDatetimeModelLibrary(flatbuffers::FlatBufferBuilder & _fbb,const DatetimeModelLibraryT * _o,const flatbuffers::rehasher_function_t * _rehasher)6374 inline flatbuffers::Offset<DatetimeModelLibrary> CreateDatetimeModelLibrary(flatbuffers::FlatBufferBuilder &_fbb, const DatetimeModelLibraryT *_o, const flatbuffers::rehasher_function_t *_rehasher) {
6375   (void)_rehasher;
6376   (void)_o;
6377   struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const DatetimeModelLibraryT* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va;
6378   auto _models = _o->models.size() ? _fbb.CreateVector<flatbuffers::Offset<libtextclassifier3::DatetimeModelLibrary_::Item>> (_o->models.size(), [](size_t i, _VectorArgs *__va) { return CreateItem(*__va->__fbb, __va->__o->models[i].get(), __va->__rehasher); }, &_va ) : 0;
6379   return libtextclassifier3::CreateDatetimeModelLibrary(
6380       _fbb,
6381       _models);
6382 }
6383 
6384 namespace GrammarModel_ {
6385 
RuleClassificationResultT(const RuleClassificationResultT & o)6386 inline RuleClassificationResultT::RuleClassificationResultT(const RuleClassificationResultT &o)
6387       : collection_name(o.collection_name),
6388         target_classification_score(o.target_classification_score),
6389         priority_score(o.priority_score),
6390         serialized_entity_data(o.serialized_entity_data),
6391         enabled_modes(o.enabled_modes),
6392         entity_data((o.entity_data) ? new libtextclassifier3::EntityDataT(*o.entity_data) : nullptr) {
6393   capturing_group.reserve(o.capturing_group.size());
6394   for (const auto &capturing_group_ : o.capturing_group) { capturing_group.emplace_back((capturing_group_) ? new libtextclassifier3::CapturingGroupT(*capturing_group_) : nullptr); }
6395 }
6396 
6397 inline RuleClassificationResultT &RuleClassificationResultT::operator=(RuleClassificationResultT o) FLATBUFFERS_NOEXCEPT {
6398   std::swap(collection_name, o.collection_name);
6399   std::swap(target_classification_score, o.target_classification_score);
6400   std::swap(priority_score, o.priority_score);
6401   std::swap(capturing_group, o.capturing_group);
6402   std::swap(serialized_entity_data, o.serialized_entity_data);
6403   std::swap(enabled_modes, o.enabled_modes);
6404   std::swap(entity_data, o.entity_data);
6405   return *this;
6406 }
6407 
UnPack(const flatbuffers::resolver_function_t * _resolver)6408 inline RuleClassificationResultT *RuleClassificationResult::UnPack(const flatbuffers::resolver_function_t *_resolver) const {
6409   auto _o = std::unique_ptr<RuleClassificationResultT>(new RuleClassificationResultT());
6410   UnPackTo(_o.get(), _resolver);
6411   return _o.release();
6412 }
6413 
UnPackTo(RuleClassificationResultT * _o,const flatbuffers::resolver_function_t * _resolver)6414 inline void RuleClassificationResult::UnPackTo(RuleClassificationResultT *_o, const flatbuffers::resolver_function_t *_resolver) const {
6415   (void)_o;
6416   (void)_resolver;
6417   { auto _e = collection_name(); if (_e) _o->collection_name = _e->str(); }
6418   { auto _e = target_classification_score(); _o->target_classification_score = _e; }
6419   { auto _e = priority_score(); _o->priority_score = _e; }
6420   { auto _e = capturing_group(); if (_e) { _o->capturing_group.resize(_e->size()); for (flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { _o->capturing_group[_i] = std::unique_ptr<libtextclassifier3::CapturingGroupT>(_e->Get(_i)->UnPack(_resolver)); } } }
6421   { auto _e = serialized_entity_data(); if (_e) _o->serialized_entity_data = _e->str(); }
6422   { auto _e = enabled_modes(); _o->enabled_modes = _e; }
6423   { auto _e = entity_data(); if (_e) _o->entity_data = std::unique_ptr<libtextclassifier3::EntityDataT>(_e->UnPack(_resolver)); }
6424 }
6425 
Pack(flatbuffers::FlatBufferBuilder & _fbb,const RuleClassificationResultT * _o,const flatbuffers::rehasher_function_t * _rehasher)6426 inline flatbuffers::Offset<RuleClassificationResult> RuleClassificationResult::Pack(flatbuffers::FlatBufferBuilder &_fbb, const RuleClassificationResultT* _o, const flatbuffers::rehasher_function_t *_rehasher) {
6427   return CreateRuleClassificationResult(_fbb, _o, _rehasher);
6428 }
6429 
CreateRuleClassificationResult(flatbuffers::FlatBufferBuilder & _fbb,const RuleClassificationResultT * _o,const flatbuffers::rehasher_function_t * _rehasher)6430 inline flatbuffers::Offset<RuleClassificationResult> CreateRuleClassificationResult(flatbuffers::FlatBufferBuilder &_fbb, const RuleClassificationResultT *_o, const flatbuffers::rehasher_function_t *_rehasher) {
6431   (void)_rehasher;
6432   (void)_o;
6433   struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const RuleClassificationResultT* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va;
6434   auto _collection_name = _o->collection_name.empty() ? 0 : _fbb.CreateSharedString(_o->collection_name);
6435   auto _target_classification_score = _o->target_classification_score;
6436   auto _priority_score = _o->priority_score;
6437   auto _capturing_group = _o->capturing_group.size() ? _fbb.CreateVector<flatbuffers::Offset<libtextclassifier3::CapturingGroup>> (_o->capturing_group.size(), [](size_t i, _VectorArgs *__va) { return CreateCapturingGroup(*__va->__fbb, __va->__o->capturing_group[i].get(), __va->__rehasher); }, &_va ) : 0;
6438   auto _serialized_entity_data = _o->serialized_entity_data.empty() ? 0 : _fbb.CreateSharedString(_o->serialized_entity_data);
6439   auto _enabled_modes = _o->enabled_modes;
6440   auto _entity_data = _o->entity_data ? CreateEntityData(_fbb, _o->entity_data.get(), _rehasher) : 0;
6441   return libtextclassifier3::GrammarModel_::CreateRuleClassificationResult(
6442       _fbb,
6443       _collection_name,
6444       _target_classification_score,
6445       _priority_score,
6446       _capturing_group,
6447       _serialized_entity_data,
6448       _enabled_modes,
6449       _entity_data);
6450 }
6451 
6452 }  // namespace GrammarModel_
6453 
GrammarModelT(const GrammarModelT & o)6454 inline GrammarModelT::GrammarModelT(const GrammarModelT &o)
6455       : rules((o.rules) ? new libtextclassifier3::grammar::RulesSetT(*o.rules) : nullptr),
6456         context_left_num_tokens(o.context_left_num_tokens),
6457         context_right_num_tokens(o.context_right_num_tokens),
6458         tokenizer_options((o.tokenizer_options) ? new libtextclassifier3::GrammarTokenizerOptionsT(*o.tokenizer_options) : nullptr),
6459         target_classification_score(o.target_classification_score),
6460         priority_score(o.priority_score),
6461         enabled_modes(o.enabled_modes) {
6462   rule_classification_result.reserve(o.rule_classification_result.size());
6463   for (const auto &rule_classification_result_ : o.rule_classification_result) { rule_classification_result.emplace_back((rule_classification_result_) ? new libtextclassifier3::GrammarModel_::RuleClassificationResultT(*rule_classification_result_) : nullptr); }
6464 }
6465 
6466 inline GrammarModelT &GrammarModelT::operator=(GrammarModelT o) FLATBUFFERS_NOEXCEPT {
6467   std::swap(rules, o.rules);
6468   std::swap(rule_classification_result, o.rule_classification_result);
6469   std::swap(context_left_num_tokens, o.context_left_num_tokens);
6470   std::swap(context_right_num_tokens, o.context_right_num_tokens);
6471   std::swap(tokenizer_options, o.tokenizer_options);
6472   std::swap(target_classification_score, o.target_classification_score);
6473   std::swap(priority_score, o.priority_score);
6474   std::swap(enabled_modes, o.enabled_modes);
6475   return *this;
6476 }
6477 
UnPack(const flatbuffers::resolver_function_t * _resolver)6478 inline GrammarModelT *GrammarModel::UnPack(const flatbuffers::resolver_function_t *_resolver) const {
6479   auto _o = std::unique_ptr<GrammarModelT>(new GrammarModelT());
6480   UnPackTo(_o.get(), _resolver);
6481   return _o.release();
6482 }
6483 
UnPackTo(GrammarModelT * _o,const flatbuffers::resolver_function_t * _resolver)6484 inline void GrammarModel::UnPackTo(GrammarModelT *_o, const flatbuffers::resolver_function_t *_resolver) const {
6485   (void)_o;
6486   (void)_resolver;
6487   { auto _e = rules(); if (_e) _o->rules = std::unique_ptr<libtextclassifier3::grammar::RulesSetT>(_e->UnPack(_resolver)); }
6488   { auto _e = rule_classification_result(); if (_e) { _o->rule_classification_result.resize(_e->size()); for (flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { _o->rule_classification_result[_i] = std::unique_ptr<libtextclassifier3::GrammarModel_::RuleClassificationResultT>(_e->Get(_i)->UnPack(_resolver)); } } }
6489   { auto _e = context_left_num_tokens(); _o->context_left_num_tokens = _e; }
6490   { auto _e = context_right_num_tokens(); _o->context_right_num_tokens = _e; }
6491   { auto _e = tokenizer_options(); if (_e) _o->tokenizer_options = std::unique_ptr<libtextclassifier3::GrammarTokenizerOptionsT>(_e->UnPack(_resolver)); }
6492   { auto _e = target_classification_score(); _o->target_classification_score = _e; }
6493   { auto _e = priority_score(); _o->priority_score = _e; }
6494   { auto _e = enabled_modes(); _o->enabled_modes = _e; }
6495 }
6496 
Pack(flatbuffers::FlatBufferBuilder & _fbb,const GrammarModelT * _o,const flatbuffers::rehasher_function_t * _rehasher)6497 inline flatbuffers::Offset<GrammarModel> GrammarModel::Pack(flatbuffers::FlatBufferBuilder &_fbb, const GrammarModelT* _o, const flatbuffers::rehasher_function_t *_rehasher) {
6498   return CreateGrammarModel(_fbb, _o, _rehasher);
6499 }
6500 
CreateGrammarModel(flatbuffers::FlatBufferBuilder & _fbb,const GrammarModelT * _o,const flatbuffers::rehasher_function_t * _rehasher)6501 inline flatbuffers::Offset<GrammarModel> CreateGrammarModel(flatbuffers::FlatBufferBuilder &_fbb, const GrammarModelT *_o, const flatbuffers::rehasher_function_t *_rehasher) {
6502   (void)_rehasher;
6503   (void)_o;
6504   struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const GrammarModelT* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va;
6505   auto _rules = _o->rules ? CreateRulesSet(_fbb, _o->rules.get(), _rehasher) : 0;
6506   auto _rule_classification_result = _o->rule_classification_result.size() ? _fbb.CreateVector<flatbuffers::Offset<libtextclassifier3::GrammarModel_::RuleClassificationResult>> (_o->rule_classification_result.size(), [](size_t i, _VectorArgs *__va) { return CreateRuleClassificationResult(*__va->__fbb, __va->__o->rule_classification_result[i].get(), __va->__rehasher); }, &_va ) : 0;
6507   auto _context_left_num_tokens = _o->context_left_num_tokens;
6508   auto _context_right_num_tokens = _o->context_right_num_tokens;
6509   auto _tokenizer_options = _o->tokenizer_options ? CreateGrammarTokenizerOptions(_fbb, _o->tokenizer_options.get(), _rehasher) : 0;
6510   auto _target_classification_score = _o->target_classification_score;
6511   auto _priority_score = _o->priority_score;
6512   auto _enabled_modes = _o->enabled_modes;
6513   return libtextclassifier3::CreateGrammarModel(
6514       _fbb,
6515       _rules,
6516       _rule_classification_result,
6517       _context_left_num_tokens,
6518       _context_right_num_tokens,
6519       _tokenizer_options,
6520       _target_classification_score,
6521       _priority_score,
6522       _enabled_modes);
6523 }
6524 
6525 namespace MoneyParsingOptions_ {
6526 
UnPack(const flatbuffers::resolver_function_t * _resolver)6527 inline QuantitiesNameToExponentEntryT *QuantitiesNameToExponentEntry::UnPack(const flatbuffers::resolver_function_t *_resolver) const {
6528   auto _o = std::unique_ptr<QuantitiesNameToExponentEntryT>(new QuantitiesNameToExponentEntryT());
6529   UnPackTo(_o.get(), _resolver);
6530   return _o.release();
6531 }
6532 
UnPackTo(QuantitiesNameToExponentEntryT * _o,const flatbuffers::resolver_function_t * _resolver)6533 inline void QuantitiesNameToExponentEntry::UnPackTo(QuantitiesNameToExponentEntryT *_o, const flatbuffers::resolver_function_t *_resolver) const {
6534   (void)_o;
6535   (void)_resolver;
6536   { auto _e = key(); if (_e) _o->key = _e->str(); }
6537   { auto _e = value(); _o->value = _e; }
6538 }
6539 
Pack(flatbuffers::FlatBufferBuilder & _fbb,const QuantitiesNameToExponentEntryT * _o,const flatbuffers::rehasher_function_t * _rehasher)6540 inline flatbuffers::Offset<QuantitiesNameToExponentEntry> QuantitiesNameToExponentEntry::Pack(flatbuffers::FlatBufferBuilder &_fbb, const QuantitiesNameToExponentEntryT* _o, const flatbuffers::rehasher_function_t *_rehasher) {
6541   return CreateQuantitiesNameToExponentEntry(_fbb, _o, _rehasher);
6542 }
6543 
CreateQuantitiesNameToExponentEntry(flatbuffers::FlatBufferBuilder & _fbb,const QuantitiesNameToExponentEntryT * _o,const flatbuffers::rehasher_function_t * _rehasher)6544 inline flatbuffers::Offset<QuantitiesNameToExponentEntry> CreateQuantitiesNameToExponentEntry(flatbuffers::FlatBufferBuilder &_fbb, const QuantitiesNameToExponentEntryT *_o, const flatbuffers::rehasher_function_t *_rehasher) {
6545   (void)_rehasher;
6546   (void)_o;
6547   struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const QuantitiesNameToExponentEntryT* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va;
6548   auto _key = _fbb.CreateSharedString(_o->key);
6549   auto _value = _o->value;
6550   return libtextclassifier3::MoneyParsingOptions_::CreateQuantitiesNameToExponentEntry(
6551       _fbb,
6552       _key,
6553       _value);
6554 }
6555 
6556 }  // namespace MoneyParsingOptions_
6557 
MoneyParsingOptionsT(const MoneyParsingOptionsT & o)6558 inline MoneyParsingOptionsT::MoneyParsingOptionsT(const MoneyParsingOptionsT &o)
6559       : separators(o.separators) {
6560   quantities_name_to_exponent.reserve(o.quantities_name_to_exponent.size());
6561   for (const auto &quantities_name_to_exponent_ : o.quantities_name_to_exponent) { quantities_name_to_exponent.emplace_back((quantities_name_to_exponent_) ? new libtextclassifier3::MoneyParsingOptions_::QuantitiesNameToExponentEntryT(*quantities_name_to_exponent_) : nullptr); }
6562 }
6563 
6564 inline MoneyParsingOptionsT &MoneyParsingOptionsT::operator=(MoneyParsingOptionsT o) FLATBUFFERS_NOEXCEPT {
6565   std::swap(separators, o.separators);
6566   std::swap(quantities_name_to_exponent, o.quantities_name_to_exponent);
6567   return *this;
6568 }
6569 
UnPack(const flatbuffers::resolver_function_t * _resolver)6570 inline MoneyParsingOptionsT *MoneyParsingOptions::UnPack(const flatbuffers::resolver_function_t *_resolver) const {
6571   auto _o = std::unique_ptr<MoneyParsingOptionsT>(new MoneyParsingOptionsT());
6572   UnPackTo(_o.get(), _resolver);
6573   return _o.release();
6574 }
6575 
UnPackTo(MoneyParsingOptionsT * _o,const flatbuffers::resolver_function_t * _resolver)6576 inline void MoneyParsingOptions::UnPackTo(MoneyParsingOptionsT *_o, const flatbuffers::resolver_function_t *_resolver) const {
6577   (void)_o;
6578   (void)_resolver;
6579   { auto _e = separators(); if (_e) { _o->separators.resize(_e->size()); for (flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { _o->separators[_i] = _e->Get(_i); } } }
6580   { auto _e = quantities_name_to_exponent(); if (_e) { _o->quantities_name_to_exponent.resize(_e->size()); for (flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { _o->quantities_name_to_exponent[_i] = std::unique_ptr<libtextclassifier3::MoneyParsingOptions_::QuantitiesNameToExponentEntryT>(_e->Get(_i)->UnPack(_resolver)); } } }
6581 }
6582 
Pack(flatbuffers::FlatBufferBuilder & _fbb,const MoneyParsingOptionsT * _o,const flatbuffers::rehasher_function_t * _rehasher)6583 inline flatbuffers::Offset<MoneyParsingOptions> MoneyParsingOptions::Pack(flatbuffers::FlatBufferBuilder &_fbb, const MoneyParsingOptionsT* _o, const flatbuffers::rehasher_function_t *_rehasher) {
6584   return CreateMoneyParsingOptions(_fbb, _o, _rehasher);
6585 }
6586 
CreateMoneyParsingOptions(flatbuffers::FlatBufferBuilder & _fbb,const MoneyParsingOptionsT * _o,const flatbuffers::rehasher_function_t * _rehasher)6587 inline flatbuffers::Offset<MoneyParsingOptions> CreateMoneyParsingOptions(flatbuffers::FlatBufferBuilder &_fbb, const MoneyParsingOptionsT *_o, const flatbuffers::rehasher_function_t *_rehasher) {
6588   (void)_rehasher;
6589   (void)_o;
6590   struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const MoneyParsingOptionsT* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va;
6591   auto _separators = _o->separators.size() ? _fbb.CreateVector(_o->separators) : 0;
6592   auto _quantities_name_to_exponent = _o->quantities_name_to_exponent.size() ? _fbb.CreateVector<flatbuffers::Offset<libtextclassifier3::MoneyParsingOptions_::QuantitiesNameToExponentEntry>> (_o->quantities_name_to_exponent.size(), [](size_t i, _VectorArgs *__va) { return CreateQuantitiesNameToExponentEntry(*__va->__fbb, __va->__o->quantities_name_to_exponent[i].get(), __va->__rehasher); }, &_va ) : 0;
6593   return libtextclassifier3::CreateMoneyParsingOptions(
6594       _fbb,
6595       _separators,
6596       _quantities_name_to_exponent);
6597 }
6598 
6599 namespace ModelTriggeringOptions_ {
6600 
UnPack(const flatbuffers::resolver_function_t * _resolver)6601 inline CollectionToPriorityEntryT *CollectionToPriorityEntry::UnPack(const flatbuffers::resolver_function_t *_resolver) const {
6602   auto _o = std::unique_ptr<CollectionToPriorityEntryT>(new CollectionToPriorityEntryT());
6603   UnPackTo(_o.get(), _resolver);
6604   return _o.release();
6605 }
6606 
UnPackTo(CollectionToPriorityEntryT * _o,const flatbuffers::resolver_function_t * _resolver)6607 inline void CollectionToPriorityEntry::UnPackTo(CollectionToPriorityEntryT *_o, const flatbuffers::resolver_function_t *_resolver) const {
6608   (void)_o;
6609   (void)_resolver;
6610   { auto _e = key(); if (_e) _o->key = _e->str(); }
6611   { auto _e = value(); _o->value = _e; }
6612 }
6613 
Pack(flatbuffers::FlatBufferBuilder & _fbb,const CollectionToPriorityEntryT * _o,const flatbuffers::rehasher_function_t * _rehasher)6614 inline flatbuffers::Offset<CollectionToPriorityEntry> CollectionToPriorityEntry::Pack(flatbuffers::FlatBufferBuilder &_fbb, const CollectionToPriorityEntryT* _o, const flatbuffers::rehasher_function_t *_rehasher) {
6615   return CreateCollectionToPriorityEntry(_fbb, _o, _rehasher);
6616 }
6617 
CreateCollectionToPriorityEntry(flatbuffers::FlatBufferBuilder & _fbb,const CollectionToPriorityEntryT * _o,const flatbuffers::rehasher_function_t * _rehasher)6618 inline flatbuffers::Offset<CollectionToPriorityEntry> CreateCollectionToPriorityEntry(flatbuffers::FlatBufferBuilder &_fbb, const CollectionToPriorityEntryT *_o, const flatbuffers::rehasher_function_t *_rehasher) {
6619   (void)_rehasher;
6620   (void)_o;
6621   struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const CollectionToPriorityEntryT* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va;
6622   auto _key = _fbb.CreateSharedString(_o->key);
6623   auto _value = _o->value;
6624   return libtextclassifier3::ModelTriggeringOptions_::CreateCollectionToPriorityEntry(
6625       _fbb,
6626       _key,
6627       _value);
6628 }
6629 
6630 }  // namespace ModelTriggeringOptions_
6631 
ModelTriggeringOptionsT(const ModelTriggeringOptionsT & o)6632 inline ModelTriggeringOptionsT::ModelTriggeringOptionsT(const ModelTriggeringOptionsT &o)
6633       : min_annotate_confidence(o.min_annotate_confidence),
6634         enabled_modes(o.enabled_modes),
6635         dictionary_locales(o.dictionary_locales),
6636         locales(o.locales),
6637         other_collection_priority_score(o.other_collection_priority_score),
6638         knowledge_priority_score(o.knowledge_priority_score),
6639         knowledge_enabled_modes(o.knowledge_enabled_modes),
6640         experimental_enabled_modes(o.experimental_enabled_modes),
6641         installed_app_enabled_modes(o.installed_app_enabled_modes) {
6642   collection_to_priority.reserve(o.collection_to_priority.size());
6643   for (const auto &collection_to_priority_ : o.collection_to_priority) { collection_to_priority.emplace_back((collection_to_priority_) ? new libtextclassifier3::ModelTriggeringOptions_::CollectionToPriorityEntryT(*collection_to_priority_) : nullptr); }
6644 }
6645 
6646 inline ModelTriggeringOptionsT &ModelTriggeringOptionsT::operator=(ModelTriggeringOptionsT o) FLATBUFFERS_NOEXCEPT {
6647   std::swap(min_annotate_confidence, o.min_annotate_confidence);
6648   std::swap(enabled_modes, o.enabled_modes);
6649   std::swap(dictionary_locales, o.dictionary_locales);
6650   std::swap(locales, o.locales);
6651   std::swap(other_collection_priority_score, o.other_collection_priority_score);
6652   std::swap(knowledge_priority_score, o.knowledge_priority_score);
6653   std::swap(collection_to_priority, o.collection_to_priority);
6654   std::swap(knowledge_enabled_modes, o.knowledge_enabled_modes);
6655   std::swap(experimental_enabled_modes, o.experimental_enabled_modes);
6656   std::swap(installed_app_enabled_modes, o.installed_app_enabled_modes);
6657   return *this;
6658 }
6659 
UnPack(const flatbuffers::resolver_function_t * _resolver)6660 inline ModelTriggeringOptionsT *ModelTriggeringOptions::UnPack(const flatbuffers::resolver_function_t *_resolver) const {
6661   auto _o = std::unique_ptr<ModelTriggeringOptionsT>(new ModelTriggeringOptionsT());
6662   UnPackTo(_o.get(), _resolver);
6663   return _o.release();
6664 }
6665 
UnPackTo(ModelTriggeringOptionsT * _o,const flatbuffers::resolver_function_t * _resolver)6666 inline void ModelTriggeringOptions::UnPackTo(ModelTriggeringOptionsT *_o, const flatbuffers::resolver_function_t *_resolver) const {
6667   (void)_o;
6668   (void)_resolver;
6669   { auto _e = min_annotate_confidence(); _o->min_annotate_confidence = _e; }
6670   { auto _e = enabled_modes(); _o->enabled_modes = _e; }
6671   { auto _e = dictionary_locales(); if (_e) _o->dictionary_locales = _e->str(); }
6672   { auto _e = locales(); if (_e) _o->locales = _e->str(); }
6673   { auto _e = other_collection_priority_score(); _o->other_collection_priority_score = _e; }
6674   { auto _e = knowledge_priority_score(); _o->knowledge_priority_score = _e; }
6675   { auto _e = collection_to_priority(); if (_e) { _o->collection_to_priority.resize(_e->size()); for (flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { _o->collection_to_priority[_i] = std::unique_ptr<libtextclassifier3::ModelTriggeringOptions_::CollectionToPriorityEntryT>(_e->Get(_i)->UnPack(_resolver)); } } }
6676   { auto _e = knowledge_enabled_modes(); _o->knowledge_enabled_modes = _e; }
6677   { auto _e = experimental_enabled_modes(); _o->experimental_enabled_modes = _e; }
6678   { auto _e = installed_app_enabled_modes(); _o->installed_app_enabled_modes = _e; }
6679 }
6680 
Pack(flatbuffers::FlatBufferBuilder & _fbb,const ModelTriggeringOptionsT * _o,const flatbuffers::rehasher_function_t * _rehasher)6681 inline flatbuffers::Offset<ModelTriggeringOptions> ModelTriggeringOptions::Pack(flatbuffers::FlatBufferBuilder &_fbb, const ModelTriggeringOptionsT* _o, const flatbuffers::rehasher_function_t *_rehasher) {
6682   return CreateModelTriggeringOptions(_fbb, _o, _rehasher);
6683 }
6684 
CreateModelTriggeringOptions(flatbuffers::FlatBufferBuilder & _fbb,const ModelTriggeringOptionsT * _o,const flatbuffers::rehasher_function_t * _rehasher)6685 inline flatbuffers::Offset<ModelTriggeringOptions> CreateModelTriggeringOptions(flatbuffers::FlatBufferBuilder &_fbb, const ModelTriggeringOptionsT *_o, const flatbuffers::rehasher_function_t *_rehasher) {
6686   (void)_rehasher;
6687   (void)_o;
6688   struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const ModelTriggeringOptionsT* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va;
6689   auto _min_annotate_confidence = _o->min_annotate_confidence;
6690   auto _enabled_modes = _o->enabled_modes;
6691   auto _dictionary_locales = _o->dictionary_locales.empty() ? 0 : _fbb.CreateSharedString(_o->dictionary_locales);
6692   auto _locales = _o->locales.empty() ? 0 : _fbb.CreateSharedString(_o->locales);
6693   auto _other_collection_priority_score = _o->other_collection_priority_score;
6694   auto _knowledge_priority_score = _o->knowledge_priority_score;
6695   auto _collection_to_priority = _o->collection_to_priority.size() ? _fbb.CreateVector<flatbuffers::Offset<libtextclassifier3::ModelTriggeringOptions_::CollectionToPriorityEntry>> (_o->collection_to_priority.size(), [](size_t i, _VectorArgs *__va) { return CreateCollectionToPriorityEntry(*__va->__fbb, __va->__o->collection_to_priority[i].get(), __va->__rehasher); }, &_va ) : 0;
6696   auto _knowledge_enabled_modes = _o->knowledge_enabled_modes;
6697   auto _experimental_enabled_modes = _o->experimental_enabled_modes;
6698   auto _installed_app_enabled_modes = _o->installed_app_enabled_modes;
6699   return libtextclassifier3::CreateModelTriggeringOptions(
6700       _fbb,
6701       _min_annotate_confidence,
6702       _enabled_modes,
6703       _dictionary_locales,
6704       _locales,
6705       _other_collection_priority_score,
6706       _knowledge_priority_score,
6707       _collection_to_priority,
6708       _knowledge_enabled_modes,
6709       _experimental_enabled_modes,
6710       _installed_app_enabled_modes);
6711 }
6712 
UnPack(const flatbuffers::resolver_function_t * _resolver)6713 inline OutputOptionsT *OutputOptions::UnPack(const flatbuffers::resolver_function_t *_resolver) const {
6714   auto _o = std::unique_ptr<OutputOptionsT>(new OutputOptionsT());
6715   UnPackTo(_o.get(), _resolver);
6716   return _o.release();
6717 }
6718 
UnPackTo(OutputOptionsT * _o,const flatbuffers::resolver_function_t * _resolver)6719 inline void OutputOptions::UnPackTo(OutputOptionsT *_o, const flatbuffers::resolver_function_t *_resolver) const {
6720   (void)_o;
6721   (void)_resolver;
6722   { auto _e = filtered_collections_annotation(); if (_e) { _o->filtered_collections_annotation.resize(_e->size()); for (flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { _o->filtered_collections_annotation[_i] = _e->Get(_i)->str(); } } }
6723   { auto _e = filtered_collections_classification(); if (_e) { _o->filtered_collections_classification.resize(_e->size()); for (flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { _o->filtered_collections_classification[_i] = _e->Get(_i)->str(); } } }
6724   { auto _e = filtered_collections_selection(); if (_e) { _o->filtered_collections_selection.resize(_e->size()); for (flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { _o->filtered_collections_selection[_i] = _e->Get(_i)->str(); } } }
6725 }
6726 
Pack(flatbuffers::FlatBufferBuilder & _fbb,const OutputOptionsT * _o,const flatbuffers::rehasher_function_t * _rehasher)6727 inline flatbuffers::Offset<OutputOptions> OutputOptions::Pack(flatbuffers::FlatBufferBuilder &_fbb, const OutputOptionsT* _o, const flatbuffers::rehasher_function_t *_rehasher) {
6728   return CreateOutputOptions(_fbb, _o, _rehasher);
6729 }
6730 
CreateOutputOptions(flatbuffers::FlatBufferBuilder & _fbb,const OutputOptionsT * _o,const flatbuffers::rehasher_function_t * _rehasher)6731 inline flatbuffers::Offset<OutputOptions> CreateOutputOptions(flatbuffers::FlatBufferBuilder &_fbb, const OutputOptionsT *_o, const flatbuffers::rehasher_function_t *_rehasher) {
6732   (void)_rehasher;
6733   (void)_o;
6734   struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const OutputOptionsT* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va;
6735   auto _filtered_collections_annotation = _o->filtered_collections_annotation.size() ? _fbb.CreateVectorOfStrings(_o->filtered_collections_annotation) : 0;
6736   auto _filtered_collections_classification = _o->filtered_collections_classification.size() ? _fbb.CreateVectorOfStrings(_o->filtered_collections_classification) : 0;
6737   auto _filtered_collections_selection = _o->filtered_collections_selection.size() ? _fbb.CreateVectorOfStrings(_o->filtered_collections_selection) : 0;
6738   return libtextclassifier3::CreateOutputOptions(
6739       _fbb,
6740       _filtered_collections_annotation,
6741       _filtered_collections_classification,
6742       _filtered_collections_selection);
6743 }
6744 
6745 namespace Model_ {
6746 
UnPack(const flatbuffers::resolver_function_t * _resolver)6747 inline EmbeddingPruningMaskT *EmbeddingPruningMask::UnPack(const flatbuffers::resolver_function_t *_resolver) const {
6748   auto _o = std::unique_ptr<EmbeddingPruningMaskT>(new EmbeddingPruningMaskT());
6749   UnPackTo(_o.get(), _resolver);
6750   return _o.release();
6751 }
6752 
UnPackTo(EmbeddingPruningMaskT * _o,const flatbuffers::resolver_function_t * _resolver)6753 inline void EmbeddingPruningMask::UnPackTo(EmbeddingPruningMaskT *_o, const flatbuffers::resolver_function_t *_resolver) const {
6754   (void)_o;
6755   (void)_resolver;
6756   { auto _e = enabled(); _o->enabled = _e; }
6757   { auto _e = pruning_mask(); if (_e) { _o->pruning_mask.resize(_e->size()); for (flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { _o->pruning_mask[_i] = _e->Get(_i); } } }
6758   { auto _e = full_num_buckets(); _o->full_num_buckets = _e; }
6759   { auto _e = pruned_row_bucket_id(); _o->pruned_row_bucket_id = _e; }
6760 }
6761 
Pack(flatbuffers::FlatBufferBuilder & _fbb,const EmbeddingPruningMaskT * _o,const flatbuffers::rehasher_function_t * _rehasher)6762 inline flatbuffers::Offset<EmbeddingPruningMask> EmbeddingPruningMask::Pack(flatbuffers::FlatBufferBuilder &_fbb, const EmbeddingPruningMaskT* _o, const flatbuffers::rehasher_function_t *_rehasher) {
6763   return CreateEmbeddingPruningMask(_fbb, _o, _rehasher);
6764 }
6765 
CreateEmbeddingPruningMask(flatbuffers::FlatBufferBuilder & _fbb,const EmbeddingPruningMaskT * _o,const flatbuffers::rehasher_function_t * _rehasher)6766 inline flatbuffers::Offset<EmbeddingPruningMask> CreateEmbeddingPruningMask(flatbuffers::FlatBufferBuilder &_fbb, const EmbeddingPruningMaskT *_o, const flatbuffers::rehasher_function_t *_rehasher) {
6767   (void)_rehasher;
6768   (void)_o;
6769   struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const EmbeddingPruningMaskT* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va;
6770   auto _enabled = _o->enabled;
6771   _fbb.ForceVectorAlignment(_o->pruning_mask.size(), sizeof(uint64_t), 16);
6772   auto _pruning_mask = _o->pruning_mask.size() ? _fbb.CreateVector(_o->pruning_mask) : 0;
6773   auto _full_num_buckets = _o->full_num_buckets;
6774   auto _pruned_row_bucket_id = _o->pruned_row_bucket_id;
6775   return libtextclassifier3::Model_::CreateEmbeddingPruningMask(
6776       _fbb,
6777       _enabled,
6778       _pruning_mask,
6779       _full_num_buckets,
6780       _pruned_row_bucket_id);
6781 }
6782 
UnPack(const flatbuffers::resolver_function_t * _resolver)6783 inline ConflictResolutionOptionsT *ConflictResolutionOptions::UnPack(const flatbuffers::resolver_function_t *_resolver) const {
6784   auto _o = std::unique_ptr<ConflictResolutionOptionsT>(new ConflictResolutionOptionsT());
6785   UnPackTo(_o.get(), _resolver);
6786   return _o.release();
6787 }
6788 
UnPackTo(ConflictResolutionOptionsT * _o,const flatbuffers::resolver_function_t * _resolver)6789 inline void ConflictResolutionOptions::UnPackTo(ConflictResolutionOptionsT *_o, const flatbuffers::resolver_function_t *_resolver) const {
6790   (void)_o;
6791   (void)_resolver;
6792   { auto _e = prioritize_longest_annotation(); _o->prioritize_longest_annotation = _e; }
6793   { auto _e = do_conflict_resolution_in_raw_mode(); _o->do_conflict_resolution_in_raw_mode = _e; }
6794 }
6795 
Pack(flatbuffers::FlatBufferBuilder & _fbb,const ConflictResolutionOptionsT * _o,const flatbuffers::rehasher_function_t * _rehasher)6796 inline flatbuffers::Offset<ConflictResolutionOptions> ConflictResolutionOptions::Pack(flatbuffers::FlatBufferBuilder &_fbb, const ConflictResolutionOptionsT* _o, const flatbuffers::rehasher_function_t *_rehasher) {
6797   return CreateConflictResolutionOptions(_fbb, _o, _rehasher);
6798 }
6799 
CreateConflictResolutionOptions(flatbuffers::FlatBufferBuilder & _fbb,const ConflictResolutionOptionsT * _o,const flatbuffers::rehasher_function_t * _rehasher)6800 inline flatbuffers::Offset<ConflictResolutionOptions> CreateConflictResolutionOptions(flatbuffers::FlatBufferBuilder &_fbb, const ConflictResolutionOptionsT *_o, const flatbuffers::rehasher_function_t *_rehasher) {
6801   (void)_rehasher;
6802   (void)_o;
6803   struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const ConflictResolutionOptionsT* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va;
6804   auto _prioritize_longest_annotation = _o->prioritize_longest_annotation;
6805   auto _do_conflict_resolution_in_raw_mode = _o->do_conflict_resolution_in_raw_mode;
6806   return libtextclassifier3::Model_::CreateConflictResolutionOptions(
6807       _fbb,
6808       _prioritize_longest_annotation,
6809       _do_conflict_resolution_in_raw_mode);
6810 }
6811 
6812 }  // namespace Model_
6813 
ModelT(const ModelT & o)6814 inline ModelT::ModelT(const ModelT &o)
6815       : locales(o.locales),
6816         version(o.version),
6817         name(o.name),
6818         selection_feature_options((o.selection_feature_options) ? new libtextclassifier3::FeatureProcessorOptionsT(*o.selection_feature_options) : nullptr),
6819         classification_feature_options((o.classification_feature_options) ? new libtextclassifier3::FeatureProcessorOptionsT(*o.classification_feature_options) : nullptr),
6820         selection_model(o.selection_model),
6821         classification_model(o.classification_model),
6822         embedding_model(o.embedding_model),
6823         selection_options((o.selection_options) ? new libtextclassifier3::SelectionModelOptionsT(*o.selection_options) : nullptr),
6824         classification_options((o.classification_options) ? new libtextclassifier3::ClassificationModelOptionsT(*o.classification_options) : nullptr),
6825         regex_model((o.regex_model) ? new libtextclassifier3::RegexModelT(*o.regex_model) : nullptr),
6826         datetime_model((o.datetime_model) ? new libtextclassifier3::DatetimeModelT(*o.datetime_model) : nullptr),
6827         triggering_options((o.triggering_options) ? new libtextclassifier3::ModelTriggeringOptionsT(*o.triggering_options) : nullptr),
6828         enabled_modes(o.enabled_modes),
6829         snap_whitespace_selections(o.snap_whitespace_selections),
6830         output_options((o.output_options) ? new libtextclassifier3::OutputOptionsT(*o.output_options) : nullptr),
6831         android_intent_options((o.android_intent_options) ? new libtextclassifier3::AndroidIntentFactoryOptionsT(*o.android_intent_options) : nullptr),
6832         intent_options((o.intent_options) ? new libtextclassifier3::IntentFactoryModelT(*o.intent_options) : nullptr),
6833         resources((o.resources) ? new libtextclassifier3::ResourcePoolT(*o.resources) : nullptr),
6834         entity_data_schema(o.entity_data_schema),
6835         number_annotator_options((o.number_annotator_options) ? new libtextclassifier3::NumberAnnotatorOptionsT(*o.number_annotator_options) : nullptr),
6836         duration_annotator_options((o.duration_annotator_options) ? new libtextclassifier3::DurationAnnotatorOptionsT(*o.duration_annotator_options) : nullptr),
6837         triggering_locales(o.triggering_locales),
6838         embedding_pruning_mask((o.embedding_pruning_mask) ? new libtextclassifier3::Model_::EmbeddingPruningMaskT(*o.embedding_pruning_mask) : nullptr),
6839         contact_annotator_options((o.contact_annotator_options) ? new libtextclassifier3::ContactAnnotatorOptionsT(*o.contact_annotator_options) : nullptr),
6840         money_parsing_options((o.money_parsing_options) ? new libtextclassifier3::MoneyParsingOptionsT(*o.money_parsing_options) : nullptr),
6841         translate_annotator_options((o.translate_annotator_options) ? new libtextclassifier3::TranslateAnnotatorOptionsT(*o.translate_annotator_options) : nullptr),
6842         grammar_model((o.grammar_model) ? new libtextclassifier3::GrammarModelT(*o.grammar_model) : nullptr),
6843         conflict_resolution_options((o.conflict_resolution_options) ? new libtextclassifier3::Model_::ConflictResolutionOptionsT(*o.conflict_resolution_options) : nullptr),
6844         experimental_model((o.experimental_model) ? new libtextclassifier3::ExperimentalModelT(*o.experimental_model) : nullptr),
6845         pod_ner_model((o.pod_ner_model) ? new libtextclassifier3::PodNerModelT(*o.pod_ner_model) : nullptr),
6846         vocab_model((o.vocab_model) ? new libtextclassifier3::VocabModelT(*o.vocab_model) : nullptr),
6847         datetime_grammar_model((o.datetime_grammar_model) ? new libtextclassifier3::GrammarModelT(*o.datetime_grammar_model) : nullptr) {
6848 }
6849 
6850 inline ModelT &ModelT::operator=(ModelT o) FLATBUFFERS_NOEXCEPT {
6851   std::swap(locales, o.locales);
6852   std::swap(version, o.version);
6853   std::swap(name, o.name);
6854   std::swap(selection_feature_options, o.selection_feature_options);
6855   std::swap(classification_feature_options, o.classification_feature_options);
6856   std::swap(selection_model, o.selection_model);
6857   std::swap(classification_model, o.classification_model);
6858   std::swap(embedding_model, o.embedding_model);
6859   std::swap(selection_options, o.selection_options);
6860   std::swap(classification_options, o.classification_options);
6861   std::swap(regex_model, o.regex_model);
6862   std::swap(datetime_model, o.datetime_model);
6863   std::swap(triggering_options, o.triggering_options);
6864   std::swap(enabled_modes, o.enabled_modes);
6865   std::swap(snap_whitespace_selections, o.snap_whitespace_selections);
6866   std::swap(output_options, o.output_options);
6867   std::swap(android_intent_options, o.android_intent_options);
6868   std::swap(intent_options, o.intent_options);
6869   std::swap(resources, o.resources);
6870   std::swap(entity_data_schema, o.entity_data_schema);
6871   std::swap(number_annotator_options, o.number_annotator_options);
6872   std::swap(duration_annotator_options, o.duration_annotator_options);
6873   std::swap(triggering_locales, o.triggering_locales);
6874   std::swap(embedding_pruning_mask, o.embedding_pruning_mask);
6875   std::swap(contact_annotator_options, o.contact_annotator_options);
6876   std::swap(money_parsing_options, o.money_parsing_options);
6877   std::swap(translate_annotator_options, o.translate_annotator_options);
6878   std::swap(grammar_model, o.grammar_model);
6879   std::swap(conflict_resolution_options, o.conflict_resolution_options);
6880   std::swap(experimental_model, o.experimental_model);
6881   std::swap(pod_ner_model, o.pod_ner_model);
6882   std::swap(vocab_model, o.vocab_model);
6883   std::swap(datetime_grammar_model, o.datetime_grammar_model);
6884   return *this;
6885 }
6886 
UnPack(const flatbuffers::resolver_function_t * _resolver)6887 inline ModelT *Model::UnPack(const flatbuffers::resolver_function_t *_resolver) const {
6888   auto _o = std::unique_ptr<ModelT>(new ModelT());
6889   UnPackTo(_o.get(), _resolver);
6890   return _o.release();
6891 }
6892 
UnPackTo(ModelT * _o,const flatbuffers::resolver_function_t * _resolver)6893 inline void Model::UnPackTo(ModelT *_o, const flatbuffers::resolver_function_t *_resolver) const {
6894   (void)_o;
6895   (void)_resolver;
6896   { auto _e = locales(); if (_e) _o->locales = _e->str(); }
6897   { auto _e = version(); _o->version = _e; }
6898   { auto _e = name(); if (_e) _o->name = _e->str(); }
6899   { auto _e = selection_feature_options(); if (_e) _o->selection_feature_options = std::unique_ptr<libtextclassifier3::FeatureProcessorOptionsT>(_e->UnPack(_resolver)); }
6900   { auto _e = classification_feature_options(); if (_e) _o->classification_feature_options = std::unique_ptr<libtextclassifier3::FeatureProcessorOptionsT>(_e->UnPack(_resolver)); }
6901   { auto _e = selection_model(); if (_e) { _o->selection_model.resize(_e->size()); std::copy(_e->begin(), _e->end(), _o->selection_model.begin()); } }
6902   { auto _e = classification_model(); if (_e) { _o->classification_model.resize(_e->size()); std::copy(_e->begin(), _e->end(), _o->classification_model.begin()); } }
6903   { auto _e = embedding_model(); if (_e) { _o->embedding_model.resize(_e->size()); std::copy(_e->begin(), _e->end(), _o->embedding_model.begin()); } }
6904   { auto _e = selection_options(); if (_e) _o->selection_options = std::unique_ptr<libtextclassifier3::SelectionModelOptionsT>(_e->UnPack(_resolver)); }
6905   { auto _e = classification_options(); if (_e) _o->classification_options = std::unique_ptr<libtextclassifier3::ClassificationModelOptionsT>(_e->UnPack(_resolver)); }
6906   { auto _e = regex_model(); if (_e) _o->regex_model = std::unique_ptr<libtextclassifier3::RegexModelT>(_e->UnPack(_resolver)); }
6907   { auto _e = datetime_model(); if (_e) _o->datetime_model = std::unique_ptr<libtextclassifier3::DatetimeModelT>(_e->UnPack(_resolver)); }
6908   { auto _e = triggering_options(); if (_e) _o->triggering_options = std::unique_ptr<libtextclassifier3::ModelTriggeringOptionsT>(_e->UnPack(_resolver)); }
6909   { auto _e = enabled_modes(); _o->enabled_modes = _e; }
6910   { auto _e = snap_whitespace_selections(); _o->snap_whitespace_selections = _e; }
6911   { auto _e = output_options(); if (_e) _o->output_options = std::unique_ptr<libtextclassifier3::OutputOptionsT>(_e->UnPack(_resolver)); }
6912   { auto _e = android_intent_options(); if (_e) _o->android_intent_options = std::unique_ptr<libtextclassifier3::AndroidIntentFactoryOptionsT>(_e->UnPack(_resolver)); }
6913   { auto _e = intent_options(); if (_e) _o->intent_options = std::unique_ptr<libtextclassifier3::IntentFactoryModelT>(_e->UnPack(_resolver)); }
6914   { auto _e = resources(); if (_e) _o->resources = std::unique_ptr<libtextclassifier3::ResourcePoolT>(_e->UnPack(_resolver)); }
6915   { auto _e = entity_data_schema(); if (_e) { _o->entity_data_schema.resize(_e->size()); std::copy(_e->begin(), _e->end(), _o->entity_data_schema.begin()); } }
6916   { auto _e = number_annotator_options(); if (_e) _o->number_annotator_options = std::unique_ptr<libtextclassifier3::NumberAnnotatorOptionsT>(_e->UnPack(_resolver)); }
6917   { auto _e = duration_annotator_options(); if (_e) _o->duration_annotator_options = std::unique_ptr<libtextclassifier3::DurationAnnotatorOptionsT>(_e->UnPack(_resolver)); }
6918   { auto _e = triggering_locales(); if (_e) _o->triggering_locales = _e->str(); }
6919   { auto _e = embedding_pruning_mask(); if (_e) _o->embedding_pruning_mask = std::unique_ptr<libtextclassifier3::Model_::EmbeddingPruningMaskT>(_e->UnPack(_resolver)); }
6920   { auto _e = contact_annotator_options(); if (_e) _o->contact_annotator_options = std::unique_ptr<libtextclassifier3::ContactAnnotatorOptionsT>(_e->UnPack(_resolver)); }
6921   { auto _e = money_parsing_options(); if (_e) _o->money_parsing_options = std::unique_ptr<libtextclassifier3::MoneyParsingOptionsT>(_e->UnPack(_resolver)); }
6922   { auto _e = translate_annotator_options(); if (_e) _o->translate_annotator_options = std::unique_ptr<libtextclassifier3::TranslateAnnotatorOptionsT>(_e->UnPack(_resolver)); }
6923   { auto _e = grammar_model(); if (_e) _o->grammar_model = std::unique_ptr<libtextclassifier3::GrammarModelT>(_e->UnPack(_resolver)); }
6924   { auto _e = conflict_resolution_options(); if (_e) _o->conflict_resolution_options = std::unique_ptr<libtextclassifier3::Model_::ConflictResolutionOptionsT>(_e->UnPack(_resolver)); }
6925   { auto _e = experimental_model(); if (_e) _o->experimental_model = std::unique_ptr<libtextclassifier3::ExperimentalModelT>(_e->UnPack(_resolver)); }
6926   { auto _e = pod_ner_model(); if (_e) _o->pod_ner_model = std::unique_ptr<libtextclassifier3::PodNerModelT>(_e->UnPack(_resolver)); }
6927   { auto _e = vocab_model(); if (_e) _o->vocab_model = std::unique_ptr<libtextclassifier3::VocabModelT>(_e->UnPack(_resolver)); }
6928   { auto _e = datetime_grammar_model(); if (_e) _o->datetime_grammar_model = std::unique_ptr<libtextclassifier3::GrammarModelT>(_e->UnPack(_resolver)); }
6929 }
6930 
Pack(flatbuffers::FlatBufferBuilder & _fbb,const ModelT * _o,const flatbuffers::rehasher_function_t * _rehasher)6931 inline flatbuffers::Offset<Model> Model::Pack(flatbuffers::FlatBufferBuilder &_fbb, const ModelT* _o, const flatbuffers::rehasher_function_t *_rehasher) {
6932   return CreateModel(_fbb, _o, _rehasher);
6933 }
6934 
CreateModel(flatbuffers::FlatBufferBuilder & _fbb,const ModelT * _o,const flatbuffers::rehasher_function_t * _rehasher)6935 inline flatbuffers::Offset<Model> CreateModel(flatbuffers::FlatBufferBuilder &_fbb, const ModelT *_o, const flatbuffers::rehasher_function_t *_rehasher) {
6936   (void)_rehasher;
6937   (void)_o;
6938   struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const ModelT* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va;
6939   auto _locales = _o->locales.empty() ? 0 : _fbb.CreateSharedString(_o->locales);
6940   auto _version = _o->version;
6941   auto _name = _o->name.empty() ? 0 : _fbb.CreateSharedString(_o->name);
6942   auto _selection_feature_options = _o->selection_feature_options ? CreateFeatureProcessorOptions(_fbb, _o->selection_feature_options.get(), _rehasher) : 0;
6943   auto _classification_feature_options = _o->classification_feature_options ? CreateFeatureProcessorOptions(_fbb, _o->classification_feature_options.get(), _rehasher) : 0;
6944   _fbb.ForceVectorAlignment(_o->selection_model.size(), sizeof(uint8_t), 16);
6945   auto _selection_model = _o->selection_model.size() ? _fbb.CreateVector(_o->selection_model) : 0;
6946   _fbb.ForceVectorAlignment(_o->classification_model.size(), sizeof(uint8_t), 16);
6947   auto _classification_model = _o->classification_model.size() ? _fbb.CreateVector(_o->classification_model) : 0;
6948   _fbb.ForceVectorAlignment(_o->embedding_model.size(), sizeof(uint8_t), 16);
6949   auto _embedding_model = _o->embedding_model.size() ? _fbb.CreateVector(_o->embedding_model) : 0;
6950   auto _selection_options = _o->selection_options ? CreateSelectionModelOptions(_fbb, _o->selection_options.get(), _rehasher) : 0;
6951   auto _classification_options = _o->classification_options ? CreateClassificationModelOptions(_fbb, _o->classification_options.get(), _rehasher) : 0;
6952   auto _regex_model = _o->regex_model ? CreateRegexModel(_fbb, _o->regex_model.get(), _rehasher) : 0;
6953   auto _datetime_model = _o->datetime_model ? CreateDatetimeModel(_fbb, _o->datetime_model.get(), _rehasher) : 0;
6954   auto _triggering_options = _o->triggering_options ? CreateModelTriggeringOptions(_fbb, _o->triggering_options.get(), _rehasher) : 0;
6955   auto _enabled_modes = _o->enabled_modes;
6956   auto _snap_whitespace_selections = _o->snap_whitespace_selections;
6957   auto _output_options = _o->output_options ? CreateOutputOptions(_fbb, _o->output_options.get(), _rehasher) : 0;
6958   auto _android_intent_options = _o->android_intent_options ? CreateAndroidIntentFactoryOptions(_fbb, _o->android_intent_options.get(), _rehasher) : 0;
6959   auto _intent_options = _o->intent_options ? CreateIntentFactoryModel(_fbb, _o->intent_options.get(), _rehasher) : 0;
6960   auto _resources = _o->resources ? CreateResourcePool(_fbb, _o->resources.get(), _rehasher) : 0;
6961   auto _entity_data_schema = _o->entity_data_schema.size() ? _fbb.CreateVector(_o->entity_data_schema) : 0;
6962   auto _number_annotator_options = _o->number_annotator_options ? CreateNumberAnnotatorOptions(_fbb, _o->number_annotator_options.get(), _rehasher) : 0;
6963   auto _duration_annotator_options = _o->duration_annotator_options ? CreateDurationAnnotatorOptions(_fbb, _o->duration_annotator_options.get(), _rehasher) : 0;
6964   auto _triggering_locales = _o->triggering_locales.empty() ? 0 : _fbb.CreateSharedString(_o->triggering_locales);
6965   auto _embedding_pruning_mask = _o->embedding_pruning_mask ? CreateEmbeddingPruningMask(_fbb, _o->embedding_pruning_mask.get(), _rehasher) : 0;
6966   auto _contact_annotator_options = _o->contact_annotator_options ? CreateContactAnnotatorOptions(_fbb, _o->contact_annotator_options.get(), _rehasher) : 0;
6967   auto _money_parsing_options = _o->money_parsing_options ? CreateMoneyParsingOptions(_fbb, _o->money_parsing_options.get(), _rehasher) : 0;
6968   auto _translate_annotator_options = _o->translate_annotator_options ? CreateTranslateAnnotatorOptions(_fbb, _o->translate_annotator_options.get(), _rehasher) : 0;
6969   auto _grammar_model = _o->grammar_model ? CreateGrammarModel(_fbb, _o->grammar_model.get(), _rehasher) : 0;
6970   auto _conflict_resolution_options = _o->conflict_resolution_options ? CreateConflictResolutionOptions(_fbb, _o->conflict_resolution_options.get(), _rehasher) : 0;
6971   auto _experimental_model = _o->experimental_model ? CreateExperimentalModel(_fbb, _o->experimental_model.get(), _rehasher) : 0;
6972   auto _pod_ner_model = _o->pod_ner_model ? CreatePodNerModel(_fbb, _o->pod_ner_model.get(), _rehasher) : 0;
6973   auto _vocab_model = _o->vocab_model ? CreateVocabModel(_fbb, _o->vocab_model.get(), _rehasher) : 0;
6974   auto _datetime_grammar_model = _o->datetime_grammar_model ? CreateGrammarModel(_fbb, _o->datetime_grammar_model.get(), _rehasher) : 0;
6975   return libtextclassifier3::CreateModel(
6976       _fbb,
6977       _locales,
6978       _version,
6979       _name,
6980       _selection_feature_options,
6981       _classification_feature_options,
6982       _selection_model,
6983       _classification_model,
6984       _embedding_model,
6985       _selection_options,
6986       _classification_options,
6987       _regex_model,
6988       _datetime_model,
6989       _triggering_options,
6990       _enabled_modes,
6991       _snap_whitespace_selections,
6992       _output_options,
6993       _android_intent_options,
6994       _intent_options,
6995       _resources,
6996       _entity_data_schema,
6997       _number_annotator_options,
6998       _duration_annotator_options,
6999       _triggering_locales,
7000       _embedding_pruning_mask,
7001       _contact_annotator_options,
7002       _money_parsing_options,
7003       _translate_annotator_options,
7004       _grammar_model,
7005       _conflict_resolution_options,
7006       _experimental_model,
7007       _pod_ner_model,
7008       _vocab_model,
7009       _datetime_grammar_model);
7010 }
7011 
7012 namespace FeatureProcessorOptions_ {
7013 
UnPack(const flatbuffers::resolver_function_t * _resolver)7014 inline BoundsSensitiveFeaturesT *BoundsSensitiveFeatures::UnPack(const flatbuffers::resolver_function_t *_resolver) const {
7015   auto _o = std::unique_ptr<BoundsSensitiveFeaturesT>(new BoundsSensitiveFeaturesT());
7016   UnPackTo(_o.get(), _resolver);
7017   return _o.release();
7018 }
7019 
UnPackTo(BoundsSensitiveFeaturesT * _o,const flatbuffers::resolver_function_t * _resolver)7020 inline void BoundsSensitiveFeatures::UnPackTo(BoundsSensitiveFeaturesT *_o, const flatbuffers::resolver_function_t *_resolver) const {
7021   (void)_o;
7022   (void)_resolver;
7023   { auto _e = enabled(); _o->enabled = _e; }
7024   { auto _e = num_tokens_before(); _o->num_tokens_before = _e; }
7025   { auto _e = num_tokens_inside_left(); _o->num_tokens_inside_left = _e; }
7026   { auto _e = num_tokens_inside_right(); _o->num_tokens_inside_right = _e; }
7027   { auto _e = num_tokens_after(); _o->num_tokens_after = _e; }
7028   { auto _e = include_inside_bag(); _o->include_inside_bag = _e; }
7029   { auto _e = include_inside_length(); _o->include_inside_length = _e; }
7030   { auto _e = score_single_token_spans_as_zero(); _o->score_single_token_spans_as_zero = _e; }
7031 }
7032 
Pack(flatbuffers::FlatBufferBuilder & _fbb,const BoundsSensitiveFeaturesT * _o,const flatbuffers::rehasher_function_t * _rehasher)7033 inline flatbuffers::Offset<BoundsSensitiveFeatures> BoundsSensitiveFeatures::Pack(flatbuffers::FlatBufferBuilder &_fbb, const BoundsSensitiveFeaturesT* _o, const flatbuffers::rehasher_function_t *_rehasher) {
7034   return CreateBoundsSensitiveFeatures(_fbb, _o, _rehasher);
7035 }
7036 
CreateBoundsSensitiveFeatures(flatbuffers::FlatBufferBuilder & _fbb,const BoundsSensitiveFeaturesT * _o,const flatbuffers::rehasher_function_t * _rehasher)7037 inline flatbuffers::Offset<BoundsSensitiveFeatures> CreateBoundsSensitiveFeatures(flatbuffers::FlatBufferBuilder &_fbb, const BoundsSensitiveFeaturesT *_o, const flatbuffers::rehasher_function_t *_rehasher) {
7038   (void)_rehasher;
7039   (void)_o;
7040   struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const BoundsSensitiveFeaturesT* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va;
7041   auto _enabled = _o->enabled;
7042   auto _num_tokens_before = _o->num_tokens_before;
7043   auto _num_tokens_inside_left = _o->num_tokens_inside_left;
7044   auto _num_tokens_inside_right = _o->num_tokens_inside_right;
7045   auto _num_tokens_after = _o->num_tokens_after;
7046   auto _include_inside_bag = _o->include_inside_bag;
7047   auto _include_inside_length = _o->include_inside_length;
7048   auto _score_single_token_spans_as_zero = _o->score_single_token_spans_as_zero;
7049   return libtextclassifier3::FeatureProcessorOptions_::CreateBoundsSensitiveFeatures(
7050       _fbb,
7051       _enabled,
7052       _num_tokens_before,
7053       _num_tokens_inside_left,
7054       _num_tokens_inside_right,
7055       _num_tokens_after,
7056       _include_inside_bag,
7057       _include_inside_length,
7058       _score_single_token_spans_as_zero);
7059 }
7060 
7061 }  // namespace FeatureProcessorOptions_
7062 
FeatureProcessorOptionsT(const FeatureProcessorOptionsT & o)7063 inline FeatureProcessorOptionsT::FeatureProcessorOptionsT(const FeatureProcessorOptionsT &o)
7064       : num_buckets(o.num_buckets),
7065         embedding_size(o.embedding_size),
7066         embedding_quantization_bits(o.embedding_quantization_bits),
7067         context_size(o.context_size),
7068         max_selection_span(o.max_selection_span),
7069         chargram_orders(o.chargram_orders),
7070         max_word_length(o.max_word_length),
7071         unicode_aware_features(o.unicode_aware_features),
7072         extract_case_feature(o.extract_case_feature),
7073         extract_selection_mask_feature(o.extract_selection_mask_feature),
7074         regexp_feature(o.regexp_feature),
7075         remap_digits(o.remap_digits),
7076         lowercase_tokens(o.lowercase_tokens),
7077         selection_reduced_output_space(o.selection_reduced_output_space),
7078         collections(o.collections),
7079         default_collection(o.default_collection),
7080         only_use_line_with_click(o.only_use_line_with_click),
7081         split_tokens_on_selection_boundaries(o.split_tokens_on_selection_boundaries),
7082         center_token_selection_method(o.center_token_selection_method),
7083         snap_label_span_boundaries_to_containing_tokens(o.snap_label_span_boundaries_to_containing_tokens),
7084         min_supported_codepoint_ratio(o.min_supported_codepoint_ratio),
7085         feature_version(o.feature_version),
7086         tokenization_type(o.tokenization_type),
7087         icu_preserve_whitespace_tokens(o.icu_preserve_whitespace_tokens),
7088         ignored_span_boundary_codepoints(o.ignored_span_boundary_codepoints),
7089         bounds_sensitive_features((o.bounds_sensitive_features) ? new libtextclassifier3::FeatureProcessorOptions_::BoundsSensitiveFeaturesT(*o.bounds_sensitive_features) : nullptr),
7090         allowed_chargrams(o.allowed_chargrams),
7091         tokenize_on_script_change(o.tokenize_on_script_change),
7092         use_pipe_character_for_newline(o.use_pipe_character_for_newline) {
7093   tokenization_codepoint_config.reserve(o.tokenization_codepoint_config.size());
7094   for (const auto &tokenization_codepoint_config_ : o.tokenization_codepoint_config) { tokenization_codepoint_config.emplace_back((tokenization_codepoint_config_) ? new libtextclassifier3::TokenizationCodepointRangeT(*tokenization_codepoint_config_) : nullptr); }
7095   supported_codepoint_ranges.reserve(o.supported_codepoint_ranges.size());
7096   for (const auto &supported_codepoint_ranges_ : o.supported_codepoint_ranges) { supported_codepoint_ranges.emplace_back((supported_codepoint_ranges_) ? new libtextclassifier3::CodepointRangeT(*supported_codepoint_ranges_) : nullptr); }
7097   internal_tokenizer_codepoint_ranges.reserve(o.internal_tokenizer_codepoint_ranges.size());
7098   for (const auto &internal_tokenizer_codepoint_ranges_ : o.internal_tokenizer_codepoint_ranges) { internal_tokenizer_codepoint_ranges.emplace_back((internal_tokenizer_codepoint_ranges_) ? new libtextclassifier3::CodepointRangeT(*internal_tokenizer_codepoint_ranges_) : nullptr); }
7099 }
7100 
7101 inline FeatureProcessorOptionsT &FeatureProcessorOptionsT::operator=(FeatureProcessorOptionsT o) FLATBUFFERS_NOEXCEPT {
7102   std::swap(num_buckets, o.num_buckets);
7103   std::swap(embedding_size, o.embedding_size);
7104   std::swap(embedding_quantization_bits, o.embedding_quantization_bits);
7105   std::swap(context_size, o.context_size);
7106   std::swap(max_selection_span, o.max_selection_span);
7107   std::swap(chargram_orders, o.chargram_orders);
7108   std::swap(max_word_length, o.max_word_length);
7109   std::swap(unicode_aware_features, o.unicode_aware_features);
7110   std::swap(extract_case_feature, o.extract_case_feature);
7111   std::swap(extract_selection_mask_feature, o.extract_selection_mask_feature);
7112   std::swap(regexp_feature, o.regexp_feature);
7113   std::swap(remap_digits, o.remap_digits);
7114   std::swap(lowercase_tokens, o.lowercase_tokens);
7115   std::swap(selection_reduced_output_space, o.selection_reduced_output_space);
7116   std::swap(collections, o.collections);
7117   std::swap(default_collection, o.default_collection);
7118   std::swap(only_use_line_with_click, o.only_use_line_with_click);
7119   std::swap(split_tokens_on_selection_boundaries, o.split_tokens_on_selection_boundaries);
7120   std::swap(tokenization_codepoint_config, o.tokenization_codepoint_config);
7121   std::swap(center_token_selection_method, o.center_token_selection_method);
7122   std::swap(snap_label_span_boundaries_to_containing_tokens, o.snap_label_span_boundaries_to_containing_tokens);
7123   std::swap(supported_codepoint_ranges, o.supported_codepoint_ranges);
7124   std::swap(internal_tokenizer_codepoint_ranges, o.internal_tokenizer_codepoint_ranges);
7125   std::swap(min_supported_codepoint_ratio, o.min_supported_codepoint_ratio);
7126   std::swap(feature_version, o.feature_version);
7127   std::swap(tokenization_type, o.tokenization_type);
7128   std::swap(icu_preserve_whitespace_tokens, o.icu_preserve_whitespace_tokens);
7129   std::swap(ignored_span_boundary_codepoints, o.ignored_span_boundary_codepoints);
7130   std::swap(bounds_sensitive_features, o.bounds_sensitive_features);
7131   std::swap(allowed_chargrams, o.allowed_chargrams);
7132   std::swap(tokenize_on_script_change, o.tokenize_on_script_change);
7133   std::swap(use_pipe_character_for_newline, o.use_pipe_character_for_newline);
7134   return *this;
7135 }
7136 
UnPack(const flatbuffers::resolver_function_t * _resolver)7137 inline FeatureProcessorOptionsT *FeatureProcessorOptions::UnPack(const flatbuffers::resolver_function_t *_resolver) const {
7138   auto _o = std::unique_ptr<FeatureProcessorOptionsT>(new FeatureProcessorOptionsT());
7139   UnPackTo(_o.get(), _resolver);
7140   return _o.release();
7141 }
7142 
UnPackTo(FeatureProcessorOptionsT * _o,const flatbuffers::resolver_function_t * _resolver)7143 inline void FeatureProcessorOptions::UnPackTo(FeatureProcessorOptionsT *_o, const flatbuffers::resolver_function_t *_resolver) const {
7144   (void)_o;
7145   (void)_resolver;
7146   { auto _e = num_buckets(); _o->num_buckets = _e; }
7147   { auto _e = embedding_size(); _o->embedding_size = _e; }
7148   { auto _e = embedding_quantization_bits(); _o->embedding_quantization_bits = _e; }
7149   { auto _e = context_size(); _o->context_size = _e; }
7150   { auto _e = max_selection_span(); _o->max_selection_span = _e; }
7151   { auto _e = chargram_orders(); if (_e) { _o->chargram_orders.resize(_e->size()); for (flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { _o->chargram_orders[_i] = _e->Get(_i); } } }
7152   { auto _e = max_word_length(); _o->max_word_length = _e; }
7153   { auto _e = unicode_aware_features(); _o->unicode_aware_features = _e; }
7154   { auto _e = extract_case_feature(); _o->extract_case_feature = _e; }
7155   { auto _e = extract_selection_mask_feature(); _o->extract_selection_mask_feature = _e; }
7156   { auto _e = regexp_feature(); if (_e) { _o->regexp_feature.resize(_e->size()); for (flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { _o->regexp_feature[_i] = _e->Get(_i)->str(); } } }
7157   { auto _e = remap_digits(); _o->remap_digits = _e; }
7158   { auto _e = lowercase_tokens(); _o->lowercase_tokens = _e; }
7159   { auto _e = selection_reduced_output_space(); _o->selection_reduced_output_space = _e; }
7160   { auto _e = collections(); if (_e) { _o->collections.resize(_e->size()); for (flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { _o->collections[_i] = _e->Get(_i)->str(); } } }
7161   { auto _e = default_collection(); _o->default_collection = _e; }
7162   { auto _e = only_use_line_with_click(); _o->only_use_line_with_click = _e; }
7163   { auto _e = split_tokens_on_selection_boundaries(); _o->split_tokens_on_selection_boundaries = _e; }
7164   { auto _e = tokenization_codepoint_config(); if (_e) { _o->tokenization_codepoint_config.resize(_e->size()); for (flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { _o->tokenization_codepoint_config[_i] = std::unique_ptr<libtextclassifier3::TokenizationCodepointRangeT>(_e->Get(_i)->UnPack(_resolver)); } } }
7165   { auto _e = center_token_selection_method(); _o->center_token_selection_method = _e; }
7166   { auto _e = snap_label_span_boundaries_to_containing_tokens(); _o->snap_label_span_boundaries_to_containing_tokens = _e; }
7167   { auto _e = supported_codepoint_ranges(); if (_e) { _o->supported_codepoint_ranges.resize(_e->size()); for (flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { _o->supported_codepoint_ranges[_i] = std::unique_ptr<libtextclassifier3::CodepointRangeT>(_e->Get(_i)->UnPack(_resolver)); } } }
7168   { auto _e = internal_tokenizer_codepoint_ranges(); if (_e) { _o->internal_tokenizer_codepoint_ranges.resize(_e->size()); for (flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { _o->internal_tokenizer_codepoint_ranges[_i] = std::unique_ptr<libtextclassifier3::CodepointRangeT>(_e->Get(_i)->UnPack(_resolver)); } } }
7169   { auto _e = min_supported_codepoint_ratio(); _o->min_supported_codepoint_ratio = _e; }
7170   { auto _e = feature_version(); _o->feature_version = _e; }
7171   { auto _e = tokenization_type(); _o->tokenization_type = _e; }
7172   { auto _e = icu_preserve_whitespace_tokens(); _o->icu_preserve_whitespace_tokens = _e; }
7173   { auto _e = ignored_span_boundary_codepoints(); if (_e) { _o->ignored_span_boundary_codepoints.resize(_e->size()); for (flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { _o->ignored_span_boundary_codepoints[_i] = _e->Get(_i); } } }
7174   { auto _e = bounds_sensitive_features(); if (_e) _o->bounds_sensitive_features = std::unique_ptr<libtextclassifier3::FeatureProcessorOptions_::BoundsSensitiveFeaturesT>(_e->UnPack(_resolver)); }
7175   { auto _e = allowed_chargrams(); if (_e) { _o->allowed_chargrams.resize(_e->size()); for (flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { _o->allowed_chargrams[_i] = _e->Get(_i)->str(); } } }
7176   { auto _e = tokenize_on_script_change(); _o->tokenize_on_script_change = _e; }
7177   { auto _e = use_pipe_character_for_newline(); _o->use_pipe_character_for_newline = _e; }
7178 }
7179 
Pack(flatbuffers::FlatBufferBuilder & _fbb,const FeatureProcessorOptionsT * _o,const flatbuffers::rehasher_function_t * _rehasher)7180 inline flatbuffers::Offset<FeatureProcessorOptions> FeatureProcessorOptions::Pack(flatbuffers::FlatBufferBuilder &_fbb, const FeatureProcessorOptionsT* _o, const flatbuffers::rehasher_function_t *_rehasher) {
7181   return CreateFeatureProcessorOptions(_fbb, _o, _rehasher);
7182 }
7183 
CreateFeatureProcessorOptions(flatbuffers::FlatBufferBuilder & _fbb,const FeatureProcessorOptionsT * _o,const flatbuffers::rehasher_function_t * _rehasher)7184 inline flatbuffers::Offset<FeatureProcessorOptions> CreateFeatureProcessorOptions(flatbuffers::FlatBufferBuilder &_fbb, const FeatureProcessorOptionsT *_o, const flatbuffers::rehasher_function_t *_rehasher) {
7185   (void)_rehasher;
7186   (void)_o;
7187   struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const FeatureProcessorOptionsT* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va;
7188   auto _num_buckets = _o->num_buckets;
7189   auto _embedding_size = _o->embedding_size;
7190   auto _embedding_quantization_bits = _o->embedding_quantization_bits;
7191   auto _context_size = _o->context_size;
7192   auto _max_selection_span = _o->max_selection_span;
7193   auto _chargram_orders = _o->chargram_orders.size() ? _fbb.CreateVector(_o->chargram_orders) : 0;
7194   auto _max_word_length = _o->max_word_length;
7195   auto _unicode_aware_features = _o->unicode_aware_features;
7196   auto _extract_case_feature = _o->extract_case_feature;
7197   auto _extract_selection_mask_feature = _o->extract_selection_mask_feature;
7198   auto _regexp_feature = _o->regexp_feature.size() ? _fbb.CreateVectorOfStrings(_o->regexp_feature) : 0;
7199   auto _remap_digits = _o->remap_digits;
7200   auto _lowercase_tokens = _o->lowercase_tokens;
7201   auto _selection_reduced_output_space = _o->selection_reduced_output_space;
7202   auto _collections = _o->collections.size() ? _fbb.CreateVectorOfStrings(_o->collections) : 0;
7203   auto _default_collection = _o->default_collection;
7204   auto _only_use_line_with_click = _o->only_use_line_with_click;
7205   auto _split_tokens_on_selection_boundaries = _o->split_tokens_on_selection_boundaries;
7206   auto _tokenization_codepoint_config = _o->tokenization_codepoint_config.size() ? _fbb.CreateVector<flatbuffers::Offset<libtextclassifier3::TokenizationCodepointRange>> (_o->tokenization_codepoint_config.size(), [](size_t i, _VectorArgs *__va) { return CreateTokenizationCodepointRange(*__va->__fbb, __va->__o->tokenization_codepoint_config[i].get(), __va->__rehasher); }, &_va ) : 0;
7207   auto _center_token_selection_method = _o->center_token_selection_method;
7208   auto _snap_label_span_boundaries_to_containing_tokens = _o->snap_label_span_boundaries_to_containing_tokens;
7209   auto _supported_codepoint_ranges = _o->supported_codepoint_ranges.size() ? _fbb.CreateVector<flatbuffers::Offset<libtextclassifier3::CodepointRange>> (_o->supported_codepoint_ranges.size(), [](size_t i, _VectorArgs *__va) { return CreateCodepointRange(*__va->__fbb, __va->__o->supported_codepoint_ranges[i].get(), __va->__rehasher); }, &_va ) : 0;
7210   auto _internal_tokenizer_codepoint_ranges = _o->internal_tokenizer_codepoint_ranges.size() ? _fbb.CreateVector<flatbuffers::Offset<libtextclassifier3::CodepointRange>> (_o->internal_tokenizer_codepoint_ranges.size(), [](size_t i, _VectorArgs *__va) { return CreateCodepointRange(*__va->__fbb, __va->__o->internal_tokenizer_codepoint_ranges[i].get(), __va->__rehasher); }, &_va ) : 0;
7211   auto _min_supported_codepoint_ratio = _o->min_supported_codepoint_ratio;
7212   auto _feature_version = _o->feature_version;
7213   auto _tokenization_type = _o->tokenization_type;
7214   auto _icu_preserve_whitespace_tokens = _o->icu_preserve_whitespace_tokens;
7215   auto _ignored_span_boundary_codepoints = _o->ignored_span_boundary_codepoints.size() ? _fbb.CreateVector(_o->ignored_span_boundary_codepoints) : 0;
7216   auto _bounds_sensitive_features = _o->bounds_sensitive_features ? CreateBoundsSensitiveFeatures(_fbb, _o->bounds_sensitive_features.get(), _rehasher) : 0;
7217   auto _allowed_chargrams = _o->allowed_chargrams.size() ? _fbb.CreateVectorOfStrings(_o->allowed_chargrams) : 0;
7218   auto _tokenize_on_script_change = _o->tokenize_on_script_change;
7219   auto _use_pipe_character_for_newline = _o->use_pipe_character_for_newline;
7220   return libtextclassifier3::CreateFeatureProcessorOptions(
7221       _fbb,
7222       _num_buckets,
7223       _embedding_size,
7224       _embedding_quantization_bits,
7225       _context_size,
7226       _max_selection_span,
7227       _chargram_orders,
7228       _max_word_length,
7229       _unicode_aware_features,
7230       _extract_case_feature,
7231       _extract_selection_mask_feature,
7232       _regexp_feature,
7233       _remap_digits,
7234       _lowercase_tokens,
7235       _selection_reduced_output_space,
7236       _collections,
7237       _default_collection,
7238       _only_use_line_with_click,
7239       _split_tokens_on_selection_boundaries,
7240       _tokenization_codepoint_config,
7241       _center_token_selection_method,
7242       _snap_label_span_boundaries_to_containing_tokens,
7243       _supported_codepoint_ranges,
7244       _internal_tokenizer_codepoint_ranges,
7245       _min_supported_codepoint_ratio,
7246       _feature_version,
7247       _tokenization_type,
7248       _icu_preserve_whitespace_tokens,
7249       _ignored_span_boundary_codepoints,
7250       _bounds_sensitive_features,
7251       _allowed_chargrams,
7252       _tokenize_on_script_change,
7253       _use_pipe_character_for_newline);
7254 }
7255 
UnPack(const flatbuffers::resolver_function_t * _resolver)7256 inline NumberAnnotatorOptionsT *NumberAnnotatorOptions::UnPack(const flatbuffers::resolver_function_t *_resolver) const {
7257   auto _o = std::unique_ptr<NumberAnnotatorOptionsT>(new NumberAnnotatorOptionsT());
7258   UnPackTo(_o.get(), _resolver);
7259   return _o.release();
7260 }
7261 
UnPackTo(NumberAnnotatorOptionsT * _o,const flatbuffers::resolver_function_t * _resolver)7262 inline void NumberAnnotatorOptions::UnPackTo(NumberAnnotatorOptionsT *_o, const flatbuffers::resolver_function_t *_resolver) const {
7263   (void)_o;
7264   (void)_resolver;
7265   { auto _e = enabled(); _o->enabled = _e; }
7266   { auto _e = score(); _o->score = _e; }
7267   { auto _e = priority_score(); _o->priority_score = _e; }
7268   { auto _e = enabled_modes(); _o->enabled_modes = _e; }
7269   { auto _e = enabled_annotation_usecases(); _o->enabled_annotation_usecases = _e; }
7270   { auto _e = allowed_prefix_codepoints(); if (_e) { _o->allowed_prefix_codepoints.resize(_e->size()); for (flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { _o->allowed_prefix_codepoints[_i] = _e->Get(_i); } } }
7271   { auto _e = allowed_suffix_codepoints(); if (_e) { _o->allowed_suffix_codepoints.resize(_e->size()); for (flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { _o->allowed_suffix_codepoints[_i] = _e->Get(_i); } } }
7272   { auto _e = ignored_prefix_span_boundary_codepoints(); if (_e) { _o->ignored_prefix_span_boundary_codepoints.resize(_e->size()); for (flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { _o->ignored_prefix_span_boundary_codepoints[_i] = _e->Get(_i); } } }
7273   { auto _e = ignored_suffix_span_boundary_codepoints(); if (_e) { _o->ignored_suffix_span_boundary_codepoints.resize(_e->size()); for (flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { _o->ignored_suffix_span_boundary_codepoints[_i] = _e->Get(_i); } } }
7274   { auto _e = enable_percentage(); _o->enable_percentage = _e; }
7275   { auto _e = percentage_pieces_string(); if (_e) _o->percentage_pieces_string = _e->str(); }
7276   { auto _e = percentage_pieces_offsets(); if (_e) { _o->percentage_pieces_offsets.resize(_e->size()); for (flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { _o->percentage_pieces_offsets[_i] = _e->Get(_i); } } }
7277   { auto _e = percentage_priority_score(); _o->percentage_priority_score = _e; }
7278   { auto _e = float_number_priority_score(); _o->float_number_priority_score = _e; }
7279   { auto _e = max_number_of_digits(); _o->max_number_of_digits = _e; }
7280   { auto _e = percentage_annotation_usecases(); _o->percentage_annotation_usecases = _e; }
7281 }
7282 
Pack(flatbuffers::FlatBufferBuilder & _fbb,const NumberAnnotatorOptionsT * _o,const flatbuffers::rehasher_function_t * _rehasher)7283 inline flatbuffers::Offset<NumberAnnotatorOptions> NumberAnnotatorOptions::Pack(flatbuffers::FlatBufferBuilder &_fbb, const NumberAnnotatorOptionsT* _o, const flatbuffers::rehasher_function_t *_rehasher) {
7284   return CreateNumberAnnotatorOptions(_fbb, _o, _rehasher);
7285 }
7286 
CreateNumberAnnotatorOptions(flatbuffers::FlatBufferBuilder & _fbb,const NumberAnnotatorOptionsT * _o,const flatbuffers::rehasher_function_t * _rehasher)7287 inline flatbuffers::Offset<NumberAnnotatorOptions> CreateNumberAnnotatorOptions(flatbuffers::FlatBufferBuilder &_fbb, const NumberAnnotatorOptionsT *_o, const flatbuffers::rehasher_function_t *_rehasher) {
7288   (void)_rehasher;
7289   (void)_o;
7290   struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const NumberAnnotatorOptionsT* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va;
7291   auto _enabled = _o->enabled;
7292   auto _score = _o->score;
7293   auto _priority_score = _o->priority_score;
7294   auto _enabled_modes = _o->enabled_modes;
7295   auto _enabled_annotation_usecases = _o->enabled_annotation_usecases;
7296   auto _allowed_prefix_codepoints = _o->allowed_prefix_codepoints.size() ? _fbb.CreateVector(_o->allowed_prefix_codepoints) : 0;
7297   auto _allowed_suffix_codepoints = _o->allowed_suffix_codepoints.size() ? _fbb.CreateVector(_o->allowed_suffix_codepoints) : 0;
7298   auto _ignored_prefix_span_boundary_codepoints = _o->ignored_prefix_span_boundary_codepoints.size() ? _fbb.CreateVector(_o->ignored_prefix_span_boundary_codepoints) : 0;
7299   auto _ignored_suffix_span_boundary_codepoints = _o->ignored_suffix_span_boundary_codepoints.size() ? _fbb.CreateVector(_o->ignored_suffix_span_boundary_codepoints) : 0;
7300   auto _enable_percentage = _o->enable_percentage;
7301   auto _percentage_pieces_string = _o->percentage_pieces_string.empty() ? 0 : _fbb.CreateSharedString(_o->percentage_pieces_string);
7302   auto _percentage_pieces_offsets = _o->percentage_pieces_offsets.size() ? _fbb.CreateVector(_o->percentage_pieces_offsets) : 0;
7303   auto _percentage_priority_score = _o->percentage_priority_score;
7304   auto _float_number_priority_score = _o->float_number_priority_score;
7305   auto _max_number_of_digits = _o->max_number_of_digits;
7306   auto _percentage_annotation_usecases = _o->percentage_annotation_usecases;
7307   return libtextclassifier3::CreateNumberAnnotatorOptions(
7308       _fbb,
7309       _enabled,
7310       _score,
7311       _priority_score,
7312       _enabled_modes,
7313       _enabled_annotation_usecases,
7314       _allowed_prefix_codepoints,
7315       _allowed_suffix_codepoints,
7316       _ignored_prefix_span_boundary_codepoints,
7317       _ignored_suffix_span_boundary_codepoints,
7318       _enable_percentage,
7319       _percentage_pieces_string,
7320       _percentage_pieces_offsets,
7321       _percentage_priority_score,
7322       _float_number_priority_score,
7323       _max_number_of_digits,
7324       _percentage_annotation_usecases);
7325 }
7326 
UnPack(const flatbuffers::resolver_function_t * _resolver)7327 inline DurationAnnotatorOptionsT *DurationAnnotatorOptions::UnPack(const flatbuffers::resolver_function_t *_resolver) const {
7328   auto _o = std::unique_ptr<DurationAnnotatorOptionsT>(new DurationAnnotatorOptionsT());
7329   UnPackTo(_o.get(), _resolver);
7330   return _o.release();
7331 }
7332 
UnPackTo(DurationAnnotatorOptionsT * _o,const flatbuffers::resolver_function_t * _resolver)7333 inline void DurationAnnotatorOptions::UnPackTo(DurationAnnotatorOptionsT *_o, const flatbuffers::resolver_function_t *_resolver) const {
7334   (void)_o;
7335   (void)_resolver;
7336   { auto _e = enabled(); _o->enabled = _e; }
7337   { auto _e = score(); _o->score = _e; }
7338   { auto _e = priority_score(); _o->priority_score = _e; }
7339   { auto _e = enabled_modes(); _o->enabled_modes = _e; }
7340   { auto _e = enabled_annotation_usecases(); _o->enabled_annotation_usecases = _e; }
7341   { auto _e = week_expressions(); if (_e) { _o->week_expressions.resize(_e->size()); for (flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { _o->week_expressions[_i] = _e->Get(_i)->str(); } } }
7342   { auto _e = day_expressions(); if (_e) { _o->day_expressions.resize(_e->size()); for (flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { _o->day_expressions[_i] = _e->Get(_i)->str(); } } }
7343   { auto _e = hour_expressions(); if (_e) { _o->hour_expressions.resize(_e->size()); for (flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { _o->hour_expressions[_i] = _e->Get(_i)->str(); } } }
7344   { auto _e = minute_expressions(); if (_e) { _o->minute_expressions.resize(_e->size()); for (flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { _o->minute_expressions[_i] = _e->Get(_i)->str(); } } }
7345   { auto _e = second_expressions(); if (_e) { _o->second_expressions.resize(_e->size()); for (flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { _o->second_expressions[_i] = _e->Get(_i)->str(); } } }
7346   { auto _e = filler_expressions(); if (_e) { _o->filler_expressions.resize(_e->size()); for (flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { _o->filler_expressions[_i] = _e->Get(_i)->str(); } } }
7347   { auto _e = half_expressions(); if (_e) { _o->half_expressions.resize(_e->size()); for (flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { _o->half_expressions[_i] = _e->Get(_i)->str(); } } }
7348   { auto _e = sub_token_separator_codepoints(); if (_e) { _o->sub_token_separator_codepoints.resize(_e->size()); for (flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { _o->sub_token_separator_codepoints[_i] = _e->Get(_i); } } }
7349   { auto _e = require_quantity(); _o->require_quantity = _e; }
7350   { auto _e = enable_dangling_quantity_interpretation(); _o->enable_dangling_quantity_interpretation = _e; }
7351 }
7352 
Pack(flatbuffers::FlatBufferBuilder & _fbb,const DurationAnnotatorOptionsT * _o,const flatbuffers::rehasher_function_t * _rehasher)7353 inline flatbuffers::Offset<DurationAnnotatorOptions> DurationAnnotatorOptions::Pack(flatbuffers::FlatBufferBuilder &_fbb, const DurationAnnotatorOptionsT* _o, const flatbuffers::rehasher_function_t *_rehasher) {
7354   return CreateDurationAnnotatorOptions(_fbb, _o, _rehasher);
7355 }
7356 
CreateDurationAnnotatorOptions(flatbuffers::FlatBufferBuilder & _fbb,const DurationAnnotatorOptionsT * _o,const flatbuffers::rehasher_function_t * _rehasher)7357 inline flatbuffers::Offset<DurationAnnotatorOptions> CreateDurationAnnotatorOptions(flatbuffers::FlatBufferBuilder &_fbb, const DurationAnnotatorOptionsT *_o, const flatbuffers::rehasher_function_t *_rehasher) {
7358   (void)_rehasher;
7359   (void)_o;
7360   struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const DurationAnnotatorOptionsT* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va;
7361   auto _enabled = _o->enabled;
7362   auto _score = _o->score;
7363   auto _priority_score = _o->priority_score;
7364   auto _enabled_modes = _o->enabled_modes;
7365   auto _enabled_annotation_usecases = _o->enabled_annotation_usecases;
7366   auto _week_expressions = _o->week_expressions.size() ? _fbb.CreateVectorOfStrings(_o->week_expressions) : 0;
7367   auto _day_expressions = _o->day_expressions.size() ? _fbb.CreateVectorOfStrings(_o->day_expressions) : 0;
7368   auto _hour_expressions = _o->hour_expressions.size() ? _fbb.CreateVectorOfStrings(_o->hour_expressions) : 0;
7369   auto _minute_expressions = _o->minute_expressions.size() ? _fbb.CreateVectorOfStrings(_o->minute_expressions) : 0;
7370   auto _second_expressions = _o->second_expressions.size() ? _fbb.CreateVectorOfStrings(_o->second_expressions) : 0;
7371   auto _filler_expressions = _o->filler_expressions.size() ? _fbb.CreateVectorOfStrings(_o->filler_expressions) : 0;
7372   auto _half_expressions = _o->half_expressions.size() ? _fbb.CreateVectorOfStrings(_o->half_expressions) : 0;
7373   auto _sub_token_separator_codepoints = _o->sub_token_separator_codepoints.size() ? _fbb.CreateVector(_o->sub_token_separator_codepoints) : 0;
7374   auto _require_quantity = _o->require_quantity;
7375   auto _enable_dangling_quantity_interpretation = _o->enable_dangling_quantity_interpretation;
7376   return libtextclassifier3::CreateDurationAnnotatorOptions(
7377       _fbb,
7378       _enabled,
7379       _score,
7380       _priority_score,
7381       _enabled_modes,
7382       _enabled_annotation_usecases,
7383       _week_expressions,
7384       _day_expressions,
7385       _hour_expressions,
7386       _minute_expressions,
7387       _second_expressions,
7388       _filler_expressions,
7389       _half_expressions,
7390       _sub_token_separator_codepoints,
7391       _require_quantity,
7392       _enable_dangling_quantity_interpretation);
7393 }
7394 
UnPack(const flatbuffers::resolver_function_t * _resolver)7395 inline ContactAnnotatorOptionsT *ContactAnnotatorOptions::UnPack(const flatbuffers::resolver_function_t *_resolver) const {
7396   auto _o = std::unique_ptr<ContactAnnotatorOptionsT>(new ContactAnnotatorOptionsT());
7397   UnPackTo(_o.get(), _resolver);
7398   return _o.release();
7399 }
7400 
UnPackTo(ContactAnnotatorOptionsT * _o,const flatbuffers::resolver_function_t * _resolver)7401 inline void ContactAnnotatorOptions::UnPackTo(ContactAnnotatorOptionsT *_o, const flatbuffers::resolver_function_t *_resolver) const {
7402   (void)_o;
7403   (void)_resolver;
7404   { auto _e = enable_declension(); _o->enable_declension = _e; }
7405   { auto _e = language(); if (_e) _o->language = _e->str(); }
7406   { auto _e = enabled_modes(); _o->enabled_modes = _e; }
7407 }
7408 
Pack(flatbuffers::FlatBufferBuilder & _fbb,const ContactAnnotatorOptionsT * _o,const flatbuffers::rehasher_function_t * _rehasher)7409 inline flatbuffers::Offset<ContactAnnotatorOptions> ContactAnnotatorOptions::Pack(flatbuffers::FlatBufferBuilder &_fbb, const ContactAnnotatorOptionsT* _o, const flatbuffers::rehasher_function_t *_rehasher) {
7410   return CreateContactAnnotatorOptions(_fbb, _o, _rehasher);
7411 }
7412 
CreateContactAnnotatorOptions(flatbuffers::FlatBufferBuilder & _fbb,const ContactAnnotatorOptionsT * _o,const flatbuffers::rehasher_function_t * _rehasher)7413 inline flatbuffers::Offset<ContactAnnotatorOptions> CreateContactAnnotatorOptions(flatbuffers::FlatBufferBuilder &_fbb, const ContactAnnotatorOptionsT *_o, const flatbuffers::rehasher_function_t *_rehasher) {
7414   (void)_rehasher;
7415   (void)_o;
7416   struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const ContactAnnotatorOptionsT* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va;
7417   auto _enable_declension = _o->enable_declension;
7418   auto _language = _o->language.empty() ? 0 : _fbb.CreateSharedString(_o->language);
7419   auto _enabled_modes = _o->enabled_modes;
7420   return libtextclassifier3::CreateContactAnnotatorOptions(
7421       _fbb,
7422       _enable_declension,
7423       _language,
7424       _enabled_modes);
7425 }
7426 
7427 namespace TranslateAnnotatorOptions_ {
7428 
UnPack(const flatbuffers::resolver_function_t * _resolver)7429 inline BackoffOptionsT *BackoffOptions::UnPack(const flatbuffers::resolver_function_t *_resolver) const {
7430   auto _o = std::unique_ptr<BackoffOptionsT>(new BackoffOptionsT());
7431   UnPackTo(_o.get(), _resolver);
7432   return _o.release();
7433 }
7434 
UnPackTo(BackoffOptionsT * _o,const flatbuffers::resolver_function_t * _resolver)7435 inline void BackoffOptions::UnPackTo(BackoffOptionsT *_o, const flatbuffers::resolver_function_t *_resolver) const {
7436   (void)_o;
7437   (void)_resolver;
7438   { auto _e = min_text_size(); _o->min_text_size = _e; }
7439   { auto _e = penalize_ratio(); _o->penalize_ratio = _e; }
7440   { auto _e = subject_text_score_ratio(); _o->subject_text_score_ratio = _e; }
7441 }
7442 
Pack(flatbuffers::FlatBufferBuilder & _fbb,const BackoffOptionsT * _o,const flatbuffers::rehasher_function_t * _rehasher)7443 inline flatbuffers::Offset<BackoffOptions> BackoffOptions::Pack(flatbuffers::FlatBufferBuilder &_fbb, const BackoffOptionsT* _o, const flatbuffers::rehasher_function_t *_rehasher) {
7444   return CreateBackoffOptions(_fbb, _o, _rehasher);
7445 }
7446 
CreateBackoffOptions(flatbuffers::FlatBufferBuilder & _fbb,const BackoffOptionsT * _o,const flatbuffers::rehasher_function_t * _rehasher)7447 inline flatbuffers::Offset<BackoffOptions> CreateBackoffOptions(flatbuffers::FlatBufferBuilder &_fbb, const BackoffOptionsT *_o, const flatbuffers::rehasher_function_t *_rehasher) {
7448   (void)_rehasher;
7449   (void)_o;
7450   struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const BackoffOptionsT* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va;
7451   auto _min_text_size = _o->min_text_size;
7452   auto _penalize_ratio = _o->penalize_ratio;
7453   auto _subject_text_score_ratio = _o->subject_text_score_ratio;
7454   return libtextclassifier3::TranslateAnnotatorOptions_::CreateBackoffOptions(
7455       _fbb,
7456       _min_text_size,
7457       _penalize_ratio,
7458       _subject_text_score_ratio);
7459 }
7460 
7461 }  // namespace TranslateAnnotatorOptions_
7462 
TranslateAnnotatorOptionsT(const TranslateAnnotatorOptionsT & o)7463 inline TranslateAnnotatorOptionsT::TranslateAnnotatorOptionsT(const TranslateAnnotatorOptionsT &o)
7464       : enabled(o.enabled),
7465         score(o.score),
7466         priority_score(o.priority_score),
7467         algorithm(o.algorithm),
7468         backoff_options((o.backoff_options) ? new libtextclassifier3::TranslateAnnotatorOptions_::BackoffOptionsT(*o.backoff_options) : nullptr),
7469         enabled_modes(o.enabled_modes) {
7470 }
7471 
7472 inline TranslateAnnotatorOptionsT &TranslateAnnotatorOptionsT::operator=(TranslateAnnotatorOptionsT o) FLATBUFFERS_NOEXCEPT {
7473   std::swap(enabled, o.enabled);
7474   std::swap(score, o.score);
7475   std::swap(priority_score, o.priority_score);
7476   std::swap(algorithm, o.algorithm);
7477   std::swap(backoff_options, o.backoff_options);
7478   std::swap(enabled_modes, o.enabled_modes);
7479   return *this;
7480 }
7481 
UnPack(const flatbuffers::resolver_function_t * _resolver)7482 inline TranslateAnnotatorOptionsT *TranslateAnnotatorOptions::UnPack(const flatbuffers::resolver_function_t *_resolver) const {
7483   auto _o = std::unique_ptr<TranslateAnnotatorOptionsT>(new TranslateAnnotatorOptionsT());
7484   UnPackTo(_o.get(), _resolver);
7485   return _o.release();
7486 }
7487 
UnPackTo(TranslateAnnotatorOptionsT * _o,const flatbuffers::resolver_function_t * _resolver)7488 inline void TranslateAnnotatorOptions::UnPackTo(TranslateAnnotatorOptionsT *_o, const flatbuffers::resolver_function_t *_resolver) const {
7489   (void)_o;
7490   (void)_resolver;
7491   { auto _e = enabled(); _o->enabled = _e; }
7492   { auto _e = score(); _o->score = _e; }
7493   { auto _e = priority_score(); _o->priority_score = _e; }
7494   { auto _e = algorithm(); _o->algorithm = _e; }
7495   { auto _e = backoff_options(); if (_e) _o->backoff_options = std::unique_ptr<libtextclassifier3::TranslateAnnotatorOptions_::BackoffOptionsT>(_e->UnPack(_resolver)); }
7496   { auto _e = enabled_modes(); _o->enabled_modes = _e; }
7497 }
7498 
Pack(flatbuffers::FlatBufferBuilder & _fbb,const TranslateAnnotatorOptionsT * _o,const flatbuffers::rehasher_function_t * _rehasher)7499 inline flatbuffers::Offset<TranslateAnnotatorOptions> TranslateAnnotatorOptions::Pack(flatbuffers::FlatBufferBuilder &_fbb, const TranslateAnnotatorOptionsT* _o, const flatbuffers::rehasher_function_t *_rehasher) {
7500   return CreateTranslateAnnotatorOptions(_fbb, _o, _rehasher);
7501 }
7502 
CreateTranslateAnnotatorOptions(flatbuffers::FlatBufferBuilder & _fbb,const TranslateAnnotatorOptionsT * _o,const flatbuffers::rehasher_function_t * _rehasher)7503 inline flatbuffers::Offset<TranslateAnnotatorOptions> CreateTranslateAnnotatorOptions(flatbuffers::FlatBufferBuilder &_fbb, const TranslateAnnotatorOptionsT *_o, const flatbuffers::rehasher_function_t *_rehasher) {
7504   (void)_rehasher;
7505   (void)_o;
7506   struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const TranslateAnnotatorOptionsT* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va;
7507   auto _enabled = _o->enabled;
7508   auto _score = _o->score;
7509   auto _priority_score = _o->priority_score;
7510   auto _algorithm = _o->algorithm;
7511   auto _backoff_options = _o->backoff_options ? CreateBackoffOptions(_fbb, _o->backoff_options.get(), _rehasher) : 0;
7512   auto _enabled_modes = _o->enabled_modes;
7513   return libtextclassifier3::CreateTranslateAnnotatorOptions(
7514       _fbb,
7515       _enabled,
7516       _score,
7517       _priority_score,
7518       _algorithm,
7519       _backoff_options,
7520       _enabled_modes);
7521 }
7522 
7523 namespace PodNerModel_ {
7524 
UnPack(const flatbuffers::resolver_function_t * _resolver)7525 inline CollectionT *Collection::UnPack(const flatbuffers::resolver_function_t *_resolver) const {
7526   auto _o = std::unique_ptr<CollectionT>(new CollectionT());
7527   UnPackTo(_o.get(), _resolver);
7528   return _o.release();
7529 }
7530 
UnPackTo(CollectionT * _o,const flatbuffers::resolver_function_t * _resolver)7531 inline void Collection::UnPackTo(CollectionT *_o, const flatbuffers::resolver_function_t *_resolver) const {
7532   (void)_o;
7533   (void)_resolver;
7534   { auto _e = name(); if (_e) _o->name = _e->str(); }
7535   { auto _e = single_token_priority_score(); _o->single_token_priority_score = _e; }
7536   { auto _e = multi_token_priority_score(); _o->multi_token_priority_score = _e; }
7537 }
7538 
Pack(flatbuffers::FlatBufferBuilder & _fbb,const CollectionT * _o,const flatbuffers::rehasher_function_t * _rehasher)7539 inline flatbuffers::Offset<Collection> Collection::Pack(flatbuffers::FlatBufferBuilder &_fbb, const CollectionT* _o, const flatbuffers::rehasher_function_t *_rehasher) {
7540   return CreateCollection(_fbb, _o, _rehasher);
7541 }
7542 
CreateCollection(flatbuffers::FlatBufferBuilder & _fbb,const CollectionT * _o,const flatbuffers::rehasher_function_t * _rehasher)7543 inline flatbuffers::Offset<Collection> CreateCollection(flatbuffers::FlatBufferBuilder &_fbb, const CollectionT *_o, const flatbuffers::rehasher_function_t *_rehasher) {
7544   (void)_rehasher;
7545   (void)_o;
7546   struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const CollectionT* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va;
7547   auto _name = _o->name.empty() ? 0 : _fbb.CreateSharedString(_o->name);
7548   auto _single_token_priority_score = _o->single_token_priority_score;
7549   auto _multi_token_priority_score = _o->multi_token_priority_score;
7550   return libtextclassifier3::PodNerModel_::CreateCollection(
7551       _fbb,
7552       _name,
7553       _single_token_priority_score,
7554       _multi_token_priority_score);
7555 }
7556 
UnPack(const flatbuffers::resolver_function_t * _resolver)7557 inline LabelT *Label::UnPack(const flatbuffers::resolver_function_t *_resolver) const {
7558   auto _o = std::unique_ptr<LabelT>(new LabelT());
7559   UnPackTo(_o.get(), _resolver);
7560   return _o.release();
7561 }
7562 
UnPackTo(LabelT * _o,const flatbuffers::resolver_function_t * _resolver)7563 inline void Label::UnPackTo(LabelT *_o, const flatbuffers::resolver_function_t *_resolver) const {
7564   (void)_o;
7565   (void)_resolver;
7566   { auto _e = boise_type(); _o->boise_type = _e; }
7567   { auto _e = mention_type(); _o->mention_type = _e; }
7568   { auto _e = collection_id(); _o->collection_id = _e; }
7569 }
7570 
Pack(flatbuffers::FlatBufferBuilder & _fbb,const LabelT * _o,const flatbuffers::rehasher_function_t * _rehasher)7571 inline flatbuffers::Offset<Label> Label::Pack(flatbuffers::FlatBufferBuilder &_fbb, const LabelT* _o, const flatbuffers::rehasher_function_t *_rehasher) {
7572   return CreateLabel(_fbb, _o, _rehasher);
7573 }
7574 
CreateLabel(flatbuffers::FlatBufferBuilder & _fbb,const LabelT * _o,const flatbuffers::rehasher_function_t * _rehasher)7575 inline flatbuffers::Offset<Label> CreateLabel(flatbuffers::FlatBufferBuilder &_fbb, const LabelT *_o, const flatbuffers::rehasher_function_t *_rehasher) {
7576   (void)_rehasher;
7577   (void)_o;
7578   struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const LabelT* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va;
7579   auto _boise_type = _o->boise_type;
7580   auto _mention_type = _o->mention_type;
7581   auto _collection_id = _o->collection_id;
7582   return libtextclassifier3::PodNerModel_::CreateLabel(
7583       _fbb,
7584       _boise_type,
7585       _mention_type,
7586       _collection_id);
7587 }
7588 
7589 }  // namespace PodNerModel_
7590 
PodNerModelT(const PodNerModelT & o)7591 inline PodNerModelT::PodNerModelT(const PodNerModelT &o)
7592       : tflite_model(o.tflite_model),
7593         word_piece_vocab(o.word_piece_vocab),
7594         lowercase_input(o.lowercase_input),
7595         logits_index_in_output_tensor(o.logits_index_in_output_tensor),
7596         append_final_period(o.append_final_period),
7597         priority_score(o.priority_score),
7598         max_num_wordpieces(o.max_num_wordpieces),
7599         sliding_window_num_wordpieces_overlap(o.sliding_window_num_wordpieces_overlap),
7600         max_ratio_unknown_wordpieces(o.max_ratio_unknown_wordpieces),
7601         min_number_of_tokens(o.min_number_of_tokens),
7602         min_number_of_wordpieces(o.min_number_of_wordpieces),
7603         enabled_modes(o.enabled_modes) {
7604   labels.reserve(o.labels.size());
7605   for (const auto &labels_ : o.labels) { labels.emplace_back((labels_) ? new libtextclassifier3::PodNerModel_::LabelT(*labels_) : nullptr); }
7606   collections.reserve(o.collections.size());
7607   for (const auto &collections_ : o.collections) { collections.emplace_back((collections_) ? new libtextclassifier3::PodNerModel_::CollectionT(*collections_) : nullptr); }
7608 }
7609 
7610 inline PodNerModelT &PodNerModelT::operator=(PodNerModelT o) FLATBUFFERS_NOEXCEPT {
7611   std::swap(tflite_model, o.tflite_model);
7612   std::swap(word_piece_vocab, o.word_piece_vocab);
7613   std::swap(lowercase_input, o.lowercase_input);
7614   std::swap(logits_index_in_output_tensor, o.logits_index_in_output_tensor);
7615   std::swap(append_final_period, o.append_final_period);
7616   std::swap(priority_score, o.priority_score);
7617   std::swap(max_num_wordpieces, o.max_num_wordpieces);
7618   std::swap(sliding_window_num_wordpieces_overlap, o.sliding_window_num_wordpieces_overlap);
7619   std::swap(labels, o.labels);
7620   std::swap(max_ratio_unknown_wordpieces, o.max_ratio_unknown_wordpieces);
7621   std::swap(collections, o.collections);
7622   std::swap(min_number_of_tokens, o.min_number_of_tokens);
7623   std::swap(min_number_of_wordpieces, o.min_number_of_wordpieces);
7624   std::swap(enabled_modes, o.enabled_modes);
7625   return *this;
7626 }
7627 
UnPack(const flatbuffers::resolver_function_t * _resolver)7628 inline PodNerModelT *PodNerModel::UnPack(const flatbuffers::resolver_function_t *_resolver) const {
7629   auto _o = std::unique_ptr<PodNerModelT>(new PodNerModelT());
7630   UnPackTo(_o.get(), _resolver);
7631   return _o.release();
7632 }
7633 
UnPackTo(PodNerModelT * _o,const flatbuffers::resolver_function_t * _resolver)7634 inline void PodNerModel::UnPackTo(PodNerModelT *_o, const flatbuffers::resolver_function_t *_resolver) const {
7635   (void)_o;
7636   (void)_resolver;
7637   { auto _e = tflite_model(); if (_e) { _o->tflite_model.resize(_e->size()); std::copy(_e->begin(), _e->end(), _o->tflite_model.begin()); } }
7638   { auto _e = word_piece_vocab(); if (_e) { _o->word_piece_vocab.resize(_e->size()); std::copy(_e->begin(), _e->end(), _o->word_piece_vocab.begin()); } }
7639   { auto _e = lowercase_input(); _o->lowercase_input = _e; }
7640   { auto _e = logits_index_in_output_tensor(); _o->logits_index_in_output_tensor = _e; }
7641   { auto _e = append_final_period(); _o->append_final_period = _e; }
7642   { auto _e = priority_score(); _o->priority_score = _e; }
7643   { auto _e = max_num_wordpieces(); _o->max_num_wordpieces = _e; }
7644   { auto _e = sliding_window_num_wordpieces_overlap(); _o->sliding_window_num_wordpieces_overlap = _e; }
7645   { auto _e = labels(); if (_e) { _o->labels.resize(_e->size()); for (flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { _o->labels[_i] = std::unique_ptr<libtextclassifier3::PodNerModel_::LabelT>(_e->Get(_i)->UnPack(_resolver)); } } }
7646   { auto _e = max_ratio_unknown_wordpieces(); _o->max_ratio_unknown_wordpieces = _e; }
7647   { auto _e = collections(); if (_e) { _o->collections.resize(_e->size()); for (flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { _o->collections[_i] = std::unique_ptr<libtextclassifier3::PodNerModel_::CollectionT>(_e->Get(_i)->UnPack(_resolver)); } } }
7648   { auto _e = min_number_of_tokens(); _o->min_number_of_tokens = _e; }
7649   { auto _e = min_number_of_wordpieces(); _o->min_number_of_wordpieces = _e; }
7650   { auto _e = enabled_modes(); _o->enabled_modes = _e; }
7651 }
7652 
Pack(flatbuffers::FlatBufferBuilder & _fbb,const PodNerModelT * _o,const flatbuffers::rehasher_function_t * _rehasher)7653 inline flatbuffers::Offset<PodNerModel> PodNerModel::Pack(flatbuffers::FlatBufferBuilder &_fbb, const PodNerModelT* _o, const flatbuffers::rehasher_function_t *_rehasher) {
7654   return CreatePodNerModel(_fbb, _o, _rehasher);
7655 }
7656 
CreatePodNerModel(flatbuffers::FlatBufferBuilder & _fbb,const PodNerModelT * _o,const flatbuffers::rehasher_function_t * _rehasher)7657 inline flatbuffers::Offset<PodNerModel> CreatePodNerModel(flatbuffers::FlatBufferBuilder &_fbb, const PodNerModelT *_o, const flatbuffers::rehasher_function_t *_rehasher) {
7658   (void)_rehasher;
7659   (void)_o;
7660   struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const PodNerModelT* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va;
7661   auto _tflite_model = _o->tflite_model.size() ? _fbb.CreateVector(_o->tflite_model) : 0;
7662   auto _word_piece_vocab = _o->word_piece_vocab.size() ? _fbb.CreateVector(_o->word_piece_vocab) : 0;
7663   auto _lowercase_input = _o->lowercase_input;
7664   auto _logits_index_in_output_tensor = _o->logits_index_in_output_tensor;
7665   auto _append_final_period = _o->append_final_period;
7666   auto _priority_score = _o->priority_score;
7667   auto _max_num_wordpieces = _o->max_num_wordpieces;
7668   auto _sliding_window_num_wordpieces_overlap = _o->sliding_window_num_wordpieces_overlap;
7669   auto _labels = _o->labels.size() ? _fbb.CreateVector<flatbuffers::Offset<libtextclassifier3::PodNerModel_::Label>> (_o->labels.size(), [](size_t i, _VectorArgs *__va) { return CreateLabel(*__va->__fbb, __va->__o->labels[i].get(), __va->__rehasher); }, &_va ) : 0;
7670   auto _max_ratio_unknown_wordpieces = _o->max_ratio_unknown_wordpieces;
7671   auto _collections = _o->collections.size() ? _fbb.CreateVector<flatbuffers::Offset<libtextclassifier3::PodNerModel_::Collection>> (_o->collections.size(), [](size_t i, _VectorArgs *__va) { return CreateCollection(*__va->__fbb, __va->__o->collections[i].get(), __va->__rehasher); }, &_va ) : 0;
7672   auto _min_number_of_tokens = _o->min_number_of_tokens;
7673   auto _min_number_of_wordpieces = _o->min_number_of_wordpieces;
7674   auto _enabled_modes = _o->enabled_modes;
7675   return libtextclassifier3::CreatePodNerModel(
7676       _fbb,
7677       _tflite_model,
7678       _word_piece_vocab,
7679       _lowercase_input,
7680       _logits_index_in_output_tensor,
7681       _append_final_period,
7682       _priority_score,
7683       _max_num_wordpieces,
7684       _sliding_window_num_wordpieces_overlap,
7685       _labels,
7686       _max_ratio_unknown_wordpieces,
7687       _collections,
7688       _min_number_of_tokens,
7689       _min_number_of_wordpieces,
7690       _enabled_modes);
7691 }
7692 
VocabModelT(const VocabModelT & o)7693 inline VocabModelT::VocabModelT(const VocabModelT &o)
7694       : vocab_trie(o.vocab_trie),
7695         beginner_level((o.beginner_level) ? new libtextclassifier3::BitVectorDataT(*o.beginner_level) : nullptr),
7696         do_not_trigger_in_upper_case((o.do_not_trigger_in_upper_case) ? new libtextclassifier3::BitVectorDataT(*o.do_not_trigger_in_upper_case) : nullptr),
7697         triggering_locales(o.triggering_locales),
7698         target_classification_score(o.target_classification_score),
7699         priority_score(o.priority_score),
7700         enabled_modes(o.enabled_modes) {
7701 }
7702 
7703 inline VocabModelT &VocabModelT::operator=(VocabModelT o) FLATBUFFERS_NOEXCEPT {
7704   std::swap(vocab_trie, o.vocab_trie);
7705   std::swap(beginner_level, o.beginner_level);
7706   std::swap(do_not_trigger_in_upper_case, o.do_not_trigger_in_upper_case);
7707   std::swap(triggering_locales, o.triggering_locales);
7708   std::swap(target_classification_score, o.target_classification_score);
7709   std::swap(priority_score, o.priority_score);
7710   std::swap(enabled_modes, o.enabled_modes);
7711   return *this;
7712 }
7713 
UnPack(const flatbuffers::resolver_function_t * _resolver)7714 inline VocabModelT *VocabModel::UnPack(const flatbuffers::resolver_function_t *_resolver) const {
7715   auto _o = std::unique_ptr<VocabModelT>(new VocabModelT());
7716   UnPackTo(_o.get(), _resolver);
7717   return _o.release();
7718 }
7719 
UnPackTo(VocabModelT * _o,const flatbuffers::resolver_function_t * _resolver)7720 inline void VocabModel::UnPackTo(VocabModelT *_o, const flatbuffers::resolver_function_t *_resolver) const {
7721   (void)_o;
7722   (void)_resolver;
7723   { auto _e = vocab_trie(); if (_e) { _o->vocab_trie.resize(_e->size()); std::copy(_e->begin(), _e->end(), _o->vocab_trie.begin()); } }
7724   { auto _e = beginner_level(); if (_e) _o->beginner_level = std::unique_ptr<libtextclassifier3::BitVectorDataT>(_e->UnPack(_resolver)); }
7725   { auto _e = do_not_trigger_in_upper_case(); if (_e) _o->do_not_trigger_in_upper_case = std::unique_ptr<libtextclassifier3::BitVectorDataT>(_e->UnPack(_resolver)); }
7726   { auto _e = triggering_locales(); if (_e) _o->triggering_locales = _e->str(); }
7727   { auto _e = target_classification_score(); _o->target_classification_score = _e; }
7728   { auto _e = priority_score(); _o->priority_score = _e; }
7729   { auto _e = enabled_modes(); _o->enabled_modes = _e; }
7730 }
7731 
Pack(flatbuffers::FlatBufferBuilder & _fbb,const VocabModelT * _o,const flatbuffers::rehasher_function_t * _rehasher)7732 inline flatbuffers::Offset<VocabModel> VocabModel::Pack(flatbuffers::FlatBufferBuilder &_fbb, const VocabModelT* _o, const flatbuffers::rehasher_function_t *_rehasher) {
7733   return CreateVocabModel(_fbb, _o, _rehasher);
7734 }
7735 
CreateVocabModel(flatbuffers::FlatBufferBuilder & _fbb,const VocabModelT * _o,const flatbuffers::rehasher_function_t * _rehasher)7736 inline flatbuffers::Offset<VocabModel> CreateVocabModel(flatbuffers::FlatBufferBuilder &_fbb, const VocabModelT *_o, const flatbuffers::rehasher_function_t *_rehasher) {
7737   (void)_rehasher;
7738   (void)_o;
7739   struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const VocabModelT* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va;
7740   _fbb.ForceVectorAlignment(_o->vocab_trie.size(), sizeof(uint8_t), 8);
7741   auto _vocab_trie = _o->vocab_trie.size() ? _fbb.CreateVector(_o->vocab_trie) : 0;
7742   auto _beginner_level = _o->beginner_level ? CreateBitVectorData(_fbb, _o->beginner_level.get(), _rehasher) : 0;
7743   auto _do_not_trigger_in_upper_case = _o->do_not_trigger_in_upper_case ? CreateBitVectorData(_fbb, _o->do_not_trigger_in_upper_case.get(), _rehasher) : 0;
7744   auto _triggering_locales = _o->triggering_locales.empty() ? 0 : _fbb.CreateSharedString(_o->triggering_locales);
7745   auto _target_classification_score = _o->target_classification_score;
7746   auto _priority_score = _o->priority_score;
7747   auto _enabled_modes = _o->enabled_modes;
7748   return libtextclassifier3::CreateVocabModel(
7749       _fbb,
7750       _vocab_trie,
7751       _beginner_level,
7752       _do_not_trigger_in_upper_case,
7753       _triggering_locales,
7754       _target_classification_score,
7755       _priority_score,
7756       _enabled_modes);
7757 }
7758 
GetModel(const void * buf)7759 inline const libtextclassifier3::Model *GetModel(const void *buf) {
7760   return flatbuffers::GetRoot<libtextclassifier3::Model>(buf);
7761 }
7762 
GetSizePrefixedModel(const void * buf)7763 inline const libtextclassifier3::Model *GetSizePrefixedModel(const void *buf) {
7764   return flatbuffers::GetSizePrefixedRoot<libtextclassifier3::Model>(buf);
7765 }
7766 
ModelIdentifier()7767 inline const char *ModelIdentifier() {
7768   return "TC2 ";
7769 }
7770 
ModelBufferHasIdentifier(const void * buf)7771 inline bool ModelBufferHasIdentifier(const void *buf) {
7772   return flatbuffers::BufferHasIdentifier(
7773       buf, ModelIdentifier());
7774 }
7775 
SizePrefixedModelBufferHasIdentifier(const void * buf)7776 inline bool SizePrefixedModelBufferHasIdentifier(const void *buf) {
7777   return flatbuffers::BufferHasIdentifier(
7778       buf, ModelIdentifier(), true);
7779 }
7780 
VerifyModelBuffer(flatbuffers::Verifier & verifier)7781 inline bool VerifyModelBuffer(
7782     flatbuffers::Verifier &verifier) {
7783   return verifier.VerifyBuffer<libtextclassifier3::Model>(ModelIdentifier());
7784 }
7785 
VerifySizePrefixedModelBuffer(flatbuffers::Verifier & verifier)7786 inline bool VerifySizePrefixedModelBuffer(
7787     flatbuffers::Verifier &verifier) {
7788   return verifier.VerifySizePrefixedBuffer<libtextclassifier3::Model>(ModelIdentifier());
7789 }
7790 
FinishModelBuffer(flatbuffers::FlatBufferBuilder & fbb,flatbuffers::Offset<libtextclassifier3::Model> root)7791 inline void FinishModelBuffer(
7792     flatbuffers::FlatBufferBuilder &fbb,
7793     flatbuffers::Offset<libtextclassifier3::Model> root) {
7794   fbb.Finish(root, ModelIdentifier());
7795 }
7796 
FinishSizePrefixedModelBuffer(flatbuffers::FlatBufferBuilder & fbb,flatbuffers::Offset<libtextclassifier3::Model> root)7797 inline void FinishSizePrefixedModelBuffer(
7798     flatbuffers::FlatBufferBuilder &fbb,
7799     flatbuffers::Offset<libtextclassifier3::Model> root) {
7800   fbb.FinishSizePrefixed(root, ModelIdentifier());
7801 }
7802 
7803 inline std::unique_ptr<libtextclassifier3::ModelT> UnPackModel(
7804     const void *buf,
7805     const flatbuffers::resolver_function_t *res = nullptr) {
7806   return std::unique_ptr<libtextclassifier3::ModelT>(GetModel(buf)->UnPack(res));
7807 }
7808 
7809 inline std::unique_ptr<libtextclassifier3::ModelT> UnPackSizePrefixedModel(
7810     const void *buf,
7811     const flatbuffers::resolver_function_t *res = nullptr) {
7812   return std::unique_ptr<libtextclassifier3::ModelT>(GetSizePrefixedModel(buf)->UnPack(res));
7813 }
7814 
7815 }  // namespace libtextclassifier3
7816 
7817 #endif  // FLATBUFFERS_GENERATED_MODEL_LIBTEXTCLASSIFIER3_H_
7818