HELLO·Android
系统源代码
IT资讯
技术文章
我的收藏
注册
登录
-
我收藏的文章
创建代码块
我的代码块
我的账号
Pie
|
9.0.0_r8
下载
查看原文件
收藏
根目录
external
libtextclassifier
model_generated.h
/* * Copyright (C) 2017 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ // automatically generated by the FlatBuffers compiler, do not modify #ifndef FLATBUFFERS_GENERATED_MODEL_LIBTEXTCLASSIFIER2_H_ #define FLATBUFFERS_GENERATED_MODEL_LIBTEXTCLASSIFIER2_H_ #include "flatbuffers/flatbuffers.h" namespace libtextclassifier2 { struct CompressedBuffer; struct CompressedBufferT; struct SelectionModelOptions; struct SelectionModelOptionsT; struct ClassificationModelOptions; struct ClassificationModelOptionsT; namespace RegexModel_ { struct Pattern; struct PatternT; } // namespace RegexModel_ struct RegexModel; struct RegexModelT; namespace DatetimeModelPattern_ { struct Regex; struct RegexT; } // namespace DatetimeModelPattern_ struct DatetimeModelPattern; struct DatetimeModelPatternT; struct DatetimeModelExtractor; struct DatetimeModelExtractorT; struct DatetimeModel; struct DatetimeModelT; namespace DatetimeModelLibrary_ { struct Item; struct ItemT; } // namespace DatetimeModelLibrary_ struct DatetimeModelLibrary; struct DatetimeModelLibraryT; struct ModelTriggeringOptions; struct ModelTriggeringOptionsT; struct OutputOptions; struct OutputOptionsT; struct Model; struct ModelT; struct TokenizationCodepointRange; struct TokenizationCodepointRangeT; namespace FeatureProcessorOptions_ { struct CodepointRange; struct CodepointRangeT; struct BoundsSensitiveFeatures; struct BoundsSensitiveFeaturesT; struct AlternativeCollectionMapEntry; struct AlternativeCollectionMapEntryT; } // namespace FeatureProcessorOptions_ struct FeatureProcessorOptions; struct FeatureProcessorOptionsT; enum ModeFlag { ModeFlag_NONE = 0, ModeFlag_ANNOTATION = 1, ModeFlag_CLASSIFICATION = 2, ModeFlag_ANNOTATION_AND_CLASSIFICATION = 3, ModeFlag_SELECTION = 4, ModeFlag_ANNOTATION_AND_SELECTION = 5, ModeFlag_CLASSIFICATION_AND_SELECTION = 6, ModeFlag_ALL = 7, ModeFlag_MIN = ModeFlag_NONE, ModeFlag_MAX = ModeFlag_ALL }; inline ModeFlag (&EnumValuesModeFlag())[8] { static ModeFlag values[] = { ModeFlag_NONE, ModeFlag_ANNOTATION, ModeFlag_CLASSIFICATION, ModeFlag_ANNOTATION_AND_CLASSIFICATION, ModeFlag_SELECTION, ModeFlag_ANNOTATION_AND_SELECTION, ModeFlag_CLASSIFICATION_AND_SELECTION, ModeFlag_ALL }; return values; } inline const char **EnumNamesModeFlag() { static const char *names[] = { "NONE", "ANNOTATION", "CLASSIFICATION", "ANNOTATION_AND_CLASSIFICATION", "SELECTION", "ANNOTATION_AND_SELECTION", "CLASSIFICATION_AND_SELECTION", "ALL", nullptr }; return names; } inline const char *EnumNameModeFlag(ModeFlag e) { const size_t index = static_cast
(e); return EnumNamesModeFlag()[index]; } enum DatetimeExtractorType { DatetimeExtractorType_UNKNOWN_DATETIME_EXTRACTOR_TYPE = 0, DatetimeExtractorType_AM = 1, DatetimeExtractorType_PM = 2, DatetimeExtractorType_JANUARY = 3, DatetimeExtractorType_FEBRUARY = 4, DatetimeExtractorType_MARCH = 5, DatetimeExtractorType_APRIL = 6, DatetimeExtractorType_MAY = 7, DatetimeExtractorType_JUNE = 8, DatetimeExtractorType_JULY = 9, DatetimeExtractorType_AUGUST = 10, DatetimeExtractorType_SEPTEMBER = 11, DatetimeExtractorType_OCTOBER = 12, DatetimeExtractorType_NOVEMBER = 13, DatetimeExtractorType_DECEMBER = 14, DatetimeExtractorType_NEXT = 15, DatetimeExtractorType_NEXT_OR_SAME = 16, DatetimeExtractorType_LAST = 17, DatetimeExtractorType_NOW = 18, DatetimeExtractorType_TOMORROW = 19, DatetimeExtractorType_YESTERDAY = 20, DatetimeExtractorType_PAST = 21, DatetimeExtractorType_FUTURE = 22, DatetimeExtractorType_DAY = 23, DatetimeExtractorType_WEEK = 24, DatetimeExtractorType_MONTH = 25, DatetimeExtractorType_YEAR = 26, DatetimeExtractorType_MONDAY = 27, DatetimeExtractorType_TUESDAY = 28, DatetimeExtractorType_WEDNESDAY = 29, DatetimeExtractorType_THURSDAY = 30, DatetimeExtractorType_FRIDAY = 31, DatetimeExtractorType_SATURDAY = 32, DatetimeExtractorType_SUNDAY = 33, DatetimeExtractorType_DAYS = 34, DatetimeExtractorType_WEEKS = 35, DatetimeExtractorType_MONTHS = 36, DatetimeExtractorType_HOURS = 37, DatetimeExtractorType_MINUTES = 38, DatetimeExtractorType_SECONDS = 39, DatetimeExtractorType_YEARS = 40, DatetimeExtractorType_DIGITS = 41, DatetimeExtractorType_SIGNEDDIGITS = 42, DatetimeExtractorType_ZERO = 43, DatetimeExtractorType_ONE = 44, DatetimeExtractorType_TWO = 45, DatetimeExtractorType_THREE = 46, DatetimeExtractorType_FOUR = 47, DatetimeExtractorType_FIVE = 48, DatetimeExtractorType_SIX = 49, DatetimeExtractorType_SEVEN = 50, DatetimeExtractorType_EIGHT = 51, DatetimeExtractorType_NINE = 52, DatetimeExtractorType_TEN = 53, DatetimeExtractorType_ELEVEN = 54, DatetimeExtractorType_TWELVE = 55, DatetimeExtractorType_THIRTEEN = 56, DatetimeExtractorType_FOURTEEN = 57, DatetimeExtractorType_FIFTEEN = 58, DatetimeExtractorType_SIXTEEN = 59, DatetimeExtractorType_SEVENTEEN = 60, DatetimeExtractorType_EIGHTEEN = 61, DatetimeExtractorType_NINETEEN = 62, DatetimeExtractorType_TWENTY = 63, DatetimeExtractorType_THIRTY = 64, DatetimeExtractorType_FORTY = 65, DatetimeExtractorType_FIFTY = 66, DatetimeExtractorType_SIXTY = 67, DatetimeExtractorType_SEVENTY = 68, DatetimeExtractorType_EIGHTY = 69, DatetimeExtractorType_NINETY = 70, DatetimeExtractorType_HUNDRED = 71, DatetimeExtractorType_THOUSAND = 72, DatetimeExtractorType_MIN = DatetimeExtractorType_UNKNOWN_DATETIME_EXTRACTOR_TYPE, DatetimeExtractorType_MAX = DatetimeExtractorType_THOUSAND }; inline DatetimeExtractorType (&EnumValuesDatetimeExtractorType())[73] { static DatetimeExtractorType values[] = { DatetimeExtractorType_UNKNOWN_DATETIME_EXTRACTOR_TYPE, DatetimeExtractorType_AM, DatetimeExtractorType_PM, DatetimeExtractorType_JANUARY, DatetimeExtractorType_FEBRUARY, DatetimeExtractorType_MARCH, DatetimeExtractorType_APRIL, DatetimeExtractorType_MAY, DatetimeExtractorType_JUNE, DatetimeExtractorType_JULY, DatetimeExtractorType_AUGUST, DatetimeExtractorType_SEPTEMBER, DatetimeExtractorType_OCTOBER, DatetimeExtractorType_NOVEMBER, DatetimeExtractorType_DECEMBER, DatetimeExtractorType_NEXT, DatetimeExtractorType_NEXT_OR_SAME, DatetimeExtractorType_LAST, DatetimeExtractorType_NOW, DatetimeExtractorType_TOMORROW, DatetimeExtractorType_YESTERDAY, DatetimeExtractorType_PAST, DatetimeExtractorType_FUTURE, DatetimeExtractorType_DAY, DatetimeExtractorType_WEEK, DatetimeExtractorType_MONTH, DatetimeExtractorType_YEAR, DatetimeExtractorType_MONDAY, DatetimeExtractorType_TUESDAY, DatetimeExtractorType_WEDNESDAY, DatetimeExtractorType_THURSDAY, DatetimeExtractorType_FRIDAY, DatetimeExtractorType_SATURDAY, DatetimeExtractorType_SUNDAY, DatetimeExtractorType_DAYS, DatetimeExtractorType_WEEKS, DatetimeExtractorType_MONTHS, DatetimeExtractorType_HOURS, DatetimeExtractorType_MINUTES, DatetimeExtractorType_SECONDS, DatetimeExtractorType_YEARS, DatetimeExtractorType_DIGITS, DatetimeExtractorType_SIGNEDDIGITS, DatetimeExtractorType_ZERO, DatetimeExtractorType_ONE, DatetimeExtractorType_TWO, DatetimeExtractorType_THREE, DatetimeExtractorType_FOUR, DatetimeExtractorType_FIVE, DatetimeExtractorType_SIX, DatetimeExtractorType_SEVEN, DatetimeExtractorType_EIGHT, DatetimeExtractorType_NINE, DatetimeExtractorType_TEN, DatetimeExtractorType_ELEVEN, DatetimeExtractorType_TWELVE, DatetimeExtractorType_THIRTEEN, DatetimeExtractorType_FOURTEEN, DatetimeExtractorType_FIFTEEN, DatetimeExtractorType_SIXTEEN, DatetimeExtractorType_SEVENTEEN, DatetimeExtractorType_EIGHTEEN, DatetimeExtractorType_NINETEEN, DatetimeExtractorType_TWENTY, DatetimeExtractorType_THIRTY, DatetimeExtractorType_FORTY, DatetimeExtractorType_FIFTY, DatetimeExtractorType_SIXTY, DatetimeExtractorType_SEVENTY, DatetimeExtractorType_EIGHTY, DatetimeExtractorType_NINETY, DatetimeExtractorType_HUNDRED, DatetimeExtractorType_THOUSAND }; return values; } inline const char **EnumNamesDatetimeExtractorType() { static const char *names[] = { "UNKNOWN_DATETIME_EXTRACTOR_TYPE", "AM", "PM", "JANUARY", "FEBRUARY", "MARCH", "APRIL", "MAY", "JUNE", "JULY", "AUGUST", "SEPTEMBER", "OCTOBER", "NOVEMBER", "DECEMBER", "NEXT", "NEXT_OR_SAME", "LAST", "NOW", "TOMORROW", "YESTERDAY", "PAST", "FUTURE", "DAY", "WEEK", "MONTH", "YEAR", "MONDAY", "TUESDAY", "WEDNESDAY", "THURSDAY", "FRIDAY", "SATURDAY", "SUNDAY", "DAYS", "WEEKS", "MONTHS", "HOURS", "MINUTES", "SECONDS", "YEARS", "DIGITS", "SIGNEDDIGITS", "ZERO", "ONE", "TWO", "THREE", "FOUR", "FIVE", "SIX", "SEVEN", "EIGHT", "NINE", "TEN", "ELEVEN", "TWELVE", "THIRTEEN", "FOURTEEN", "FIFTEEN", "SIXTEEN", "SEVENTEEN", "EIGHTEEN", "NINETEEN", "TWENTY", "THIRTY", "FORTY", "FIFTY", "SIXTY", "SEVENTY", "EIGHTY", "NINETY", "HUNDRED", "THOUSAND", nullptr }; return names; } inline const char *EnumNameDatetimeExtractorType(DatetimeExtractorType e) { const size_t index = static_cast
(e); return EnumNamesDatetimeExtractorType()[index]; } enum DatetimeGroupType { DatetimeGroupType_GROUP_UNKNOWN = 0, DatetimeGroupType_GROUP_UNUSED = 1, DatetimeGroupType_GROUP_YEAR = 2, DatetimeGroupType_GROUP_MONTH = 3, DatetimeGroupType_GROUP_DAY = 4, DatetimeGroupType_GROUP_HOUR = 5, DatetimeGroupType_GROUP_MINUTE = 6, DatetimeGroupType_GROUP_SECOND = 7, DatetimeGroupType_GROUP_AMPM = 8, DatetimeGroupType_GROUP_RELATIONDISTANCE = 9, DatetimeGroupType_GROUP_RELATION = 10, DatetimeGroupType_GROUP_RELATIONTYPE = 11, DatetimeGroupType_GROUP_DUMMY1 = 12, DatetimeGroupType_GROUP_DUMMY2 = 13, DatetimeGroupType_MIN = DatetimeGroupType_GROUP_UNKNOWN, DatetimeGroupType_MAX = DatetimeGroupType_GROUP_DUMMY2 }; inline DatetimeGroupType (&EnumValuesDatetimeGroupType())[14] { static DatetimeGroupType values[] = { DatetimeGroupType_GROUP_UNKNOWN, DatetimeGroupType_GROUP_UNUSED, DatetimeGroupType_GROUP_YEAR, DatetimeGroupType_GROUP_MONTH, DatetimeGroupType_GROUP_DAY, DatetimeGroupType_GROUP_HOUR, DatetimeGroupType_GROUP_MINUTE, DatetimeGroupType_GROUP_SECOND, DatetimeGroupType_GROUP_AMPM, DatetimeGroupType_GROUP_RELATIONDISTANCE, DatetimeGroupType_GROUP_RELATION, DatetimeGroupType_GROUP_RELATIONTYPE, DatetimeGroupType_GROUP_DUMMY1, DatetimeGroupType_GROUP_DUMMY2 }; return values; } inline const char **EnumNamesDatetimeGroupType() { static const char *names[] = { "GROUP_UNKNOWN", "GROUP_UNUSED", "GROUP_YEAR", "GROUP_MONTH", "GROUP_DAY", "GROUP_HOUR", "GROUP_MINUTE", "GROUP_SECOND", "GROUP_AMPM", "GROUP_RELATIONDISTANCE", "GROUP_RELATION", "GROUP_RELATIONTYPE", "GROUP_DUMMY1", "GROUP_DUMMY2", nullptr }; return names; } inline const char *EnumNameDatetimeGroupType(DatetimeGroupType e) { const size_t index = static_cast
(e); return EnumNamesDatetimeGroupType()[index]; } namespace TokenizationCodepointRange_ { enum Role { Role_DEFAULT_ROLE = 0, Role_SPLIT_BEFORE = 1, Role_SPLIT_AFTER = 2, Role_TOKEN_SEPARATOR = 3, Role_DISCARD_CODEPOINT = 4, Role_WHITESPACE_SEPARATOR = 7, Role_MIN = Role_DEFAULT_ROLE, Role_MAX = Role_WHITESPACE_SEPARATOR }; inline Role (&EnumValuesRole())[6] { static Role values[] = { Role_DEFAULT_ROLE, Role_SPLIT_BEFORE, Role_SPLIT_AFTER, Role_TOKEN_SEPARATOR, Role_DISCARD_CODEPOINT, Role_WHITESPACE_SEPARATOR }; return values; } inline const char **EnumNamesRole() { static const char *names[] = { "DEFAULT_ROLE", "SPLIT_BEFORE", "SPLIT_AFTER", "TOKEN_SEPARATOR", "DISCARD_CODEPOINT", "", "", "WHITESPACE_SEPARATOR", nullptr }; return names; } inline const char *EnumNameRole(Role e) { const size_t index = static_cast
(e); return EnumNamesRole()[index]; } } // namespace TokenizationCodepointRange_ namespace FeatureProcessorOptions_ { enum CenterTokenSelectionMethod { CenterTokenSelectionMethod_DEFAULT_CENTER_TOKEN_METHOD = 0, CenterTokenSelectionMethod_CENTER_TOKEN_FROM_CLICK = 1, CenterTokenSelectionMethod_CENTER_TOKEN_MIDDLE_OF_SELECTION = 2, CenterTokenSelectionMethod_MIN = CenterTokenSelectionMethod_DEFAULT_CENTER_TOKEN_METHOD, CenterTokenSelectionMethod_MAX = CenterTokenSelectionMethod_CENTER_TOKEN_MIDDLE_OF_SELECTION }; inline CenterTokenSelectionMethod (&EnumValuesCenterTokenSelectionMethod())[3] { static CenterTokenSelectionMethod values[] = { CenterTokenSelectionMethod_DEFAULT_CENTER_TOKEN_METHOD, CenterTokenSelectionMethod_CENTER_TOKEN_FROM_CLICK, CenterTokenSelectionMethod_CENTER_TOKEN_MIDDLE_OF_SELECTION }; return values; } inline const char **EnumNamesCenterTokenSelectionMethod() { static const char *names[] = { "DEFAULT_CENTER_TOKEN_METHOD", "CENTER_TOKEN_FROM_CLICK", "CENTER_TOKEN_MIDDLE_OF_SELECTION", nullptr }; return names; } inline const char *EnumNameCenterTokenSelectionMethod(CenterTokenSelectionMethod e) { const size_t index = static_cast
(e); return EnumNamesCenterTokenSelectionMethod()[index]; } enum TokenizationType { TokenizationType_INVALID_TOKENIZATION_TYPE = 0, TokenizationType_INTERNAL_TOKENIZER = 1, TokenizationType_ICU = 2, TokenizationType_MIXED = 3, TokenizationType_MIN = TokenizationType_INVALID_TOKENIZATION_TYPE, TokenizationType_MAX = TokenizationType_MIXED }; inline TokenizationType (&EnumValuesTokenizationType())[4] { static TokenizationType values[] = { TokenizationType_INVALID_TOKENIZATION_TYPE, TokenizationType_INTERNAL_TOKENIZER, TokenizationType_ICU, TokenizationType_MIXED }; return values; } inline const char **EnumNamesTokenizationType() { static const char *names[] = { "INVALID_TOKENIZATION_TYPE", "INTERNAL_TOKENIZER", "ICU", "MIXED", nullptr }; return names; } inline const char *EnumNameTokenizationType(TokenizationType e) { const size_t index = static_cast
(e); return EnumNamesTokenizationType()[index]; } } // namespace FeatureProcessorOptions_ struct CompressedBufferT : public flatbuffers::NativeTable { typedef CompressedBuffer TableType; std::vector
buffer; int32_t uncompressed_size; CompressedBufferT() : uncompressed_size(0) { } }; struct CompressedBuffer FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { typedef CompressedBufferT NativeTableType; enum { VT_BUFFER = 4, VT_UNCOMPRESSED_SIZE = 6 }; const flatbuffers::Vector
*buffer() const { return GetPointer
*>(VT_BUFFER); } int32_t uncompressed_size() const { return GetField
(VT_UNCOMPRESSED_SIZE, 0); } bool Verify(flatbuffers::Verifier &verifier) const { return VerifyTableStart(verifier) && VerifyOffset(verifier, VT_BUFFER) && verifier.Verify(buffer()) && VerifyField
(verifier, VT_UNCOMPRESSED_SIZE) && verifier.EndTable(); } CompressedBufferT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const; void UnPackTo(CompressedBufferT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const; static flatbuffers::Offset
Pack(flatbuffers::FlatBufferBuilder &_fbb, const CompressedBufferT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); }; struct CompressedBufferBuilder { flatbuffers::FlatBufferBuilder &fbb_; flatbuffers::uoffset_t start_; void add_buffer(flatbuffers::Offset
> buffer) { fbb_.AddOffset(CompressedBuffer::VT_BUFFER, buffer); } void add_uncompressed_size(int32_t uncompressed_size) { fbb_.AddElement
(CompressedBuffer::VT_UNCOMPRESSED_SIZE, uncompressed_size, 0); } explicit CompressedBufferBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); } CompressedBufferBuilder &operator=(const CompressedBufferBuilder &); flatbuffers::Offset
Finish() { const auto end = fbb_.EndTable(start_); auto o = flatbuffers::Offset
(end); return o; } }; inline flatbuffers::Offset
CreateCompressedBuffer( flatbuffers::FlatBufferBuilder &_fbb, flatbuffers::Offset
> buffer = 0, int32_t uncompressed_size = 0) { CompressedBufferBuilder builder_(_fbb); builder_.add_uncompressed_size(uncompressed_size); builder_.add_buffer(buffer); return builder_.Finish(); } inline flatbuffers::Offset
CreateCompressedBufferDirect( flatbuffers::FlatBufferBuilder &_fbb, const std::vector
*buffer = nullptr, int32_t uncompressed_size = 0) { return libtextclassifier2::CreateCompressedBuffer( _fbb, buffer ? _fbb.CreateVector
(*buffer) : 0, uncompressed_size); } flatbuffers::Offset
CreateCompressedBuffer(flatbuffers::FlatBufferBuilder &_fbb, const CompressedBufferT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); struct SelectionModelOptionsT : public flatbuffers::NativeTable { typedef SelectionModelOptions TableType; bool strip_unpaired_brackets; int32_t symmetry_context_size; int32_t batch_size; bool always_classify_suggested_selection; SelectionModelOptionsT() : strip_unpaired_brackets(true), symmetry_context_size(0), batch_size(1024), always_classify_suggested_selection(false) { } }; struct SelectionModelOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { typedef SelectionModelOptionsT NativeTableType; enum { VT_STRIP_UNPAIRED_BRACKETS = 4, VT_SYMMETRY_CONTEXT_SIZE = 6, VT_BATCH_SIZE = 8, VT_ALWAYS_CLASSIFY_SUGGESTED_SELECTION = 10 }; bool strip_unpaired_brackets() const { return GetField
(VT_STRIP_UNPAIRED_BRACKETS, 1) != 0; } int32_t symmetry_context_size() const { return GetField
(VT_SYMMETRY_CONTEXT_SIZE, 0); } int32_t batch_size() const { return GetField
(VT_BATCH_SIZE, 1024); } bool always_classify_suggested_selection() const { return GetField
(VT_ALWAYS_CLASSIFY_SUGGESTED_SELECTION, 0) != 0; } bool Verify(flatbuffers::Verifier &verifier) const { return VerifyTableStart(verifier) && VerifyField
(verifier, VT_STRIP_UNPAIRED_BRACKETS) && VerifyField
(verifier, VT_SYMMETRY_CONTEXT_SIZE) && VerifyField
(verifier, VT_BATCH_SIZE) && VerifyField
(verifier, VT_ALWAYS_CLASSIFY_SUGGESTED_SELECTION) && verifier.EndTable(); } SelectionModelOptionsT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const; void UnPackTo(SelectionModelOptionsT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const; static flatbuffers::Offset
Pack(flatbuffers::FlatBufferBuilder &_fbb, const SelectionModelOptionsT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); }; struct SelectionModelOptionsBuilder { flatbuffers::FlatBufferBuilder &fbb_; flatbuffers::uoffset_t start_; void add_strip_unpaired_brackets(bool strip_unpaired_brackets) { fbb_.AddElement
(SelectionModelOptions::VT_STRIP_UNPAIRED_BRACKETS, static_cast
(strip_unpaired_brackets), 1); } void add_symmetry_context_size(int32_t symmetry_context_size) { fbb_.AddElement
(SelectionModelOptions::VT_SYMMETRY_CONTEXT_SIZE, symmetry_context_size, 0); } void add_batch_size(int32_t batch_size) { fbb_.AddElement
(SelectionModelOptions::VT_BATCH_SIZE, batch_size, 1024); } void add_always_classify_suggested_selection(bool always_classify_suggested_selection) { fbb_.AddElement
(SelectionModelOptions::VT_ALWAYS_CLASSIFY_SUGGESTED_SELECTION, static_cast
(always_classify_suggested_selection), 0); } explicit SelectionModelOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); } SelectionModelOptionsBuilder &operator=(const SelectionModelOptionsBuilder &); flatbuffers::Offset
Finish() { const auto end = fbb_.EndTable(start_); auto o = flatbuffers::Offset
(end); return o; } }; inline flatbuffers::Offset
CreateSelectionModelOptions( flatbuffers::FlatBufferBuilder &_fbb, bool strip_unpaired_brackets = true, int32_t symmetry_context_size = 0, int32_t batch_size = 1024, bool always_classify_suggested_selection = false) { SelectionModelOptionsBuilder builder_(_fbb); builder_.add_batch_size(batch_size); builder_.add_symmetry_context_size(symmetry_context_size); builder_.add_always_classify_suggested_selection(always_classify_suggested_selection); builder_.add_strip_unpaired_brackets(strip_unpaired_brackets); return builder_.Finish(); } flatbuffers::Offset
CreateSelectionModelOptions(flatbuffers::FlatBufferBuilder &_fbb, const SelectionModelOptionsT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); struct ClassificationModelOptionsT : public flatbuffers::NativeTable { typedef ClassificationModelOptions TableType; int32_t phone_min_num_digits; int32_t phone_max_num_digits; int32_t address_min_num_tokens; int32_t max_num_tokens; ClassificationModelOptionsT() : phone_min_num_digits(7), phone_max_num_digits(15), address_min_num_tokens(0), max_num_tokens(-1) { } }; struct ClassificationModelOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { typedef ClassificationModelOptionsT NativeTableType; enum { VT_PHONE_MIN_NUM_DIGITS = 4, VT_PHONE_MAX_NUM_DIGITS = 6, VT_ADDRESS_MIN_NUM_TOKENS = 8, VT_MAX_NUM_TOKENS = 10 }; int32_t phone_min_num_digits() const { return GetField
(VT_PHONE_MIN_NUM_DIGITS, 7); } int32_t phone_max_num_digits() const { return GetField
(VT_PHONE_MAX_NUM_DIGITS, 15); } int32_t address_min_num_tokens() const { return GetField
(VT_ADDRESS_MIN_NUM_TOKENS, 0); } int32_t max_num_tokens() const { return GetField
(VT_MAX_NUM_TOKENS, -1); } bool Verify(flatbuffers::Verifier &verifier) const { return VerifyTableStart(verifier) && VerifyField
(verifier, VT_PHONE_MIN_NUM_DIGITS) && VerifyField
(verifier, VT_PHONE_MAX_NUM_DIGITS) && VerifyField
(verifier, VT_ADDRESS_MIN_NUM_TOKENS) && VerifyField
(verifier, VT_MAX_NUM_TOKENS) && verifier.EndTable(); } ClassificationModelOptionsT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const; void UnPackTo(ClassificationModelOptionsT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const; static flatbuffers::Offset
Pack(flatbuffers::FlatBufferBuilder &_fbb, const ClassificationModelOptionsT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); }; struct ClassificationModelOptionsBuilder { flatbuffers::FlatBufferBuilder &fbb_; flatbuffers::uoffset_t start_; void add_phone_min_num_digits(int32_t phone_min_num_digits) { fbb_.AddElement
(ClassificationModelOptions::VT_PHONE_MIN_NUM_DIGITS, phone_min_num_digits, 7); } void add_phone_max_num_digits(int32_t phone_max_num_digits) { fbb_.AddElement
(ClassificationModelOptions::VT_PHONE_MAX_NUM_DIGITS, phone_max_num_digits, 15); } void add_address_min_num_tokens(int32_t address_min_num_tokens) { fbb_.AddElement
(ClassificationModelOptions::VT_ADDRESS_MIN_NUM_TOKENS, address_min_num_tokens, 0); } void add_max_num_tokens(int32_t max_num_tokens) { fbb_.AddElement
(ClassificationModelOptions::VT_MAX_NUM_TOKENS, max_num_tokens, -1); } explicit ClassificationModelOptionsBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); } ClassificationModelOptionsBuilder &operator=(const ClassificationModelOptionsBuilder &); flatbuffers::Offset
Finish() { const auto end = fbb_.EndTable(start_); auto o = flatbuffers::Offset
(end); return o; } }; inline flatbuffers::Offset
CreateClassificationModelOptions( flatbuffers::FlatBufferBuilder &_fbb, int32_t phone_min_num_digits = 7, int32_t phone_max_num_digits = 15, int32_t address_min_num_tokens = 0, int32_t max_num_tokens = -1) { ClassificationModelOptionsBuilder builder_(_fbb); builder_.add_max_num_tokens(max_num_tokens); builder_.add_address_min_num_tokens(address_min_num_tokens); builder_.add_phone_max_num_digits(phone_max_num_digits); builder_.add_phone_min_num_digits(phone_min_num_digits); return builder_.Finish(); } flatbuffers::Offset
CreateClassificationModelOptions(flatbuffers::FlatBufferBuilder &_fbb, const ClassificationModelOptionsT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); namespace RegexModel_ { struct PatternT : public flatbuffers::NativeTable { typedef Pattern TableType; std::string collection_name; std::string pattern; libtextclassifier2::ModeFlag enabled_modes; float target_classification_score; float priority_score; bool use_approximate_matching; std::unique_ptr
compressed_pattern; PatternT() : enabled_modes(libtextclassifier2::ModeFlag_ALL), target_classification_score(1.0f), priority_score(0.0f), use_approximate_matching(false) { } }; struct Pattern FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { typedef PatternT NativeTableType; enum { VT_COLLECTION_NAME = 4, VT_PATTERN = 6, VT_ENABLED_MODES = 8, VT_TARGET_CLASSIFICATION_SCORE = 10, VT_PRIORITY_SCORE = 12, VT_USE_APPROXIMATE_MATCHING = 14, VT_COMPRESSED_PATTERN = 16 }; const flatbuffers::String *collection_name() const { return GetPointer
(VT_COLLECTION_NAME); } const flatbuffers::String *pattern() const { return GetPointer
(VT_PATTERN); } libtextclassifier2::ModeFlag enabled_modes() const { return static_cast
(GetField
(VT_ENABLED_MODES, 7)); } float target_classification_score() const { return GetField
(VT_TARGET_CLASSIFICATION_SCORE, 1.0f); } float priority_score() const { return GetField
(VT_PRIORITY_SCORE, 0.0f); } bool use_approximate_matching() const { return GetField
(VT_USE_APPROXIMATE_MATCHING, 0) != 0; } const libtextclassifier2::CompressedBuffer *compressed_pattern() const { return GetPointer
(VT_COMPRESSED_PATTERN); } bool Verify(flatbuffers::Verifier &verifier) const { return VerifyTableStart(verifier) && VerifyOffset(verifier, VT_COLLECTION_NAME) && verifier.Verify(collection_name()) && VerifyOffset(verifier, VT_PATTERN) && verifier.Verify(pattern()) && VerifyField
(verifier, VT_ENABLED_MODES) && VerifyField
(verifier, VT_TARGET_CLASSIFICATION_SCORE) && VerifyField
(verifier, VT_PRIORITY_SCORE) && VerifyField
(verifier, VT_USE_APPROXIMATE_MATCHING) && VerifyOffset(verifier, VT_COMPRESSED_PATTERN) && verifier.VerifyTable(compressed_pattern()) && verifier.EndTable(); } PatternT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const; void UnPackTo(PatternT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const; static flatbuffers::Offset
Pack(flatbuffers::FlatBufferBuilder &_fbb, const PatternT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); }; struct PatternBuilder { flatbuffers::FlatBufferBuilder &fbb_; flatbuffers::uoffset_t start_; void add_collection_name(flatbuffers::Offset
collection_name) { fbb_.AddOffset(Pattern::VT_COLLECTION_NAME, collection_name); } void add_pattern(flatbuffers::Offset
pattern) { fbb_.AddOffset(Pattern::VT_PATTERN, pattern); } void add_enabled_modes(libtextclassifier2::ModeFlag enabled_modes) { fbb_.AddElement
(Pattern::VT_ENABLED_MODES, static_cast
(enabled_modes), 7); } void add_target_classification_score(float target_classification_score) { fbb_.AddElement
(Pattern::VT_TARGET_CLASSIFICATION_SCORE, target_classification_score, 1.0f); } void add_priority_score(float priority_score) { fbb_.AddElement
(Pattern::VT_PRIORITY_SCORE, priority_score, 0.0f); } void add_use_approximate_matching(bool use_approximate_matching) { fbb_.AddElement
(Pattern::VT_USE_APPROXIMATE_MATCHING, static_cast
(use_approximate_matching), 0); } void add_compressed_pattern(flatbuffers::Offset
compressed_pattern) { fbb_.AddOffset(Pattern::VT_COMPRESSED_PATTERN, compressed_pattern); } explicit PatternBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); } PatternBuilder &operator=(const PatternBuilder &); flatbuffers::Offset
Finish() { const auto end = fbb_.EndTable(start_); auto o = flatbuffers::Offset
(end); return o; } }; inline flatbuffers::Offset
CreatePattern( flatbuffers::FlatBufferBuilder &_fbb, flatbuffers::Offset
collection_name = 0, flatbuffers::Offset
pattern = 0, libtextclassifier2::ModeFlag enabled_modes = libtextclassifier2::ModeFlag_ALL, float target_classification_score = 1.0f, float priority_score = 0.0f, bool use_approximate_matching = false, flatbuffers::Offset
compressed_pattern = 0) { PatternBuilder builder_(_fbb); builder_.add_compressed_pattern(compressed_pattern); builder_.add_priority_score(priority_score); builder_.add_target_classification_score(target_classification_score); builder_.add_enabled_modes(enabled_modes); builder_.add_pattern(pattern); builder_.add_collection_name(collection_name); builder_.add_use_approximate_matching(use_approximate_matching); return builder_.Finish(); } inline flatbuffers::Offset
CreatePatternDirect( flatbuffers::FlatBufferBuilder &_fbb, const char *collection_name = nullptr, const char *pattern = nullptr, libtextclassifier2::ModeFlag enabled_modes = libtextclassifier2::ModeFlag_ALL, float target_classification_score = 1.0f, float priority_score = 0.0f, bool use_approximate_matching = false, flatbuffers::Offset
compressed_pattern = 0) { return libtextclassifier2::RegexModel_::CreatePattern( _fbb, collection_name ? _fbb.CreateString(collection_name) : 0, pattern ? _fbb.CreateString(pattern) : 0, enabled_modes, target_classification_score, priority_score, use_approximate_matching, compressed_pattern); } flatbuffers::Offset
CreatePattern(flatbuffers::FlatBufferBuilder &_fbb, const PatternT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); } // namespace RegexModel_ struct RegexModelT : public flatbuffers::NativeTable { typedef RegexModel TableType; std::vector
> patterns; RegexModelT() { } }; struct RegexModel FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { typedef RegexModelT NativeTableType; enum { VT_PATTERNS = 4 }; const flatbuffers::Vector
> *patterns() const { return GetPointer
> *>(VT_PATTERNS); } bool Verify(flatbuffers::Verifier &verifier) const { return VerifyTableStart(verifier) && VerifyOffset(verifier, VT_PATTERNS) && verifier.Verify(patterns()) && verifier.VerifyVectorOfTables(patterns()) && verifier.EndTable(); } RegexModelT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const; void UnPackTo(RegexModelT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const; static flatbuffers::Offset
Pack(flatbuffers::FlatBufferBuilder &_fbb, const RegexModelT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); }; struct RegexModelBuilder { flatbuffers::FlatBufferBuilder &fbb_; flatbuffers::uoffset_t start_; void add_patterns(flatbuffers::Offset
>> patterns) { fbb_.AddOffset(RegexModel::VT_PATTERNS, patterns); } explicit RegexModelBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); } RegexModelBuilder &operator=(const RegexModelBuilder &); flatbuffers::Offset
Finish() { const auto end = fbb_.EndTable(start_); auto o = flatbuffers::Offset
(end); return o; } }; inline flatbuffers::Offset
CreateRegexModel( flatbuffers::FlatBufferBuilder &_fbb, flatbuffers::Offset
>> patterns = 0) { RegexModelBuilder builder_(_fbb); builder_.add_patterns(patterns); return builder_.Finish(); } inline flatbuffers::Offset
CreateRegexModelDirect( flatbuffers::FlatBufferBuilder &_fbb, const std::vector
> *patterns = nullptr) { return libtextclassifier2::CreateRegexModel( _fbb, patterns ? _fbb.CreateVector
>(*patterns) : 0); } flatbuffers::Offset
CreateRegexModel(flatbuffers::FlatBufferBuilder &_fbb, const RegexModelT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); namespace DatetimeModelPattern_ { struct RegexT : public flatbuffers::NativeTable { typedef Regex TableType; std::string pattern; std::vector
groups; std::unique_ptr
compressed_pattern; RegexT() { } }; struct Regex FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { typedef RegexT NativeTableType; enum { VT_PATTERN = 4, VT_GROUPS = 6, VT_COMPRESSED_PATTERN = 8 }; const flatbuffers::String *pattern() const { return GetPointer
(VT_PATTERN); } const flatbuffers::Vector
*groups() const { return GetPointer
*>(VT_GROUPS); } const libtextclassifier2::CompressedBuffer *compressed_pattern() const { return GetPointer
(VT_COMPRESSED_PATTERN); } bool Verify(flatbuffers::Verifier &verifier) const { return VerifyTableStart(verifier) && VerifyOffset(verifier, VT_PATTERN) && verifier.Verify(pattern()) && VerifyOffset(verifier, VT_GROUPS) && verifier.Verify(groups()) && VerifyOffset(verifier, VT_COMPRESSED_PATTERN) && verifier.VerifyTable(compressed_pattern()) && verifier.EndTable(); } RegexT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const; void UnPackTo(RegexT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const; static flatbuffers::Offset
Pack(flatbuffers::FlatBufferBuilder &_fbb, const RegexT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); }; struct RegexBuilder { flatbuffers::FlatBufferBuilder &fbb_; flatbuffers::uoffset_t start_; void add_pattern(flatbuffers::Offset
pattern) { fbb_.AddOffset(Regex::VT_PATTERN, pattern); } void add_groups(flatbuffers::Offset
> groups) { fbb_.AddOffset(Regex::VT_GROUPS, groups); } void add_compressed_pattern(flatbuffers::Offset
compressed_pattern) { fbb_.AddOffset(Regex::VT_COMPRESSED_PATTERN, compressed_pattern); } explicit RegexBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); } RegexBuilder &operator=(const RegexBuilder &); flatbuffers::Offset
Finish() { const auto end = fbb_.EndTable(start_); auto o = flatbuffers::Offset
(end); return o; } }; inline flatbuffers::Offset
CreateRegex( flatbuffers::FlatBufferBuilder &_fbb, flatbuffers::Offset
pattern = 0, flatbuffers::Offset
> groups = 0, flatbuffers::Offset
compressed_pattern = 0) { RegexBuilder builder_(_fbb); builder_.add_compressed_pattern(compressed_pattern); builder_.add_groups(groups); builder_.add_pattern(pattern); return builder_.Finish(); } inline flatbuffers::Offset
CreateRegexDirect( flatbuffers::FlatBufferBuilder &_fbb, const char *pattern = nullptr, const std::vector
*groups = nullptr, flatbuffers::Offset
compressed_pattern = 0) { return libtextclassifier2::DatetimeModelPattern_::CreateRegex( _fbb, pattern ? _fbb.CreateString(pattern) : 0, groups ? _fbb.CreateVector
(*groups) : 0, compressed_pattern); } flatbuffers::Offset
CreateRegex(flatbuffers::FlatBufferBuilder &_fbb, const RegexT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); } // namespace DatetimeModelPattern_ struct DatetimeModelPatternT : public flatbuffers::NativeTable { typedef DatetimeModelPattern TableType; std::vector
> regexes; std::vector
locales; float target_classification_score; float priority_score; ModeFlag enabled_modes; DatetimeModelPatternT() : target_classification_score(1.0f), priority_score(0.0f), enabled_modes(ModeFlag_ALL) { } }; struct DatetimeModelPattern FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { typedef DatetimeModelPatternT NativeTableType; enum { VT_REGEXES = 4, VT_LOCALES = 6, VT_TARGET_CLASSIFICATION_SCORE = 8, VT_PRIORITY_SCORE = 10, VT_ENABLED_MODES = 12 }; const flatbuffers::Vector
> *regexes() const { return GetPointer
> *>(VT_REGEXES); } const flatbuffers::Vector
*locales() const { return GetPointer
*>(VT_LOCALES); } float target_classification_score() const { return GetField
(VT_TARGET_CLASSIFICATION_SCORE, 1.0f); } float priority_score() const { return GetField
(VT_PRIORITY_SCORE, 0.0f); } ModeFlag enabled_modes() const { return static_cast
(GetField
(VT_ENABLED_MODES, 7)); } bool Verify(flatbuffers::Verifier &verifier) const { return VerifyTableStart(verifier) && VerifyOffset(verifier, VT_REGEXES) && verifier.Verify(regexes()) && verifier.VerifyVectorOfTables(regexes()) && VerifyOffset(verifier, VT_LOCALES) && verifier.Verify(locales()) && VerifyField
(verifier, VT_TARGET_CLASSIFICATION_SCORE) && VerifyField
(verifier, VT_PRIORITY_SCORE) && VerifyField
(verifier, VT_ENABLED_MODES) && verifier.EndTable(); } DatetimeModelPatternT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const; void UnPackTo(DatetimeModelPatternT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const; static flatbuffers::Offset
Pack(flatbuffers::FlatBufferBuilder &_fbb, const DatetimeModelPatternT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); }; struct DatetimeModelPatternBuilder { flatbuffers::FlatBufferBuilder &fbb_; flatbuffers::uoffset_t start_; void add_regexes(flatbuffers::Offset
>> regexes) { fbb_.AddOffset(DatetimeModelPattern::VT_REGEXES, regexes); } void add_locales(flatbuffers::Offset
> locales) { fbb_.AddOffset(DatetimeModelPattern::VT_LOCALES, locales); } void add_target_classification_score(float target_classification_score) { fbb_.AddElement
(DatetimeModelPattern::VT_TARGET_CLASSIFICATION_SCORE, target_classification_score, 1.0f); } void add_priority_score(float priority_score) { fbb_.AddElement
(DatetimeModelPattern::VT_PRIORITY_SCORE, priority_score, 0.0f); } void add_enabled_modes(ModeFlag enabled_modes) { fbb_.AddElement
(DatetimeModelPattern::VT_ENABLED_MODES, static_cast
(enabled_modes), 7); } explicit DatetimeModelPatternBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); } DatetimeModelPatternBuilder &operator=(const DatetimeModelPatternBuilder &); flatbuffers::Offset
Finish() { const auto end = fbb_.EndTable(start_); auto o = flatbuffers::Offset
(end); return o; } }; inline flatbuffers::Offset
CreateDatetimeModelPattern( flatbuffers::FlatBufferBuilder &_fbb, flatbuffers::Offset
>> regexes = 0, flatbuffers::Offset
> locales = 0, float target_classification_score = 1.0f, float priority_score = 0.0f, ModeFlag enabled_modes = ModeFlag_ALL) { DatetimeModelPatternBuilder builder_(_fbb); builder_.add_enabled_modes(enabled_modes); builder_.add_priority_score(priority_score); builder_.add_target_classification_score(target_classification_score); builder_.add_locales(locales); builder_.add_regexes(regexes); return builder_.Finish(); } inline flatbuffers::Offset
CreateDatetimeModelPatternDirect( flatbuffers::FlatBufferBuilder &_fbb, const std::vector
> *regexes = nullptr, const std::vector
*locales = nullptr, float target_classification_score = 1.0f, float priority_score = 0.0f, ModeFlag enabled_modes = ModeFlag_ALL) { return libtextclassifier2::CreateDatetimeModelPattern( _fbb, regexes ? _fbb.CreateVector
>(*regexes) : 0, locales ? _fbb.CreateVector
(*locales) : 0, target_classification_score, priority_score, enabled_modes); } flatbuffers::Offset
CreateDatetimeModelPattern(flatbuffers::FlatBufferBuilder &_fbb, const DatetimeModelPatternT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); struct DatetimeModelExtractorT : public flatbuffers::NativeTable { typedef DatetimeModelExtractor TableType; DatetimeExtractorType extractor; std::string pattern; std::vector
locales; std::unique_ptr
compressed_pattern; DatetimeModelExtractorT() : extractor(DatetimeExtractorType_UNKNOWN_DATETIME_EXTRACTOR_TYPE) { } }; struct DatetimeModelExtractor FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { typedef DatetimeModelExtractorT NativeTableType; enum { VT_EXTRACTOR = 4, VT_PATTERN = 6, VT_LOCALES = 8, VT_COMPRESSED_PATTERN = 10 }; DatetimeExtractorType extractor() const { return static_cast
(GetField
(VT_EXTRACTOR, 0)); } const flatbuffers::String *pattern() const { return GetPointer
(VT_PATTERN); } const flatbuffers::Vector
*locales() const { return GetPointer
*>(VT_LOCALES); } const CompressedBuffer *compressed_pattern() const { return GetPointer
(VT_COMPRESSED_PATTERN); } bool Verify(flatbuffers::Verifier &verifier) const { return VerifyTableStart(verifier) && VerifyField
(verifier, VT_EXTRACTOR) && VerifyOffset(verifier, VT_PATTERN) && verifier.Verify(pattern()) && VerifyOffset(verifier, VT_LOCALES) && verifier.Verify(locales()) && VerifyOffset(verifier, VT_COMPRESSED_PATTERN) && verifier.VerifyTable(compressed_pattern()) && verifier.EndTable(); } DatetimeModelExtractorT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const; void UnPackTo(DatetimeModelExtractorT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const; static flatbuffers::Offset
Pack(flatbuffers::FlatBufferBuilder &_fbb, const DatetimeModelExtractorT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); }; struct DatetimeModelExtractorBuilder { flatbuffers::FlatBufferBuilder &fbb_; flatbuffers::uoffset_t start_; void add_extractor(DatetimeExtractorType extractor) { fbb_.AddElement
(DatetimeModelExtractor::VT_EXTRACTOR, static_cast
(extractor), 0); } void add_pattern(flatbuffers::Offset
pattern) { fbb_.AddOffset(DatetimeModelExtractor::VT_PATTERN, pattern); } void add_locales(flatbuffers::Offset
> locales) { fbb_.AddOffset(DatetimeModelExtractor::VT_LOCALES, locales); } void add_compressed_pattern(flatbuffers::Offset
compressed_pattern) { fbb_.AddOffset(DatetimeModelExtractor::VT_COMPRESSED_PATTERN, compressed_pattern); } explicit DatetimeModelExtractorBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); } DatetimeModelExtractorBuilder &operator=(const DatetimeModelExtractorBuilder &); flatbuffers::Offset
Finish() { const auto end = fbb_.EndTable(start_); auto o = flatbuffers::Offset
(end); return o; } }; inline flatbuffers::Offset
CreateDatetimeModelExtractor( flatbuffers::FlatBufferBuilder &_fbb, DatetimeExtractorType extractor = DatetimeExtractorType_UNKNOWN_DATETIME_EXTRACTOR_TYPE, flatbuffers::Offset
pattern = 0, flatbuffers::Offset
> locales = 0, flatbuffers::Offset
compressed_pattern = 0) { DatetimeModelExtractorBuilder builder_(_fbb); builder_.add_compressed_pattern(compressed_pattern); builder_.add_locales(locales); builder_.add_pattern(pattern); builder_.add_extractor(extractor); return builder_.Finish(); } inline flatbuffers::Offset
CreateDatetimeModelExtractorDirect( flatbuffers::FlatBufferBuilder &_fbb, DatetimeExtractorType extractor = DatetimeExtractorType_UNKNOWN_DATETIME_EXTRACTOR_TYPE, const char *pattern = nullptr, const std::vector
*locales = nullptr, flatbuffers::Offset
compressed_pattern = 0) { return libtextclassifier2::CreateDatetimeModelExtractor( _fbb, extractor, pattern ? _fbb.CreateString(pattern) : 0, locales ? _fbb.CreateVector
(*locales) : 0, compressed_pattern); } flatbuffers::Offset
CreateDatetimeModelExtractor(flatbuffers::FlatBufferBuilder &_fbb, const DatetimeModelExtractorT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); struct DatetimeModelT : public flatbuffers::NativeTable { typedef DatetimeModel TableType; std::vector
locales; std::vector
> patterns; std::vector
> extractors; bool use_extractors_for_locating; std::vector
default_locales; DatetimeModelT() : use_extractors_for_locating(true) { } }; struct DatetimeModel FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { typedef DatetimeModelT NativeTableType; enum { VT_LOCALES = 4, VT_PATTERNS = 6, VT_EXTRACTORS = 8, VT_USE_EXTRACTORS_FOR_LOCATING = 10, VT_DEFAULT_LOCALES = 12 }; const flatbuffers::Vector
> *locales() const { return GetPointer
> *>(VT_LOCALES); } const flatbuffers::Vector
> *patterns() const { return GetPointer
> *>(VT_PATTERNS); } const flatbuffers::Vector
> *extractors() const { return GetPointer
> *>(VT_EXTRACTORS); } bool use_extractors_for_locating() const { return GetField
(VT_USE_EXTRACTORS_FOR_LOCATING, 1) != 0; } const flatbuffers::Vector
*default_locales() const { return GetPointer
*>(VT_DEFAULT_LOCALES); } bool Verify(flatbuffers::Verifier &verifier) const { return VerifyTableStart(verifier) && VerifyOffset(verifier, VT_LOCALES) && verifier.Verify(locales()) && verifier.VerifyVectorOfStrings(locales()) && VerifyOffset(verifier, VT_PATTERNS) && verifier.Verify(patterns()) && verifier.VerifyVectorOfTables(patterns()) && VerifyOffset(verifier, VT_EXTRACTORS) && verifier.Verify(extractors()) && verifier.VerifyVectorOfTables(extractors()) && VerifyField
(verifier, VT_USE_EXTRACTORS_FOR_LOCATING) && VerifyOffset(verifier, VT_DEFAULT_LOCALES) && verifier.Verify(default_locales()) && verifier.EndTable(); } DatetimeModelT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const; void UnPackTo(DatetimeModelT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const; static flatbuffers::Offset
Pack(flatbuffers::FlatBufferBuilder &_fbb, const DatetimeModelT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); }; struct DatetimeModelBuilder { flatbuffers::FlatBufferBuilder &fbb_; flatbuffers::uoffset_t start_; void add_locales(flatbuffers::Offset
>> locales) { fbb_.AddOffset(DatetimeModel::VT_LOCALES, locales); } void add_patterns(flatbuffers::Offset
>> patterns) { fbb_.AddOffset(DatetimeModel::VT_PATTERNS, patterns); } void add_extractors(flatbuffers::Offset
>> extractors) { fbb_.AddOffset(DatetimeModel::VT_EXTRACTORS, extractors); } void add_use_extractors_for_locating(bool use_extractors_for_locating) { fbb_.AddElement
(DatetimeModel::VT_USE_EXTRACTORS_FOR_LOCATING, static_cast
(use_extractors_for_locating), 1); } void add_default_locales(flatbuffers::Offset
> default_locales) { fbb_.AddOffset(DatetimeModel::VT_DEFAULT_LOCALES, default_locales); } explicit DatetimeModelBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); } DatetimeModelBuilder &operator=(const DatetimeModelBuilder &); flatbuffers::Offset
Finish() { const auto end = fbb_.EndTable(start_); auto o = flatbuffers::Offset
(end); return o; } }; inline flatbuffers::Offset
CreateDatetimeModel( flatbuffers::FlatBufferBuilder &_fbb, flatbuffers::Offset
>> locales = 0, flatbuffers::Offset
>> patterns = 0, flatbuffers::Offset
>> extractors = 0, bool use_extractors_for_locating = true, flatbuffers::Offset
> default_locales = 0) { DatetimeModelBuilder builder_(_fbb); builder_.add_default_locales(default_locales); builder_.add_extractors(extractors); builder_.add_patterns(patterns); builder_.add_locales(locales); builder_.add_use_extractors_for_locating(use_extractors_for_locating); return builder_.Finish(); } inline flatbuffers::Offset
CreateDatetimeModelDirect( flatbuffers::FlatBufferBuilder &_fbb, const std::vector
> *locales = nullptr, const std::vector
> *patterns = nullptr, const std::vector
> *extractors = nullptr, bool use_extractors_for_locating = true, const std::vector
*default_locales = nullptr) { return libtextclassifier2::CreateDatetimeModel( _fbb, locales ? _fbb.CreateVector
>(*locales) : 0, patterns ? _fbb.CreateVector
>(*patterns) : 0, extractors ? _fbb.CreateVector
>(*extractors) : 0, use_extractors_for_locating, default_locales ? _fbb.CreateVector
(*default_locales) : 0); } flatbuffers::Offset
CreateDatetimeModel(flatbuffers::FlatBufferBuilder &_fbb, const DatetimeModelT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); namespace DatetimeModelLibrary_ { struct ItemT : public flatbuffers::NativeTable { typedef Item TableType; std::string key; std::unique_ptr
value; ItemT() { } }; struct Item FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { typedef ItemT NativeTableType; enum { VT_KEY = 4, VT_VALUE = 6 }; const flatbuffers::String *key() const { return GetPointer
(VT_KEY); } const libtextclassifier2::DatetimeModel *value() const { return GetPointer
(VT_VALUE); } bool Verify(flatbuffers::Verifier &verifier) const { return VerifyTableStart(verifier) && VerifyOffset(verifier, VT_KEY) && verifier.Verify(key()) && VerifyOffset(verifier, VT_VALUE) && verifier.VerifyTable(value()) && verifier.EndTable(); } ItemT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const; void UnPackTo(ItemT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const; static flatbuffers::Offset
Pack(flatbuffers::FlatBufferBuilder &_fbb, const ItemT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); }; struct ItemBuilder { flatbuffers::FlatBufferBuilder &fbb_; flatbuffers::uoffset_t start_; void add_key(flatbuffers::Offset
key) { fbb_.AddOffset(Item::VT_KEY, key); } void add_value(flatbuffers::Offset
value) { fbb_.AddOffset(Item::VT_VALUE, value); } explicit ItemBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); } ItemBuilder &operator=(const ItemBuilder &); flatbuffers::Offset
Finish() { const auto end = fbb_.EndTable(start_); auto o = flatbuffers::Offset
(end); return o; } }; inline flatbuffers::Offset
CreateItem( flatbuffers::FlatBufferBuilder &_fbb, flatbuffers::Offset
key = 0, flatbuffers::Offset
value = 0) { ItemBuilder builder_(_fbb); builder_.add_value(value); builder_.add_key(key); return builder_.Finish(); } inline flatbuffers::Offset
CreateItemDirect( flatbuffers::FlatBufferBuilder &_fbb, const char *key = nullptr, flatbuffers::Offset
value = 0) { return libtextclassifier2::DatetimeModelLibrary_::CreateItem( _fbb, key ? _fbb.CreateString(key) : 0, value); } flatbuffers::Offset
CreateItem(flatbuffers::FlatBufferBuilder &_fbb, const ItemT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); } // namespace DatetimeModelLibrary_ struct DatetimeModelLibraryT : public flatbuffers::NativeTable { typedef DatetimeModelLibrary TableType; std::vector
> models; DatetimeModelLibraryT() { } }; struct DatetimeModelLibrary FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { typedef DatetimeModelLibraryT NativeTableType; enum { VT_MODELS = 4 }; const flatbuffers::Vector
> *models() const { return GetPointer
> *>(VT_MODELS); } bool Verify(flatbuffers::Verifier &verifier) const { return VerifyTableStart(verifier) && VerifyOffset(verifier, VT_MODELS) && verifier.Verify(models()) && verifier.VerifyVectorOfTables(models()) && verifier.EndTable(); } DatetimeModelLibraryT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const; void UnPackTo(DatetimeModelLibraryT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const; static flatbuffers::Offset
Pack(flatbuffers::FlatBufferBuilder &_fbb, const DatetimeModelLibraryT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); }; struct DatetimeModelLibraryBuilder { flatbuffers::FlatBufferBuilder &fbb_; flatbuffers::uoffset_t start_; void add_models(flatbuffers::Offset
>> models) { fbb_.AddOffset(DatetimeModelLibrary::VT_MODELS, models); } explicit DatetimeModelLibraryBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); } DatetimeModelLibraryBuilder &operator=(const DatetimeModelLibraryBuilder &); flatbuffers::Offset
Finish() { const auto end = fbb_.EndTable(start_); auto o = flatbuffers::Offset
(end); return o; } }; inline flatbuffers::Offset
CreateDatetimeModelLibrary( flatbuffers::FlatBufferBuilder &_fbb, flatbuffers::Offset
>> models = 0) { DatetimeModelLibraryBuilder builder_(_fbb); builder_.add_models(models); return builder_.Finish(); } inline flatbuffers::Offset
CreateDatetimeModelLibraryDirect( flatbuffers::FlatBufferBuilder &_fbb, const std::vector
> *models = nullptr) { return libtextclassifier2::CreateDatetimeModelLibrary( _fbb, models ? _fbb.CreateVector
>(*models) : 0); } flatbuffers::Offset
CreateDatetimeModelLibrary(flatbuffers::FlatBufferBuilder &_fbb, const DatetimeModelLibraryT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); struct ModelTriggeringOptionsT : public flatbuffers::NativeTable { typedef ModelTriggeringOptions TableType; float min_annotate_confidence; ModeFlag enabled_modes; ModelTriggeringOptionsT() : min_annotate_confidence(0.0f), enabled_modes(ModeFlag_ALL) { } }; struct ModelTriggeringOptions FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { typedef ModelTriggeringOptionsT NativeTableType; enum { VT_MIN_ANNOTATE_CONFIDENCE = 4, VT_ENABLED_MODES = 6 }; float min_annotate_confidence() const { return GetField
(VT_MIN_ANNOTATE_CONFIDENCE, 0.0f); } ModeFlag enabled_modes() const { return static_cast
(GetField
(VT_ENABLED_MODES, 7)); } bool Verify(flatbuffers::Verifier &verifier) const { return VerifyTableStart(verifier) && VerifyField
(verifier, VT_MIN_ANNOTATE_CONFIDENCE) && VerifyField
(verifier, VT_ENABLED_MODES) && verifier.EndTable(); } ModelTriggeringOptionsT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const; void UnPackTo(ModelTriggeringOptionsT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const; static flatbuffers::Offset
Pack(flatbuffers::FlatBufferBuilder &_fbb, const ModelTriggeringOptionsT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); }; struct ModelTriggeringOptionsBuilder { flatbuffers::FlatBufferBuilder &fbb_; flatbuffers::uoffset_t start_; void add_min_annotate_confidence(float min_annotate_confidence) { fbb_.AddElement
(ModelTriggeringOptions::VT_MIN_ANNOTATE_CONFIDENCE, min_annotate_confidence, 0.0f); } void add_enabled_modes(ModeFlag enabled_modes) { fbb_.AddElement