1 // automatically generated by the FlatBuffers compiler, do not modify
2
3
4 #ifndef FLATBUFFERS_GENERATED_NORMALIZATION_LIBTEXTCLASSIFIER3_H_
5 #define FLATBUFFERS_GENERATED_NORMALIZATION_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 namespace libtextclassifier3 {
17
18 struct NormalizationOptions;
19 struct NormalizationOptionsBuilder;
20 struct NormalizationOptionsT;
21
22 namespace NormalizationOptions_ {
23
24 enum CodepointwiseNormalizationOp : int32_t {
25 CodepointwiseNormalizationOp_NONE = 0,
26 CodepointwiseNormalizationOp_LOWERCASE = 1,
27 CodepointwiseNormalizationOp_UPPERCASE = 4,
28 CodepointwiseNormalizationOp_DROP_WHITESPACE = 8,
29 CodepointwiseNormalizationOp_DROP_PUNCTUATION = 16,
30 CodepointwiseNormalizationOp_MIN = CodepointwiseNormalizationOp_NONE,
31 CodepointwiseNormalizationOp_MAX = CodepointwiseNormalizationOp_DROP_PUNCTUATION
32 };
33
EnumValuesCodepointwiseNormalizationOp()34 inline const CodepointwiseNormalizationOp (&EnumValuesCodepointwiseNormalizationOp())[5] {
35 static const CodepointwiseNormalizationOp values[] = {
36 CodepointwiseNormalizationOp_NONE,
37 CodepointwiseNormalizationOp_LOWERCASE,
38 CodepointwiseNormalizationOp_UPPERCASE,
39 CodepointwiseNormalizationOp_DROP_WHITESPACE,
40 CodepointwiseNormalizationOp_DROP_PUNCTUATION
41 };
42 return values;
43 }
44
EnumNamesCodepointwiseNormalizationOp()45 inline const char * const *EnumNamesCodepointwiseNormalizationOp() {
46 static const char * const names[18] = {
47 "NONE",
48 "LOWERCASE",
49 "",
50 "",
51 "UPPERCASE",
52 "",
53 "",
54 "",
55 "DROP_WHITESPACE",
56 "",
57 "",
58 "",
59 "",
60 "",
61 "",
62 "",
63 "DROP_PUNCTUATION",
64 nullptr
65 };
66 return names;
67 }
68
EnumNameCodepointwiseNormalizationOp(CodepointwiseNormalizationOp e)69 inline const char *EnumNameCodepointwiseNormalizationOp(CodepointwiseNormalizationOp e) {
70 if (flatbuffers::IsOutRange(e, CodepointwiseNormalizationOp_NONE, CodepointwiseNormalizationOp_DROP_PUNCTUATION)) return "";
71 const size_t index = static_cast<size_t>(e);
72 return EnumNamesCodepointwiseNormalizationOp()[index];
73 }
74
75 } // namespace NormalizationOptions_
76
77 struct NormalizationOptionsT : public flatbuffers::NativeTable {
78 typedef NormalizationOptions TableType;
79 uint32_t codepointwise_normalization = 0;
80 };
81
82 struct NormalizationOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
83 typedef NormalizationOptionsT NativeTableType;
84 typedef NormalizationOptionsBuilder Builder;
85 enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
86 VT_CODEPOINTWISE_NORMALIZATION = 4
87 };
codepointwise_normalizationFLATBUFFERS_FINAL_CLASS88 uint32_t codepointwise_normalization() const {
89 return GetField<uint32_t>(VT_CODEPOINTWISE_NORMALIZATION, 0);
90 }
VerifyFLATBUFFERS_FINAL_CLASS91 bool Verify(flatbuffers::Verifier &verifier) const {
92 return VerifyTableStart(verifier) &&
93 VerifyField<uint32_t>(verifier, VT_CODEPOINTWISE_NORMALIZATION, 4) &&
94 verifier.EndTable();
95 }
96 NormalizationOptionsT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const;
97 void UnPackTo(NormalizationOptionsT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const;
98 static flatbuffers::Offset<NormalizationOptions> Pack(flatbuffers::FlatBufferBuilder &_fbb, const NormalizationOptionsT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
99 };
100
101 struct NormalizationOptionsBuilder {
102 typedef NormalizationOptions Table;
103 flatbuffers::FlatBufferBuilder &fbb_;
104 flatbuffers::uoffset_t start_;
add_codepointwise_normalizationNormalizationOptionsBuilder105 void add_codepointwise_normalization(uint32_t codepointwise_normalization) {
106 fbb_.AddElement<uint32_t>(NormalizationOptions::VT_CODEPOINTWISE_NORMALIZATION, codepointwise_normalization, 0);
107 }
NormalizationOptionsBuilderNormalizationOptionsBuilder108 explicit NormalizationOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb)
109 : fbb_(_fbb) {
110 start_ = fbb_.StartTable();
111 }
FinishNormalizationOptionsBuilder112 flatbuffers::Offset<NormalizationOptions> Finish() {
113 const auto end = fbb_.EndTable(start_);
114 auto o = flatbuffers::Offset<NormalizationOptions>(end);
115 return o;
116 }
117 };
118
119 inline flatbuffers::Offset<NormalizationOptions> CreateNormalizationOptions(
120 flatbuffers::FlatBufferBuilder &_fbb,
121 uint32_t codepointwise_normalization = 0) {
122 NormalizationOptionsBuilder builder_(_fbb);
123 builder_.add_codepointwise_normalization(codepointwise_normalization);
124 return builder_.Finish();
125 }
126
127 flatbuffers::Offset<NormalizationOptions> CreateNormalizationOptions(flatbuffers::FlatBufferBuilder &_fbb, const NormalizationOptionsT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
128
UnPack(const flatbuffers::resolver_function_t * _resolver)129 inline NormalizationOptionsT *NormalizationOptions::UnPack(const flatbuffers::resolver_function_t *_resolver) const {
130 auto _o = std::unique_ptr<NormalizationOptionsT>(new NormalizationOptionsT());
131 UnPackTo(_o.get(), _resolver);
132 return _o.release();
133 }
134
UnPackTo(NormalizationOptionsT * _o,const flatbuffers::resolver_function_t * _resolver)135 inline void NormalizationOptions::UnPackTo(NormalizationOptionsT *_o, const flatbuffers::resolver_function_t *_resolver) const {
136 (void)_o;
137 (void)_resolver;
138 { auto _e = codepointwise_normalization(); _o->codepointwise_normalization = _e; }
139 }
140
Pack(flatbuffers::FlatBufferBuilder & _fbb,const NormalizationOptionsT * _o,const flatbuffers::rehasher_function_t * _rehasher)141 inline flatbuffers::Offset<NormalizationOptions> NormalizationOptions::Pack(flatbuffers::FlatBufferBuilder &_fbb, const NormalizationOptionsT* _o, const flatbuffers::rehasher_function_t *_rehasher) {
142 return CreateNormalizationOptions(_fbb, _o, _rehasher);
143 }
144
CreateNormalizationOptions(flatbuffers::FlatBufferBuilder & _fbb,const NormalizationOptionsT * _o,const flatbuffers::rehasher_function_t * _rehasher)145 inline flatbuffers::Offset<NormalizationOptions> CreateNormalizationOptions(flatbuffers::FlatBufferBuilder &_fbb, const NormalizationOptionsT *_o, const flatbuffers::rehasher_function_t *_rehasher) {
146 (void)_rehasher;
147 (void)_o;
148 struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const NormalizationOptionsT* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va;
149 auto _codepointwise_normalization = _o->codepointwise_normalization;
150 return libtextclassifier3::CreateNormalizationOptions(
151 _fbb,
152 _codepointwise_normalization);
153 }
154
155 } // namespace libtextclassifier3
156
157 #endif // FLATBUFFERS_GENERATED_NORMALIZATION_LIBTEXTCLASSIFIER3_H_
158