| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188 |
- // DO NOT EDIT.
- //
- // Generated by the Swift generator plugin for the protocol buffer compiler.
- // Source: google/cloud/language/v1/language_service.proto
- //
- // For information on using the generated types, please see the documentation:
- // https://github.com/apple/swift-protobuf/
- // Copyright 2019 Google LLC.
- //
- // 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.
- import Foundation
- import SwiftProtobuf
- // If the compiler emits an error on this type, it is because this file
- // was generated by a version of the `protoc` Swift plug-in that is
- // incompatible with the version of SwiftProtobuf to which you are linking.
- // Please ensure that your are building against the same version of the API
- // that was used to generate this file.
- fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck {
- struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {}
- typealias Version = _2
- }
- /// Represents the text encoding that the caller uses to process the output.
- /// Providing an `EncodingType` is recommended because the API provides the
- /// beginning offsets for various outputs, such as tokens and mentions, and
- /// languages that natively use different text encodings may access offsets
- /// differently.
- enum Google_Cloud_Language_V1_EncodingType: SwiftProtobuf.Enum {
- typealias RawValue = Int
- /// If `EncodingType` is not specified, encoding-dependent information (such as
- /// `begin_offset`) will be set at `-1`.
- case none // = 0
- /// Encoding-dependent information (such as `begin_offset`) is calculated based
- /// on the UTF-8 encoding of the input. C++ and Go are examples of languages
- /// that use this encoding natively.
- case utf8 // = 1
- /// Encoding-dependent information (such as `begin_offset`) is calculated based
- /// on the UTF-16 encoding of the input. Java and JavaScript are examples of
- /// languages that use this encoding natively.
- case utf16 // = 2
- /// Encoding-dependent information (such as `begin_offset`) is calculated based
- /// on the UTF-32 encoding of the input. Python is an example of a language
- /// that uses this encoding natively.
- case utf32 // = 3
- case UNRECOGNIZED(Int)
- init() {
- self = .none
- }
- init?(rawValue: Int) {
- switch rawValue {
- case 0: self = .none
- case 1: self = .utf8
- case 2: self = .utf16
- case 3: self = .utf32
- default: self = .UNRECOGNIZED(rawValue)
- }
- }
- var rawValue: Int {
- switch self {
- case .none: return 0
- case .utf8: return 1
- case .utf16: return 2
- case .utf32: return 3
- case .UNRECOGNIZED(let i): return i
- }
- }
- }
- #if swift(>=4.2)
- extension Google_Cloud_Language_V1_EncodingType: CaseIterable {
- // The compiler won't synthesize support with the UNRECOGNIZED case.
- static var allCases: [Google_Cloud_Language_V1_EncodingType] = [
- .none,
- .utf8,
- .utf16,
- .utf32,
- ]
- }
- #endif // swift(>=4.2)
- /// ################################################################ #
- ///
- /// Represents the input to API methods.
- struct Google_Cloud_Language_V1_Document {
- // SwiftProtobuf.Message conformance is added in an extension below. See the
- // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
- // methods supported on all messages.
- /// Required. If the type is not set or is `TYPE_UNSPECIFIED`,
- /// returns an `INVALID_ARGUMENT` error.
- var type: Google_Cloud_Language_V1_Document.TypeEnum = .unspecified
- /// The source of the document: a string containing the content or a
- /// Google Cloud Storage URI.
- var source: Google_Cloud_Language_V1_Document.OneOf_Source? = nil
- /// The content of the input in string format.
- /// Cloud audit logging exempt since it is based on user data.
- var content: String {
- get {
- if case .content(let v)? = source {return v}
- return String()
- }
- set {source = .content(newValue)}
- }
- /// The Google Cloud Storage URI where the file content is located.
- /// This URI must be of the form: gs://bucket_name/object_name. For more
- /// details, see https://cloud.google.com/storage/docs/reference-uris.
- /// NOTE: Cloud Storage object versioning is not supported.
- var gcsContentUri: String {
- get {
- if case .gcsContentUri(let v)? = source {return v}
- return String()
- }
- set {source = .gcsContentUri(newValue)}
- }
- /// The language of the document (if not specified, the language is
- /// automatically detected). Both ISO and BCP-47 language codes are
- /// accepted.<br>
- /// [Language Support](/natural-language/docs/languages)
- /// lists currently supported languages for each API method.
- /// If the language (either specified by the caller or automatically detected)
- /// is not supported by the called API method, an `INVALID_ARGUMENT` error
- /// is returned.
- var language: String = String()
- var unknownFields = SwiftProtobuf.UnknownStorage()
- /// The source of the document: a string containing the content or a
- /// Google Cloud Storage URI.
- enum OneOf_Source: Equatable {
- /// The content of the input in string format.
- /// Cloud audit logging exempt since it is based on user data.
- case content(String)
- /// The Google Cloud Storage URI where the file content is located.
- /// This URI must be of the form: gs://bucket_name/object_name. For more
- /// details, see https://cloud.google.com/storage/docs/reference-uris.
- /// NOTE: Cloud Storage object versioning is not supported.
- case gcsContentUri(String)
- #if !swift(>=4.1)
- static func ==(lhs: Google_Cloud_Language_V1_Document.OneOf_Source, rhs: Google_Cloud_Language_V1_Document.OneOf_Source) -> Bool {
- switch (lhs, rhs) {
- case (.content(let l), .content(let r)): return l == r
- case (.gcsContentUri(let l), .gcsContentUri(let r)): return l == r
- default: return false
- }
- }
- #endif
- }
- /// The document types enum.
- enum TypeEnum: SwiftProtobuf.Enum {
- typealias RawValue = Int
- /// The content type is not specified.
- case unspecified // = 0
- /// Plain text
- case plainText // = 1
- /// HTML
- case html // = 2
- case UNRECOGNIZED(Int)
- init() {
- self = .unspecified
- }
- init?(rawValue: Int) {
- switch rawValue {
- case 0: self = .unspecified
- case 1: self = .plainText
- case 2: self = .html
- default: self = .UNRECOGNIZED(rawValue)
- }
- }
- var rawValue: Int {
- switch self {
- case .unspecified: return 0
- case .plainText: return 1
- case .html: return 2
- case .UNRECOGNIZED(let i): return i
- }
- }
- }
- init() {}
- }
- #if swift(>=4.2)
- extension Google_Cloud_Language_V1_Document.TypeEnum: CaseIterable {
- // The compiler won't synthesize support with the UNRECOGNIZED case.
- static var allCases: [Google_Cloud_Language_V1_Document.TypeEnum] = [
- .unspecified,
- .plainText,
- .html,
- ]
- }
- #endif // swift(>=4.2)
- /// Represents a sentence in the input document.
- struct Google_Cloud_Language_V1_Sentence {
- // SwiftProtobuf.Message conformance is added in an extension below. See the
- // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
- // methods supported on all messages.
- /// The sentence text.
- var text: Google_Cloud_Language_V1_TextSpan {
- get {return _storage._text ?? Google_Cloud_Language_V1_TextSpan()}
- set {_uniqueStorage()._text = newValue}
- }
- /// Returns true if `text` has been explicitly set.
- var hasText: Bool {return _storage._text != nil}
- /// Clears the value of `text`. Subsequent reads from it will return its default value.
- mutating func clearText() {_uniqueStorage()._text = nil}
- /// For calls to [AnalyzeSentiment][] or if
- /// [AnnotateTextRequest.Features.extract_document_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_document_sentiment] is set to
- /// true, this field will contain the sentiment for the sentence.
- var sentiment: Google_Cloud_Language_V1_Sentiment {
- get {return _storage._sentiment ?? Google_Cloud_Language_V1_Sentiment()}
- set {_uniqueStorage()._sentiment = newValue}
- }
- /// Returns true if `sentiment` has been explicitly set.
- var hasSentiment: Bool {return _storage._sentiment != nil}
- /// Clears the value of `sentiment`. Subsequent reads from it will return its default value.
- mutating func clearSentiment() {_uniqueStorage()._sentiment = nil}
- var unknownFields = SwiftProtobuf.UnknownStorage()
- init() {}
- fileprivate var _storage = _StorageClass.defaultInstance
- }
- /// Represents a phrase in the text that is a known entity, such as
- /// a person, an organization, or location. The API associates information, such
- /// as salience and mentions, with entities.
- struct Google_Cloud_Language_V1_Entity {
- // SwiftProtobuf.Message conformance is added in an extension below. See the
- // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
- // methods supported on all messages.
- /// The representative name for the entity.
- var name: String {
- get {return _storage._name}
- set {_uniqueStorage()._name = newValue}
- }
- /// The entity type.
- var type: Google_Cloud_Language_V1_Entity.TypeEnum {
- get {return _storage._type}
- set {_uniqueStorage()._type = newValue}
- }
- /// Metadata associated with the entity.
- ///
- /// For most entity types, the metadata is a Wikipedia URL (`wikipedia_url`)
- /// and Knowledge Graph MID (`mid`), if they are available. For the metadata
- /// associated with other entity types, see the Type table below.
- var metadata: Dictionary<String,String> {
- get {return _storage._metadata}
- set {_uniqueStorage()._metadata = newValue}
- }
- /// The salience score associated with the entity in the [0, 1.0] range.
- ///
- /// The salience score for an entity provides information about the
- /// importance or centrality of that entity to the entire document text.
- /// Scores closer to 0 are less salient, while scores closer to 1.0 are highly
- /// salient.
- var salience: Float {
- get {return _storage._salience}
- set {_uniqueStorage()._salience = newValue}
- }
- /// The mentions of this entity in the input document. The API currently
- /// supports proper noun mentions.
- var mentions: [Google_Cloud_Language_V1_EntityMention] {
- get {return _storage._mentions}
- set {_uniqueStorage()._mentions = newValue}
- }
- /// For calls to [AnalyzeEntitySentiment][] or if
- /// [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment] is set to
- /// true, this field will contain the aggregate sentiment expressed for this
- /// entity in the provided document.
- var sentiment: Google_Cloud_Language_V1_Sentiment {
- get {return _storage._sentiment ?? Google_Cloud_Language_V1_Sentiment()}
- set {_uniqueStorage()._sentiment = newValue}
- }
- /// Returns true if `sentiment` has been explicitly set.
- var hasSentiment: Bool {return _storage._sentiment != nil}
- /// Clears the value of `sentiment`. Subsequent reads from it will return its default value.
- mutating func clearSentiment() {_uniqueStorage()._sentiment = nil}
- var unknownFields = SwiftProtobuf.UnknownStorage()
- /// The type of the entity. For most entity types, the associated metadata is a
- /// Wikipedia URL (`wikipedia_url`) and Knowledge Graph MID (`mid`). The table
- /// below lists the associated fields for entities that have different
- /// metadata.
- enum TypeEnum: SwiftProtobuf.Enum {
- typealias RawValue = Int
- /// Unknown
- case unknown // = 0
- /// Person
- case person // = 1
- /// Location
- case location // = 2
- /// Organization
- case organization // = 3
- /// Event
- case event // = 4
- /// Artwork
- case workOfArt // = 5
- /// Consumer product
- case consumerGood // = 6
- /// Other types of entities
- case other // = 7
- /// Phone number<br><br>
- /// The metadata lists the phone number, formatted according to local
- /// convention, plus whichever additional elements appear in the text:<ul>
- /// <li><code>number</code> – the actual number, broken down into
- /// sections as per local convention</li> <li><code>national_prefix</code>
- /// – country code, if detected</li> <li><code>area_code</code> –
- /// region or area code, if detected</li> <li><code>extension</code> –
- /// phone extension (to be dialed after connection), if detected</li></ul>
- case phoneNumber // = 9
- /// Address<br><br>
- /// The metadata identifies the street number and locality plus whichever
- /// additional elements appear in the text:<ul>
- /// <li><code>street_number</code> – street number</li>
- /// <li><code>locality</code> – city or town</li>
- /// <li><code>street_name</code> – street/route name, if detected</li>
- /// <li><code>postal_code</code> – postal code, if detected</li>
- /// <li><code>country</code> – country, if detected</li>
- /// <li><code>broad_region</code> – administrative area, such as the
- /// state, if detected</li> <li><code>narrow_region</code> – smaller
- /// administrative area, such as county, if detected</li>
- /// <li><code>sublocality</code> – used in Asian addresses to demark a
- /// district within a city, if detected</li></ul>
- case address // = 10
- /// Date<br><br>
- /// The metadata identifies the components of the date:<ul>
- /// <li><code>year</code> – four digit year, if detected</li>
- /// <li><code>month</code> – two digit month number, if detected</li>
- /// <li><code>day</code> – two digit day number, if detected</li></ul>
- case date // = 11
- /// Number<br><br>
- /// The metadata is the number itself.
- case number // = 12
- /// Price<br><br>
- /// The metadata identifies the <code>value</code> and <code>currency</code>.
- case price // = 13
- case UNRECOGNIZED(Int)
- init() {
- self = .unknown
- }
- init?(rawValue: Int) {
- switch rawValue {
- case 0: self = .unknown
- case 1: self = .person
- case 2: self = .location
- case 3: self = .organization
- case 4: self = .event
- case 5: self = .workOfArt
- case 6: self = .consumerGood
- case 7: self = .other
- case 9: self = .phoneNumber
- case 10: self = .address
- case 11: self = .date
- case 12: self = .number
- case 13: self = .price
- default: self = .UNRECOGNIZED(rawValue)
- }
- }
- var rawValue: Int {
- switch self {
- case .unknown: return 0
- case .person: return 1
- case .location: return 2
- case .organization: return 3
- case .event: return 4
- case .workOfArt: return 5
- case .consumerGood: return 6
- case .other: return 7
- case .phoneNumber: return 9
- case .address: return 10
- case .date: return 11
- case .number: return 12
- case .price: return 13
- case .UNRECOGNIZED(let i): return i
- }
- }
- }
- init() {}
- fileprivate var _storage = _StorageClass.defaultInstance
- }
- #if swift(>=4.2)
- extension Google_Cloud_Language_V1_Entity.TypeEnum: CaseIterable {
- // The compiler won't synthesize support with the UNRECOGNIZED case.
- static var allCases: [Google_Cloud_Language_V1_Entity.TypeEnum] = [
- .unknown,
- .person,
- .location,
- .organization,
- .event,
- .workOfArt,
- .consumerGood,
- .other,
- .phoneNumber,
- .address,
- .date,
- .number,
- .price,
- ]
- }
- #endif // swift(>=4.2)
- /// Represents the smallest syntactic building block of the text.
- struct Google_Cloud_Language_V1_Token {
- // SwiftProtobuf.Message conformance is added in an extension below. See the
- // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
- // methods supported on all messages.
- /// The token text.
- var text: Google_Cloud_Language_V1_TextSpan {
- get {return _storage._text ?? Google_Cloud_Language_V1_TextSpan()}
- set {_uniqueStorage()._text = newValue}
- }
- /// Returns true if `text` has been explicitly set.
- var hasText: Bool {return _storage._text != nil}
- /// Clears the value of `text`. Subsequent reads from it will return its default value.
- mutating func clearText() {_uniqueStorage()._text = nil}
- /// Parts of speech tag for this token.
- var partOfSpeech: Google_Cloud_Language_V1_PartOfSpeech {
- get {return _storage._partOfSpeech ?? Google_Cloud_Language_V1_PartOfSpeech()}
- set {_uniqueStorage()._partOfSpeech = newValue}
- }
- /// Returns true if `partOfSpeech` has been explicitly set.
- var hasPartOfSpeech: Bool {return _storage._partOfSpeech != nil}
- /// Clears the value of `partOfSpeech`. Subsequent reads from it will return its default value.
- mutating func clearPartOfSpeech() {_uniqueStorage()._partOfSpeech = nil}
- /// Dependency tree parse for this token.
- var dependencyEdge: Google_Cloud_Language_V1_DependencyEdge {
- get {return _storage._dependencyEdge ?? Google_Cloud_Language_V1_DependencyEdge()}
- set {_uniqueStorage()._dependencyEdge = newValue}
- }
- /// Returns true if `dependencyEdge` has been explicitly set.
- var hasDependencyEdge: Bool {return _storage._dependencyEdge != nil}
- /// Clears the value of `dependencyEdge`. Subsequent reads from it will return its default value.
- mutating func clearDependencyEdge() {_uniqueStorage()._dependencyEdge = nil}
- /// [Lemma](https://en.wikipedia.org/wiki/Lemma_%28morphology%29) of the token.
- var lemma: String {
- get {return _storage._lemma}
- set {_uniqueStorage()._lemma = newValue}
- }
- var unknownFields = SwiftProtobuf.UnknownStorage()
- init() {}
- fileprivate var _storage = _StorageClass.defaultInstance
- }
- /// Represents the feeling associated with the entire text or entities in
- /// the text.
- struct Google_Cloud_Language_V1_Sentiment {
- // SwiftProtobuf.Message conformance is added in an extension below. See the
- // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
- // methods supported on all messages.
- /// A non-negative number in the [0, +inf) range, which represents
- /// the absolute magnitude of sentiment regardless of score (positive or
- /// negative).
- var magnitude: Float = 0
- /// Sentiment score between -1.0 (negative sentiment) and 1.0
- /// (positive sentiment).
- var score: Float = 0
- var unknownFields = SwiftProtobuf.UnknownStorage()
- init() {}
- }
- /// Represents part of speech information for a token. Parts of speech
- /// are as defined in
- /// http://www.lrec-conf.org/proceedings/lrec2012/pdf/274_Paper.pdf
- struct Google_Cloud_Language_V1_PartOfSpeech {
- // SwiftProtobuf.Message conformance is added in an extension below. See the
- // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
- // methods supported on all messages.
- /// The part of speech tag.
- var tag: Google_Cloud_Language_V1_PartOfSpeech.Tag = .unknown
- /// The grammatical aspect.
- var aspect: Google_Cloud_Language_V1_PartOfSpeech.Aspect = .unknown
- /// The grammatical case.
- var `case`: Google_Cloud_Language_V1_PartOfSpeech.Case = .unknown
- /// The grammatical form.
- var form: Google_Cloud_Language_V1_PartOfSpeech.Form = .unknown
- /// The grammatical gender.
- var gender: Google_Cloud_Language_V1_PartOfSpeech.Gender = .unknown
- /// The grammatical mood.
- var mood: Google_Cloud_Language_V1_PartOfSpeech.Mood = .unknown
- /// The grammatical number.
- var number: Google_Cloud_Language_V1_PartOfSpeech.Number = .unknown
- /// The grammatical person.
- var person: Google_Cloud_Language_V1_PartOfSpeech.Person = .unknown
- /// The grammatical properness.
- var proper: Google_Cloud_Language_V1_PartOfSpeech.Proper = .unknown
- /// The grammatical reciprocity.
- var reciprocity: Google_Cloud_Language_V1_PartOfSpeech.Reciprocity = .unknown
- /// The grammatical tense.
- var tense: Google_Cloud_Language_V1_PartOfSpeech.Tense = .unknown
- /// The grammatical voice.
- var voice: Google_Cloud_Language_V1_PartOfSpeech.Voice = .unknown
- var unknownFields = SwiftProtobuf.UnknownStorage()
- /// The part of speech tags enum.
- enum Tag: SwiftProtobuf.Enum {
- typealias RawValue = Int
- /// Unknown
- case unknown // = 0
- /// Adjective
- case adj // = 1
- /// Adposition (preposition and postposition)
- case adp // = 2
- /// Adverb
- case adv // = 3
- /// Conjunction
- case conj // = 4
- /// Determiner
- case det // = 5
- /// Noun (common and proper)
- case noun // = 6
- /// Cardinal number
- case num // = 7
- /// Pronoun
- case pron // = 8
- /// Particle or other function word
- case prt // = 9
- /// Punctuation
- case punct // = 10
- /// Verb (all tenses and modes)
- case verb // = 11
- /// Other: foreign words, typos, abbreviations
- case x // = 12
- /// Affix
- case affix // = 13
- case UNRECOGNIZED(Int)
- init() {
- self = .unknown
- }
- init?(rawValue: Int) {
- switch rawValue {
- case 0: self = .unknown
- case 1: self = .adj
- case 2: self = .adp
- case 3: self = .adv
- case 4: self = .conj
- case 5: self = .det
- case 6: self = .noun
- case 7: self = .num
- case 8: self = .pron
- case 9: self = .prt
- case 10: self = .punct
- case 11: self = .verb
- case 12: self = .x
- case 13: self = .affix
- default: self = .UNRECOGNIZED(rawValue)
- }
- }
- var rawValue: Int {
- switch self {
- case .unknown: return 0
- case .adj: return 1
- case .adp: return 2
- case .adv: return 3
- case .conj: return 4
- case .det: return 5
- case .noun: return 6
- case .num: return 7
- case .pron: return 8
- case .prt: return 9
- case .punct: return 10
- case .verb: return 11
- case .x: return 12
- case .affix: return 13
- case .UNRECOGNIZED(let i): return i
- }
- }
- }
- /// The characteristic of a verb that expresses time flow during an event.
- enum Aspect: SwiftProtobuf.Enum {
- typealias RawValue = Int
- /// Aspect is not applicable in the analyzed language or is not predicted.
- case unknown // = 0
- /// Perfective
- case perfective // = 1
- /// Imperfective
- case imperfective // = 2
- /// Progressive
- case progressive // = 3
- case UNRECOGNIZED(Int)
- init() {
- self = .unknown
- }
- init?(rawValue: Int) {
- switch rawValue {
- case 0: self = .unknown
- case 1: self = .perfective
- case 2: self = .imperfective
- case 3: self = .progressive
- default: self = .UNRECOGNIZED(rawValue)
- }
- }
- var rawValue: Int {
- switch self {
- case .unknown: return 0
- case .perfective: return 1
- case .imperfective: return 2
- case .progressive: return 3
- case .UNRECOGNIZED(let i): return i
- }
- }
- }
- /// The grammatical function performed by a noun or pronoun in a phrase,
- /// clause, or sentence. In some languages, other parts of speech, such as
- /// adjective and determiner, take case inflection in agreement with the noun.
- enum Case: SwiftProtobuf.Enum {
- typealias RawValue = Int
- /// Case is not applicable in the analyzed language or is not predicted.
- case unknown // = 0
- /// Accusative
- case accusative // = 1
- /// Adverbial
- case adverbial // = 2
- /// Complementive
- case complementive // = 3
- /// Dative
- case dative // = 4
- /// Genitive
- case genitive // = 5
- /// Instrumental
- case instrumental // = 6
- /// Locative
- case locative // = 7
- /// Nominative
- case nominative // = 8
- /// Oblique
- case oblique // = 9
- /// Partitive
- case partitive // = 10
- /// Prepositional
- case prepositional // = 11
- /// Reflexive
- case reflexiveCase // = 12
- /// Relative
- case relativeCase // = 13
- /// Vocative
- case vocative // = 14
- case UNRECOGNIZED(Int)
- init() {
- self = .unknown
- }
- init?(rawValue: Int) {
- switch rawValue {
- case 0: self = .unknown
- case 1: self = .accusative
- case 2: self = .adverbial
- case 3: self = .complementive
- case 4: self = .dative
- case 5: self = .genitive
- case 6: self = .instrumental
- case 7: self = .locative
- case 8: self = .nominative
- case 9: self = .oblique
- case 10: self = .partitive
- case 11: self = .prepositional
- case 12: self = .reflexiveCase
- case 13: self = .relativeCase
- case 14: self = .vocative
- default: self = .UNRECOGNIZED(rawValue)
- }
- }
- var rawValue: Int {
- switch self {
- case .unknown: return 0
- case .accusative: return 1
- case .adverbial: return 2
- case .complementive: return 3
- case .dative: return 4
- case .genitive: return 5
- case .instrumental: return 6
- case .locative: return 7
- case .nominative: return 8
- case .oblique: return 9
- case .partitive: return 10
- case .prepositional: return 11
- case .reflexiveCase: return 12
- case .relativeCase: return 13
- case .vocative: return 14
- case .UNRECOGNIZED(let i): return i
- }
- }
- }
- /// Depending on the language, Form can be categorizing different forms of
- /// verbs, adjectives, adverbs, etc. For example, categorizing inflected
- /// endings of verbs and adjectives or distinguishing between short and long
- /// forms of adjectives and participles
- enum Form: SwiftProtobuf.Enum {
- typealias RawValue = Int
- /// Form is not applicable in the analyzed language or is not predicted.
- case unknown // = 0
- /// Adnomial
- case adnomial // = 1
- /// Auxiliary
- case auxiliary // = 2
- /// Complementizer
- case complementizer // = 3
- /// Final ending
- case finalEnding // = 4
- /// Gerund
- case gerund // = 5
- /// Realis
- case realis // = 6
- /// Irrealis
- case irrealis // = 7
- /// Short form
- case short // = 8
- /// Long form
- case long // = 9
- /// Order form
- case order // = 10
- /// Specific form
- case specific // = 11
- case UNRECOGNIZED(Int)
- init() {
- self = .unknown
- }
- init?(rawValue: Int) {
- switch rawValue {
- case 0: self = .unknown
- case 1: self = .adnomial
- case 2: self = .auxiliary
- case 3: self = .complementizer
- case 4: self = .finalEnding
- case 5: self = .gerund
- case 6: self = .realis
- case 7: self = .irrealis
- case 8: self = .short
- case 9: self = .long
- case 10: self = .order
- case 11: self = .specific
- default: self = .UNRECOGNIZED(rawValue)
- }
- }
- var rawValue: Int {
- switch self {
- case .unknown: return 0
- case .adnomial: return 1
- case .auxiliary: return 2
- case .complementizer: return 3
- case .finalEnding: return 4
- case .gerund: return 5
- case .realis: return 6
- case .irrealis: return 7
- case .short: return 8
- case .long: return 9
- case .order: return 10
- case .specific: return 11
- case .UNRECOGNIZED(let i): return i
- }
- }
- }
- /// Gender classes of nouns reflected in the behaviour of associated words.
- enum Gender: SwiftProtobuf.Enum {
- typealias RawValue = Int
- /// Gender is not applicable in the analyzed language or is not predicted.
- case unknown // = 0
- /// Feminine
- case feminine // = 1
- /// Masculine
- case masculine // = 2
- /// Neuter
- case neuter // = 3
- case UNRECOGNIZED(Int)
- init() {
- self = .unknown
- }
- init?(rawValue: Int) {
- switch rawValue {
- case 0: self = .unknown
- case 1: self = .feminine
- case 2: self = .masculine
- case 3: self = .neuter
- default: self = .UNRECOGNIZED(rawValue)
- }
- }
- var rawValue: Int {
- switch self {
- case .unknown: return 0
- case .feminine: return 1
- case .masculine: return 2
- case .neuter: return 3
- case .UNRECOGNIZED(let i): return i
- }
- }
- }
- /// The grammatical feature of verbs, used for showing modality and attitude.
- enum Mood: SwiftProtobuf.Enum {
- typealias RawValue = Int
- /// Mood is not applicable in the analyzed language or is not predicted.
- case unknown // = 0
- /// Conditional
- case conditionalMood // = 1
- /// Imperative
- case imperative // = 2
- /// Indicative
- case indicative // = 3
- /// Interrogative
- case interrogative // = 4
- /// Jussive
- case jussive // = 5
- /// Subjunctive
- case subjunctive // = 6
- case UNRECOGNIZED(Int)
- init() {
- self = .unknown
- }
- init?(rawValue: Int) {
- switch rawValue {
- case 0: self = .unknown
- case 1: self = .conditionalMood
- case 2: self = .imperative
- case 3: self = .indicative
- case 4: self = .interrogative
- case 5: self = .jussive
- case 6: self = .subjunctive
- default: self = .UNRECOGNIZED(rawValue)
- }
- }
- var rawValue: Int {
- switch self {
- case .unknown: return 0
- case .conditionalMood: return 1
- case .imperative: return 2
- case .indicative: return 3
- case .interrogative: return 4
- case .jussive: return 5
- case .subjunctive: return 6
- case .UNRECOGNIZED(let i): return i
- }
- }
- }
- /// Count distinctions.
- enum Number: SwiftProtobuf.Enum {
- typealias RawValue = Int
- /// Number is not applicable in the analyzed language or is not predicted.
- case unknown // = 0
- /// Singular
- case singular // = 1
- /// Plural
- case plural // = 2
- /// Dual
- case dual // = 3
- case UNRECOGNIZED(Int)
- init() {
- self = .unknown
- }
- init?(rawValue: Int) {
- switch rawValue {
- case 0: self = .unknown
- case 1: self = .singular
- case 2: self = .plural
- case 3: self = .dual
- default: self = .UNRECOGNIZED(rawValue)
- }
- }
- var rawValue: Int {
- switch self {
- case .unknown: return 0
- case .singular: return 1
- case .plural: return 2
- case .dual: return 3
- case .UNRECOGNIZED(let i): return i
- }
- }
- }
- /// The distinction between the speaker, second person, third person, etc.
- enum Person: SwiftProtobuf.Enum {
- typealias RawValue = Int
- /// Person is not applicable in the analyzed language or is not predicted.
- case unknown // = 0
- /// First
- case first // = 1
- /// Second
- case second // = 2
- /// Third
- case third // = 3
- /// Reflexive
- case reflexivePerson // = 4
- case UNRECOGNIZED(Int)
- init() {
- self = .unknown
- }
- init?(rawValue: Int) {
- switch rawValue {
- case 0: self = .unknown
- case 1: self = .first
- case 2: self = .second
- case 3: self = .third
- case 4: self = .reflexivePerson
- default: self = .UNRECOGNIZED(rawValue)
- }
- }
- var rawValue: Int {
- switch self {
- case .unknown: return 0
- case .first: return 1
- case .second: return 2
- case .third: return 3
- case .reflexivePerson: return 4
- case .UNRECOGNIZED(let i): return i
- }
- }
- }
- /// This category shows if the token is part of a proper name.
- enum Proper: SwiftProtobuf.Enum {
- typealias RawValue = Int
- /// Proper is not applicable in the analyzed language or is not predicted.
- case unknown // = 0
- /// Proper
- case proper // = 1
- /// Not proper
- case notProper // = 2
- case UNRECOGNIZED(Int)
- init() {
- self = .unknown
- }
- init?(rawValue: Int) {
- switch rawValue {
- case 0: self = .unknown
- case 1: self = .proper
- case 2: self = .notProper
- default: self = .UNRECOGNIZED(rawValue)
- }
- }
- var rawValue: Int {
- switch self {
- case .unknown: return 0
- case .proper: return 1
- case .notProper: return 2
- case .UNRECOGNIZED(let i): return i
- }
- }
- }
- /// Reciprocal features of a pronoun.
- enum Reciprocity: SwiftProtobuf.Enum {
- typealias RawValue = Int
- /// Reciprocity is not applicable in the analyzed language or is not
- /// predicted.
- case unknown // = 0
- /// Reciprocal
- case reciprocal // = 1
- /// Non-reciprocal
- case nonReciprocal // = 2
- case UNRECOGNIZED(Int)
- init() {
- self = .unknown
- }
- init?(rawValue: Int) {
- switch rawValue {
- case 0: self = .unknown
- case 1: self = .reciprocal
- case 2: self = .nonReciprocal
- default: self = .UNRECOGNIZED(rawValue)
- }
- }
- var rawValue: Int {
- switch self {
- case .unknown: return 0
- case .reciprocal: return 1
- case .nonReciprocal: return 2
- case .UNRECOGNIZED(let i): return i
- }
- }
- }
- /// Time reference.
- enum Tense: SwiftProtobuf.Enum {
- typealias RawValue = Int
- /// Tense is not applicable in the analyzed language or is not predicted.
- case unknown // = 0
- /// Conditional
- case conditionalTense // = 1
- /// Future
- case future // = 2
- /// Past
- case past // = 3
- /// Present
- case present // = 4
- /// Imperfect
- case imperfect // = 5
- /// Pluperfect
- case pluperfect // = 6
- case UNRECOGNIZED(Int)
- init() {
- self = .unknown
- }
- init?(rawValue: Int) {
- switch rawValue {
- case 0: self = .unknown
- case 1: self = .conditionalTense
- case 2: self = .future
- case 3: self = .past
- case 4: self = .present
- case 5: self = .imperfect
- case 6: self = .pluperfect
- default: self = .UNRECOGNIZED(rawValue)
- }
- }
- var rawValue: Int {
- switch self {
- case .unknown: return 0
- case .conditionalTense: return 1
- case .future: return 2
- case .past: return 3
- case .present: return 4
- case .imperfect: return 5
- case .pluperfect: return 6
- case .UNRECOGNIZED(let i): return i
- }
- }
- }
- /// The relationship between the action that a verb expresses and the
- /// participants identified by its arguments.
- enum Voice: SwiftProtobuf.Enum {
- typealias RawValue = Int
- /// Voice is not applicable in the analyzed language or is not predicted.
- case unknown // = 0
- /// Active
- case active // = 1
- /// Causative
- case causative // = 2
- /// Passive
- case passive // = 3
- case UNRECOGNIZED(Int)
- init() {
- self = .unknown
- }
- init?(rawValue: Int) {
- switch rawValue {
- case 0: self = .unknown
- case 1: self = .active
- case 2: self = .causative
- case 3: self = .passive
- default: self = .UNRECOGNIZED(rawValue)
- }
- }
- var rawValue: Int {
- switch self {
- case .unknown: return 0
- case .active: return 1
- case .causative: return 2
- case .passive: return 3
- case .UNRECOGNIZED(let i): return i
- }
- }
- }
- init() {}
- }
- #if swift(>=4.2)
- extension Google_Cloud_Language_V1_PartOfSpeech.Tag: CaseIterable {
- // The compiler won't synthesize support with the UNRECOGNIZED case.
- static var allCases: [Google_Cloud_Language_V1_PartOfSpeech.Tag] = [
- .unknown,
- .adj,
- .adp,
- .adv,
- .conj,
- .det,
- .noun,
- .num,
- .pron,
- .prt,
- .punct,
- .verb,
- .x,
- .affix,
- ]
- }
- extension Google_Cloud_Language_V1_PartOfSpeech.Aspect: CaseIterable {
- // The compiler won't synthesize support with the UNRECOGNIZED case.
- static var allCases: [Google_Cloud_Language_V1_PartOfSpeech.Aspect] = [
- .unknown,
- .perfective,
- .imperfective,
- .progressive,
- ]
- }
- extension Google_Cloud_Language_V1_PartOfSpeech.Case: CaseIterable {
- // The compiler won't synthesize support with the UNRECOGNIZED case.
- static var allCases: [Google_Cloud_Language_V1_PartOfSpeech.Case] = [
- .unknown,
- .accusative,
- .adverbial,
- .complementive,
- .dative,
- .genitive,
- .instrumental,
- .locative,
- .nominative,
- .oblique,
- .partitive,
- .prepositional,
- .reflexiveCase,
- .relativeCase,
- .vocative,
- ]
- }
- extension Google_Cloud_Language_V1_PartOfSpeech.Form: CaseIterable {
- // The compiler won't synthesize support with the UNRECOGNIZED case.
- static var allCases: [Google_Cloud_Language_V1_PartOfSpeech.Form] = [
- .unknown,
- .adnomial,
- .auxiliary,
- .complementizer,
- .finalEnding,
- .gerund,
- .realis,
- .irrealis,
- .short,
- .long,
- .order,
- .specific,
- ]
- }
- extension Google_Cloud_Language_V1_PartOfSpeech.Gender: CaseIterable {
- // The compiler won't synthesize support with the UNRECOGNIZED case.
- static var allCases: [Google_Cloud_Language_V1_PartOfSpeech.Gender] = [
- .unknown,
- .feminine,
- .masculine,
- .neuter,
- ]
- }
- extension Google_Cloud_Language_V1_PartOfSpeech.Mood: CaseIterable {
- // The compiler won't synthesize support with the UNRECOGNIZED case.
- static var allCases: [Google_Cloud_Language_V1_PartOfSpeech.Mood] = [
- .unknown,
- .conditionalMood,
- .imperative,
- .indicative,
- .interrogative,
- .jussive,
- .subjunctive,
- ]
- }
- extension Google_Cloud_Language_V1_PartOfSpeech.Number: CaseIterable {
- // The compiler won't synthesize support with the UNRECOGNIZED case.
- static var allCases: [Google_Cloud_Language_V1_PartOfSpeech.Number] = [
- .unknown,
- .singular,
- .plural,
- .dual,
- ]
- }
- extension Google_Cloud_Language_V1_PartOfSpeech.Person: CaseIterable {
- // The compiler won't synthesize support with the UNRECOGNIZED case.
- static var allCases: [Google_Cloud_Language_V1_PartOfSpeech.Person] = [
- .unknown,
- .first,
- .second,
- .third,
- .reflexivePerson,
- ]
- }
- extension Google_Cloud_Language_V1_PartOfSpeech.Proper: CaseIterable {
- // The compiler won't synthesize support with the UNRECOGNIZED case.
- static var allCases: [Google_Cloud_Language_V1_PartOfSpeech.Proper] = [
- .unknown,
- .proper,
- .notProper,
- ]
- }
- extension Google_Cloud_Language_V1_PartOfSpeech.Reciprocity: CaseIterable {
- // The compiler won't synthesize support with the UNRECOGNIZED case.
- static var allCases: [Google_Cloud_Language_V1_PartOfSpeech.Reciprocity] = [
- .unknown,
- .reciprocal,
- .nonReciprocal,
- ]
- }
- extension Google_Cloud_Language_V1_PartOfSpeech.Tense: CaseIterable {
- // The compiler won't synthesize support with the UNRECOGNIZED case.
- static var allCases: [Google_Cloud_Language_V1_PartOfSpeech.Tense] = [
- .unknown,
- .conditionalTense,
- .future,
- .past,
- .present,
- .imperfect,
- .pluperfect,
- ]
- }
- extension Google_Cloud_Language_V1_PartOfSpeech.Voice: CaseIterable {
- // The compiler won't synthesize support with the UNRECOGNIZED case.
- static var allCases: [Google_Cloud_Language_V1_PartOfSpeech.Voice] = [
- .unknown,
- .active,
- .causative,
- .passive,
- ]
- }
- #endif // swift(>=4.2)
- /// Represents dependency parse tree information for a token. (For more
- /// information on dependency labels, see
- /// http://www.aclweb.org/anthology/P13-2017
- struct Google_Cloud_Language_V1_DependencyEdge {
- // SwiftProtobuf.Message conformance is added in an extension below. See the
- // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
- // methods supported on all messages.
- /// Represents the head of this token in the dependency tree.
- /// This is the index of the token which has an arc going to this token.
- /// The index is the position of the token in the array of tokens returned
- /// by the API method. If this token is a root token, then the
- /// `head_token_index` is its own index.
- var headTokenIndex: Int32 = 0
- /// The parse label for the token.
- var label: Google_Cloud_Language_V1_DependencyEdge.Label = .unknown
- var unknownFields = SwiftProtobuf.UnknownStorage()
- /// The parse label enum for the token.
- enum Label: SwiftProtobuf.Enum {
- typealias RawValue = Int
- /// Unknown
- case unknown // = 0
- /// Abbreviation modifier
- case abbrev // = 1
- /// Adjectival complement
- case acomp // = 2
- /// Adverbial clause modifier
- case advcl // = 3
- /// Adverbial modifier
- case advmod // = 4
- /// Adjectival modifier of an NP
- case amod // = 5
- /// Appositional modifier of an NP
- case appos // = 6
- /// Attribute dependent of a copular verb
- case attr // = 7
- /// Auxiliary (non-main) verb
- case aux // = 8
- /// Passive auxiliary
- case auxpass // = 9
- /// Coordinating conjunction
- case cc // = 10
- /// Clausal complement of a verb or adjective
- case ccomp // = 11
- /// Conjunct
- case conj // = 12
- /// Clausal subject
- case csubj // = 13
- /// Clausal passive subject
- case csubjpass // = 14
- /// Dependency (unable to determine)
- case dep // = 15
- /// Determiner
- case det // = 16
- /// Discourse
- case discourse // = 17
- /// Direct object
- case dobj // = 18
- /// Expletive
- case expl // = 19
- /// Goes with (part of a word in a text not well edited)
- case goeswith // = 20
- /// Indirect object
- case iobj // = 21
- /// Marker (word introducing a subordinate clause)
- case mark // = 22
- /// Multi-word expression
- case mwe // = 23
- /// Multi-word verbal expression
- case mwv // = 24
- /// Negation modifier
- case neg // = 25
- /// Noun compound modifier
- case nn // = 26
- /// Noun phrase used as an adverbial modifier
- case npadvmod // = 27
- /// Nominal subject
- case nsubj // = 28
- /// Passive nominal subject
- case nsubjpass // = 29
- /// Numeric modifier of a noun
- case num // = 30
- /// Element of compound number
- case number // = 31
- /// Punctuation mark
- case p // = 32
- /// Parataxis relation
- case parataxis // = 33
- /// Participial modifier
- case partmod // = 34
- /// The complement of a preposition is a clause
- case pcomp // = 35
- /// Object of a preposition
- case pobj // = 36
- /// Possession modifier
- case poss // = 37
- /// Postverbal negative particle
- case postneg // = 38
- /// Predicate complement
- case precomp // = 39
- /// Preconjunt
- case preconj // = 40
- /// Predeterminer
- case predet // = 41
- /// Prefix
- case pref // = 42
- /// Prepositional modifier
- case prep // = 43
- /// The relationship between a verb and verbal morpheme
- case pronl // = 44
- /// Particle
- case prt // = 45
- /// Associative or possessive marker
- case ps // = 46
- /// Quantifier phrase modifier
- case quantmod // = 47
- /// Relative clause modifier
- case rcmod // = 48
- /// Complementizer in relative clause
- case rcmodrel // = 49
- /// Ellipsis without a preceding predicate
- case rdrop // = 50
- /// Referent
- case ref // = 51
- /// Remnant
- case remnant // = 52
- /// Reparandum
- case reparandum // = 53
- /// Root
- case root // = 54
- /// Suffix specifying a unit of number
- case snum // = 55
- /// Suffix
- case suff // = 56
- /// Temporal modifier
- case tmod // = 57
- /// Topic marker
- case topic // = 58
- /// Clause headed by an infinite form of the verb that modifies a noun
- case vmod // = 59
- /// Vocative
- case vocative // = 60
- /// Open clausal complement
- case xcomp // = 61
- /// Name suffix
- case suffix // = 62
- /// Name title
- case title // = 63
- /// Adverbial phrase modifier
- case advphmod // = 64
- /// Causative auxiliary
- case auxcaus // = 65
- /// Helper auxiliary
- case auxvv // = 66
- /// Rentaishi (Prenominal modifier)
- case dtmod // = 67
- /// Foreign words
- case foreign // = 68
- /// Keyword
- case kw // = 69
- /// List for chains of comparable items
- case list // = 70
- /// Nominalized clause
- case nomc // = 71
- /// Nominalized clausal subject
- case nomcsubj // = 72
- /// Nominalized clausal passive
- case nomcsubjpass // = 73
- /// Compound of numeric modifier
- case numc // = 74
- /// Copula
- case cop // = 75
- /// Dislocated relation (for fronted/topicalized elements)
- case dislocated // = 76
- /// Aspect marker
- case asp // = 77
- /// Genitive modifier
- case gmod // = 78
- /// Genitive object
- case gobj // = 79
- /// Infinitival modifier
- case infmod // = 80
- /// Measure
- case mes // = 81
- /// Nominal complement of a noun
- case ncomp // = 82
- case UNRECOGNIZED(Int)
- init() {
- self = .unknown
- }
- init?(rawValue: Int) {
- switch rawValue {
- case 0: self = .unknown
- case 1: self = .abbrev
- case 2: self = .acomp
- case 3: self = .advcl
- case 4: self = .advmod
- case 5: self = .amod
- case 6: self = .appos
- case 7: self = .attr
- case 8: self = .aux
- case 9: self = .auxpass
- case 10: self = .cc
- case 11: self = .ccomp
- case 12: self = .conj
- case 13: self = .csubj
- case 14: self = .csubjpass
- case 15: self = .dep
- case 16: self = .det
- case 17: self = .discourse
- case 18: self = .dobj
- case 19: self = .expl
- case 20: self = .goeswith
- case 21: self = .iobj
- case 22: self = .mark
- case 23: self = .mwe
- case 24: self = .mwv
- case 25: self = .neg
- case 26: self = .nn
- case 27: self = .npadvmod
- case 28: self = .nsubj
- case 29: self = .nsubjpass
- case 30: self = .num
- case 31: self = .number
- case 32: self = .p
- case 33: self = .parataxis
- case 34: self = .partmod
- case 35: self = .pcomp
- case 36: self = .pobj
- case 37: self = .poss
- case 38: self = .postneg
- case 39: self = .precomp
- case 40: self = .preconj
- case 41: self = .predet
- case 42: self = .pref
- case 43: self = .prep
- case 44: self = .pronl
- case 45: self = .prt
- case 46: self = .ps
- case 47: self = .quantmod
- case 48: self = .rcmod
- case 49: self = .rcmodrel
- case 50: self = .rdrop
- case 51: self = .ref
- case 52: self = .remnant
- case 53: self = .reparandum
- case 54: self = .root
- case 55: self = .snum
- case 56: self = .suff
- case 57: self = .tmod
- case 58: self = .topic
- case 59: self = .vmod
- case 60: self = .vocative
- case 61: self = .xcomp
- case 62: self = .suffix
- case 63: self = .title
- case 64: self = .advphmod
- case 65: self = .auxcaus
- case 66: self = .auxvv
- case 67: self = .dtmod
- case 68: self = .foreign
- case 69: self = .kw
- case 70: self = .list
- case 71: self = .nomc
- case 72: self = .nomcsubj
- case 73: self = .nomcsubjpass
- case 74: self = .numc
- case 75: self = .cop
- case 76: self = .dislocated
- case 77: self = .asp
- case 78: self = .gmod
- case 79: self = .gobj
- case 80: self = .infmod
- case 81: self = .mes
- case 82: self = .ncomp
- default: self = .UNRECOGNIZED(rawValue)
- }
- }
- var rawValue: Int {
- switch self {
- case .unknown: return 0
- case .abbrev: return 1
- case .acomp: return 2
- case .advcl: return 3
- case .advmod: return 4
- case .amod: return 5
- case .appos: return 6
- case .attr: return 7
- case .aux: return 8
- case .auxpass: return 9
- case .cc: return 10
- case .ccomp: return 11
- case .conj: return 12
- case .csubj: return 13
- case .csubjpass: return 14
- case .dep: return 15
- case .det: return 16
- case .discourse: return 17
- case .dobj: return 18
- case .expl: return 19
- case .goeswith: return 20
- case .iobj: return 21
- case .mark: return 22
- case .mwe: return 23
- case .mwv: return 24
- case .neg: return 25
- case .nn: return 26
- case .npadvmod: return 27
- case .nsubj: return 28
- case .nsubjpass: return 29
- case .num: return 30
- case .number: return 31
- case .p: return 32
- case .parataxis: return 33
- case .partmod: return 34
- case .pcomp: return 35
- case .pobj: return 36
- case .poss: return 37
- case .postneg: return 38
- case .precomp: return 39
- case .preconj: return 40
- case .predet: return 41
- case .pref: return 42
- case .prep: return 43
- case .pronl: return 44
- case .prt: return 45
- case .ps: return 46
- case .quantmod: return 47
- case .rcmod: return 48
- case .rcmodrel: return 49
- case .rdrop: return 50
- case .ref: return 51
- case .remnant: return 52
- case .reparandum: return 53
- case .root: return 54
- case .snum: return 55
- case .suff: return 56
- case .tmod: return 57
- case .topic: return 58
- case .vmod: return 59
- case .vocative: return 60
- case .xcomp: return 61
- case .suffix: return 62
- case .title: return 63
- case .advphmod: return 64
- case .auxcaus: return 65
- case .auxvv: return 66
- case .dtmod: return 67
- case .foreign: return 68
- case .kw: return 69
- case .list: return 70
- case .nomc: return 71
- case .nomcsubj: return 72
- case .nomcsubjpass: return 73
- case .numc: return 74
- case .cop: return 75
- case .dislocated: return 76
- case .asp: return 77
- case .gmod: return 78
- case .gobj: return 79
- case .infmod: return 80
- case .mes: return 81
- case .ncomp: return 82
- case .UNRECOGNIZED(let i): return i
- }
- }
- }
- init() {}
- }
- #if swift(>=4.2)
- extension Google_Cloud_Language_V1_DependencyEdge.Label: CaseIterable {
- // The compiler won't synthesize support with the UNRECOGNIZED case.
- static var allCases: [Google_Cloud_Language_V1_DependencyEdge.Label] = [
- .unknown,
- .abbrev,
- .acomp,
- .advcl,
- .advmod,
- .amod,
- .appos,
- .attr,
- .aux,
- .auxpass,
- .cc,
- .ccomp,
- .conj,
- .csubj,
- .csubjpass,
- .dep,
- .det,
- .discourse,
- .dobj,
- .expl,
- .goeswith,
- .iobj,
- .mark,
- .mwe,
- .mwv,
- .neg,
- .nn,
- .npadvmod,
- .nsubj,
- .nsubjpass,
- .num,
- .number,
- .p,
- .parataxis,
- .partmod,
- .pcomp,
- .pobj,
- .poss,
- .postneg,
- .precomp,
- .preconj,
- .predet,
- .pref,
- .prep,
- .pronl,
- .prt,
- .ps,
- .quantmod,
- .rcmod,
- .rcmodrel,
- .rdrop,
- .ref,
- .remnant,
- .reparandum,
- .root,
- .snum,
- .suff,
- .tmod,
- .topic,
- .vmod,
- .vocative,
- .xcomp,
- .suffix,
- .title,
- .advphmod,
- .auxcaus,
- .auxvv,
- .dtmod,
- .foreign,
- .kw,
- .list,
- .nomc,
- .nomcsubj,
- .nomcsubjpass,
- .numc,
- .cop,
- .dislocated,
- .asp,
- .gmod,
- .gobj,
- .infmod,
- .mes,
- .ncomp,
- ]
- }
- #endif // swift(>=4.2)
- /// Represents a mention for an entity in the text. Currently, proper noun
- /// mentions are supported.
- struct Google_Cloud_Language_V1_EntityMention {
- // SwiftProtobuf.Message conformance is added in an extension below. See the
- // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
- // methods supported on all messages.
- /// The mention text.
- var text: Google_Cloud_Language_V1_TextSpan {
- get {return _storage._text ?? Google_Cloud_Language_V1_TextSpan()}
- set {_uniqueStorage()._text = newValue}
- }
- /// Returns true if `text` has been explicitly set.
- var hasText: Bool {return _storage._text != nil}
- /// Clears the value of `text`. Subsequent reads from it will return its default value.
- mutating func clearText() {_uniqueStorage()._text = nil}
- /// The type of the entity mention.
- var type: Google_Cloud_Language_V1_EntityMention.TypeEnum {
- get {return _storage._type}
- set {_uniqueStorage()._type = newValue}
- }
- /// For calls to [AnalyzeEntitySentiment][] or if
- /// [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment] is set to
- /// true, this field will contain the sentiment expressed for this mention of
- /// the entity in the provided document.
- var sentiment: Google_Cloud_Language_V1_Sentiment {
- get {return _storage._sentiment ?? Google_Cloud_Language_V1_Sentiment()}
- set {_uniqueStorage()._sentiment = newValue}
- }
- /// Returns true if `sentiment` has been explicitly set.
- var hasSentiment: Bool {return _storage._sentiment != nil}
- /// Clears the value of `sentiment`. Subsequent reads from it will return its default value.
- mutating func clearSentiment() {_uniqueStorage()._sentiment = nil}
- var unknownFields = SwiftProtobuf.UnknownStorage()
- /// The supported types of mentions.
- enum TypeEnum: SwiftProtobuf.Enum {
- typealias RawValue = Int
- /// Unknown
- case unknown // = 0
- /// Proper name
- case proper // = 1
- /// Common noun (or noun compound)
- case common // = 2
- case UNRECOGNIZED(Int)
- init() {
- self = .unknown
- }
- init?(rawValue: Int) {
- switch rawValue {
- case 0: self = .unknown
- case 1: self = .proper
- case 2: self = .common
- default: self = .UNRECOGNIZED(rawValue)
- }
- }
- var rawValue: Int {
- switch self {
- case .unknown: return 0
- case .proper: return 1
- case .common: return 2
- case .UNRECOGNIZED(let i): return i
- }
- }
- }
- init() {}
- fileprivate var _storage = _StorageClass.defaultInstance
- }
- #if swift(>=4.2)
- extension Google_Cloud_Language_V1_EntityMention.TypeEnum: CaseIterable {
- // The compiler won't synthesize support with the UNRECOGNIZED case.
- static var allCases: [Google_Cloud_Language_V1_EntityMention.TypeEnum] = [
- .unknown,
- .proper,
- .common,
- ]
- }
- #endif // swift(>=4.2)
- /// Represents an output piece of text.
- struct Google_Cloud_Language_V1_TextSpan {
- // SwiftProtobuf.Message conformance is added in an extension below. See the
- // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
- // methods supported on all messages.
- /// The content of the output text.
- var content: String = String()
- /// The API calculates the beginning offset of the content in the original
- /// document according to the [EncodingType][google.cloud.language.v1.EncodingType] specified in the API request.
- var beginOffset: Int32 = 0
- var unknownFields = SwiftProtobuf.UnknownStorage()
- init() {}
- }
- /// Represents a category returned from the text classifier.
- struct Google_Cloud_Language_V1_ClassificationCategory {
- // SwiftProtobuf.Message conformance is added in an extension below. See the
- // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
- // methods supported on all messages.
- /// The name of the category representing the document, from the [predefined
- /// taxonomy](/natural-language/docs/categories).
- var name: String = String()
- /// The classifier's confidence of the category. Number represents how certain
- /// the classifier is that this category represents the given text.
- var confidence: Float = 0
- var unknownFields = SwiftProtobuf.UnknownStorage()
- init() {}
- }
- /// The sentiment analysis request message.
- struct Google_Cloud_Language_V1_AnalyzeSentimentRequest {
- // SwiftProtobuf.Message conformance is added in an extension below. See the
- // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
- // methods supported on all messages.
- /// Input document.
- var document: Google_Cloud_Language_V1_Document {
- get {return _storage._document ?? Google_Cloud_Language_V1_Document()}
- set {_uniqueStorage()._document = newValue}
- }
- /// Returns true if `document` has been explicitly set.
- var hasDocument: Bool {return _storage._document != nil}
- /// Clears the value of `document`. Subsequent reads from it will return its default value.
- mutating func clearDocument() {_uniqueStorage()._document = nil}
- /// The encoding type used by the API to calculate sentence offsets.
- var encodingType: Google_Cloud_Language_V1_EncodingType {
- get {return _storage._encodingType}
- set {_uniqueStorage()._encodingType = newValue}
- }
- var unknownFields = SwiftProtobuf.UnknownStorage()
- init() {}
- fileprivate var _storage = _StorageClass.defaultInstance
- }
- /// The sentiment analysis response message.
- struct Google_Cloud_Language_V1_AnalyzeSentimentResponse {
- // SwiftProtobuf.Message conformance is added in an extension below. See the
- // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
- // methods supported on all messages.
- /// The overall sentiment of the input document.
- var documentSentiment: Google_Cloud_Language_V1_Sentiment {
- get {return _storage._documentSentiment ?? Google_Cloud_Language_V1_Sentiment()}
- set {_uniqueStorage()._documentSentiment = newValue}
- }
- /// Returns true if `documentSentiment` has been explicitly set.
- var hasDocumentSentiment: Bool {return _storage._documentSentiment != nil}
- /// Clears the value of `documentSentiment`. Subsequent reads from it will return its default value.
- mutating func clearDocumentSentiment() {_uniqueStorage()._documentSentiment = nil}
- /// The language of the text, which will be the same as the language specified
- /// in the request or, if not specified, the automatically-detected language.
- /// See [Document.language][google.cloud.language.v1.Document.language] field for more details.
- var language: String {
- get {return _storage._language}
- set {_uniqueStorage()._language = newValue}
- }
- /// The sentiment for all the sentences in the document.
- var sentences: [Google_Cloud_Language_V1_Sentence] {
- get {return _storage._sentences}
- set {_uniqueStorage()._sentences = newValue}
- }
- var unknownFields = SwiftProtobuf.UnknownStorage()
- init() {}
- fileprivate var _storage = _StorageClass.defaultInstance
- }
- /// The entity-level sentiment analysis request message.
- struct Google_Cloud_Language_V1_AnalyzeEntitySentimentRequest {
- // SwiftProtobuf.Message conformance is added in an extension below. See the
- // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
- // methods supported on all messages.
- /// Input document.
- var document: Google_Cloud_Language_V1_Document {
- get {return _storage._document ?? Google_Cloud_Language_V1_Document()}
- set {_uniqueStorage()._document = newValue}
- }
- /// Returns true if `document` has been explicitly set.
- var hasDocument: Bool {return _storage._document != nil}
- /// Clears the value of `document`. Subsequent reads from it will return its default value.
- mutating func clearDocument() {_uniqueStorage()._document = nil}
- /// The encoding type used by the API to calculate offsets.
- var encodingType: Google_Cloud_Language_V1_EncodingType {
- get {return _storage._encodingType}
- set {_uniqueStorage()._encodingType = newValue}
- }
- var unknownFields = SwiftProtobuf.UnknownStorage()
- init() {}
- fileprivate var _storage = _StorageClass.defaultInstance
- }
- /// The entity-level sentiment analysis response message.
- struct Google_Cloud_Language_V1_AnalyzeEntitySentimentResponse {
- // SwiftProtobuf.Message conformance is added in an extension below. See the
- // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
- // methods supported on all messages.
- /// The recognized entities in the input document with associated sentiments.
- var entities: [Google_Cloud_Language_V1_Entity] = []
- /// The language of the text, which will be the same as the language specified
- /// in the request or, if not specified, the automatically-detected language.
- /// See [Document.language][google.cloud.language.v1.Document.language] field for more details.
- var language: String = String()
- var unknownFields = SwiftProtobuf.UnknownStorage()
- init() {}
- }
- /// The entity analysis request message.
- struct Google_Cloud_Language_V1_AnalyzeEntitiesRequest {
- // SwiftProtobuf.Message conformance is added in an extension below. See the
- // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
- // methods supported on all messages.
- /// Input document.
- var document: Google_Cloud_Language_V1_Document {
- get {return _storage._document ?? Google_Cloud_Language_V1_Document()}
- set {_uniqueStorage()._document = newValue}
- }
- /// Returns true if `document` has been explicitly set.
- var hasDocument: Bool {return _storage._document != nil}
- /// Clears the value of `document`. Subsequent reads from it will return its default value.
- mutating func clearDocument() {_uniqueStorage()._document = nil}
- /// The encoding type used by the API to calculate offsets.
- var encodingType: Google_Cloud_Language_V1_EncodingType {
- get {return _storage._encodingType}
- set {_uniqueStorage()._encodingType = newValue}
- }
- var unknownFields = SwiftProtobuf.UnknownStorage()
- init() {}
- fileprivate var _storage = _StorageClass.defaultInstance
- }
- /// The entity analysis response message.
- struct Google_Cloud_Language_V1_AnalyzeEntitiesResponse {
- // SwiftProtobuf.Message conformance is added in an extension below. See the
- // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
- // methods supported on all messages.
- /// The recognized entities in the input document.
- var entities: [Google_Cloud_Language_V1_Entity] = []
- /// The language of the text, which will be the same as the language specified
- /// in the request or, if not specified, the automatically-detected language.
- /// See [Document.language][google.cloud.language.v1.Document.language] field for more details.
- var language: String = String()
- var unknownFields = SwiftProtobuf.UnknownStorage()
- init() {}
- }
- /// The syntax analysis request message.
- struct Google_Cloud_Language_V1_AnalyzeSyntaxRequest {
- // SwiftProtobuf.Message conformance is added in an extension below. See the
- // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
- // methods supported on all messages.
- /// Input document.
- var document: Google_Cloud_Language_V1_Document {
- get {return _storage._document ?? Google_Cloud_Language_V1_Document()}
- set {_uniqueStorage()._document = newValue}
- }
- /// Returns true if `document` has been explicitly set.
- var hasDocument: Bool {return _storage._document != nil}
- /// Clears the value of `document`. Subsequent reads from it will return its default value.
- mutating func clearDocument() {_uniqueStorage()._document = nil}
- /// The encoding type used by the API to calculate offsets.
- var encodingType: Google_Cloud_Language_V1_EncodingType {
- get {return _storage._encodingType}
- set {_uniqueStorage()._encodingType = newValue}
- }
- var unknownFields = SwiftProtobuf.UnknownStorage()
- init() {}
- fileprivate var _storage = _StorageClass.defaultInstance
- }
- /// The syntax analysis response message.
- struct Google_Cloud_Language_V1_AnalyzeSyntaxResponse {
- // SwiftProtobuf.Message conformance is added in an extension below. See the
- // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
- // methods supported on all messages.
- /// Sentences in the input document.
- var sentences: [Google_Cloud_Language_V1_Sentence] = []
- /// Tokens, along with their syntactic information, in the input document.
- var tokens: [Google_Cloud_Language_V1_Token] = []
- /// The language of the text, which will be the same as the language specified
- /// in the request or, if not specified, the automatically-detected language.
- /// See [Document.language][google.cloud.language.v1.Document.language] field for more details.
- var language: String = String()
- var unknownFields = SwiftProtobuf.UnknownStorage()
- init() {}
- }
- /// The document classification request message.
- struct Google_Cloud_Language_V1_ClassifyTextRequest {
- // SwiftProtobuf.Message conformance is added in an extension below. See the
- // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
- // methods supported on all messages.
- /// Input document.
- var document: Google_Cloud_Language_V1_Document {
- get {return _storage._document ?? Google_Cloud_Language_V1_Document()}
- set {_uniqueStorage()._document = newValue}
- }
- /// Returns true if `document` has been explicitly set.
- var hasDocument: Bool {return _storage._document != nil}
- /// Clears the value of `document`. Subsequent reads from it will return its default value.
- mutating func clearDocument() {_uniqueStorage()._document = nil}
- var unknownFields = SwiftProtobuf.UnknownStorage()
- init() {}
- fileprivate var _storage = _StorageClass.defaultInstance
- }
- /// The document classification response message.
- struct Google_Cloud_Language_V1_ClassifyTextResponse {
- // SwiftProtobuf.Message conformance is added in an extension below. See the
- // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
- // methods supported on all messages.
- /// Categories representing the input document.
- var categories: [Google_Cloud_Language_V1_ClassificationCategory] = []
- var unknownFields = SwiftProtobuf.UnknownStorage()
- init() {}
- }
- /// The request message for the text annotation API, which can perform multiple
- /// analysis types (sentiment, entities, and syntax) in one call.
- struct Google_Cloud_Language_V1_AnnotateTextRequest {
- // SwiftProtobuf.Message conformance is added in an extension below. See the
- // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
- // methods supported on all messages.
- /// Input document.
- var document: Google_Cloud_Language_V1_Document {
- get {return _storage._document ?? Google_Cloud_Language_V1_Document()}
- set {_uniqueStorage()._document = newValue}
- }
- /// Returns true if `document` has been explicitly set.
- var hasDocument: Bool {return _storage._document != nil}
- /// Clears the value of `document`. Subsequent reads from it will return its default value.
- mutating func clearDocument() {_uniqueStorage()._document = nil}
- /// The enabled features.
- var features: Google_Cloud_Language_V1_AnnotateTextRequest.Features {
- get {return _storage._features ?? Google_Cloud_Language_V1_AnnotateTextRequest.Features()}
- set {_uniqueStorage()._features = newValue}
- }
- /// Returns true if `features` has been explicitly set.
- var hasFeatures: Bool {return _storage._features != nil}
- /// Clears the value of `features`. Subsequent reads from it will return its default value.
- mutating func clearFeatures() {_uniqueStorage()._features = nil}
- /// The encoding type used by the API to calculate offsets.
- var encodingType: Google_Cloud_Language_V1_EncodingType {
- get {return _storage._encodingType}
- set {_uniqueStorage()._encodingType = newValue}
- }
- var unknownFields = SwiftProtobuf.UnknownStorage()
- /// All available features for sentiment, syntax, and semantic analysis.
- /// Setting each one to true will enable that specific analysis for the input.
- struct Features {
- // SwiftProtobuf.Message conformance is added in an extension below. See the
- // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
- // methods supported on all messages.
- /// Extract syntax information.
- var extractSyntax: Bool = false
- /// Extract entities.
- var extractEntities: Bool = false
- /// Extract document-level sentiment.
- var extractDocumentSentiment: Bool = false
- /// Extract entities and their associated sentiment.
- var extractEntitySentiment: Bool = false
- /// Classify the full document into categories.
- var classifyText: Bool = false
- var unknownFields = SwiftProtobuf.UnknownStorage()
- init() {}
- }
- init() {}
- fileprivate var _storage = _StorageClass.defaultInstance
- }
- /// The text annotations response message.
- struct Google_Cloud_Language_V1_AnnotateTextResponse {
- // SwiftProtobuf.Message conformance is added in an extension below. See the
- // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
- // methods supported on all messages.
- /// Sentences in the input document. Populated if the user enables
- /// [AnnotateTextRequest.Features.extract_syntax][google.cloud.language.v1.AnnotateTextRequest.Features.extract_syntax].
- var sentences: [Google_Cloud_Language_V1_Sentence] {
- get {return _storage._sentences}
- set {_uniqueStorage()._sentences = newValue}
- }
- /// Tokens, along with their syntactic information, in the input document.
- /// Populated if the user enables
- /// [AnnotateTextRequest.Features.extract_syntax][google.cloud.language.v1.AnnotateTextRequest.Features.extract_syntax].
- var tokens: [Google_Cloud_Language_V1_Token] {
- get {return _storage._tokens}
- set {_uniqueStorage()._tokens = newValue}
- }
- /// Entities, along with their semantic information, in the input document.
- /// Populated if the user enables
- /// [AnnotateTextRequest.Features.extract_entities][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entities].
- var entities: [Google_Cloud_Language_V1_Entity] {
- get {return _storage._entities}
- set {_uniqueStorage()._entities = newValue}
- }
- /// The overall sentiment for the document. Populated if the user enables
- /// [AnnotateTextRequest.Features.extract_document_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_document_sentiment].
- var documentSentiment: Google_Cloud_Language_V1_Sentiment {
- get {return _storage._documentSentiment ?? Google_Cloud_Language_V1_Sentiment()}
- set {_uniqueStorage()._documentSentiment = newValue}
- }
- /// Returns true if `documentSentiment` has been explicitly set.
- var hasDocumentSentiment: Bool {return _storage._documentSentiment != nil}
- /// Clears the value of `documentSentiment`. Subsequent reads from it will return its default value.
- mutating func clearDocumentSentiment() {_uniqueStorage()._documentSentiment = nil}
- /// The language of the text, which will be the same as the language specified
- /// in the request or, if not specified, the automatically-detected language.
- /// See [Document.language][google.cloud.language.v1.Document.language] field for more details.
- var language: String {
- get {return _storage._language}
- set {_uniqueStorage()._language = newValue}
- }
- /// Categories identified in the input document.
- var categories: [Google_Cloud_Language_V1_ClassificationCategory] {
- get {return _storage._categories}
- set {_uniqueStorage()._categories = newValue}
- }
- var unknownFields = SwiftProtobuf.UnknownStorage()
- init() {}
- fileprivate var _storage = _StorageClass.defaultInstance
- }
- // MARK: - Code below here is support for the SwiftProtobuf runtime.
- fileprivate let _protobuf_package = "google.cloud.language.v1"
- extension Google_Cloud_Language_V1_EncodingType: SwiftProtobuf._ProtoNameProviding {
- static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
- 0: .same(proto: "NONE"),
- 1: .same(proto: "UTF8"),
- 2: .same(proto: "UTF16"),
- 3: .same(proto: "UTF32"),
- ]
- }
- extension Google_Cloud_Language_V1_Document: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
- static let protoMessageName: String = _protobuf_package + ".Document"
- static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
- 1: .same(proto: "type"),
- 2: .same(proto: "content"),
- 3: .standard(proto: "gcs_content_uri"),
- 4: .same(proto: "language"),
- ]
- mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
- while let fieldNumber = try decoder.nextFieldNumber() {
- switch fieldNumber {
- case 1: try decoder.decodeSingularEnumField(value: &self.type)
- case 2:
- if self.source != nil {try decoder.handleConflictingOneOf()}
- var v: String?
- try decoder.decodeSingularStringField(value: &v)
- if let v = v {self.source = .content(v)}
- case 3:
- if self.source != nil {try decoder.handleConflictingOneOf()}
- var v: String?
- try decoder.decodeSingularStringField(value: &v)
- if let v = v {self.source = .gcsContentUri(v)}
- case 4: try decoder.decodeSingularStringField(value: &self.language)
- default: break
- }
- }
- }
- func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
- if self.type != .unspecified {
- try visitor.visitSingularEnumField(value: self.type, fieldNumber: 1)
- }
- switch self.source {
- case .content(let v)?:
- try visitor.visitSingularStringField(value: v, fieldNumber: 2)
- case .gcsContentUri(let v)?:
- try visitor.visitSingularStringField(value: v, fieldNumber: 3)
- case nil: break
- }
- if !self.language.isEmpty {
- try visitor.visitSingularStringField(value: self.language, fieldNumber: 4)
- }
- try unknownFields.traverse(visitor: &visitor)
- }
- static func ==(lhs: Google_Cloud_Language_V1_Document, rhs: Google_Cloud_Language_V1_Document) -> Bool {
- if lhs.type != rhs.type {return false}
- if lhs.source != rhs.source {return false}
- if lhs.language != rhs.language {return false}
- if lhs.unknownFields != rhs.unknownFields {return false}
- return true
- }
- }
- extension Google_Cloud_Language_V1_Document.TypeEnum: SwiftProtobuf._ProtoNameProviding {
- static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
- 0: .same(proto: "TYPE_UNSPECIFIED"),
- 1: .same(proto: "PLAIN_TEXT"),
- 2: .same(proto: "HTML"),
- ]
- }
- extension Google_Cloud_Language_V1_Sentence: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
- static let protoMessageName: String = _protobuf_package + ".Sentence"
- static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
- 1: .same(proto: "text"),
- 2: .same(proto: "sentiment"),
- ]
- fileprivate class _StorageClass {
- var _text: Google_Cloud_Language_V1_TextSpan? = nil
- var _sentiment: Google_Cloud_Language_V1_Sentiment? = nil
- static let defaultInstance = _StorageClass()
- private init() {}
- init(copying source: _StorageClass) {
- _text = source._text
- _sentiment = source._sentiment
- }
- }
- fileprivate mutating func _uniqueStorage() -> _StorageClass {
- if !isKnownUniquelyReferenced(&_storage) {
- _storage = _StorageClass(copying: _storage)
- }
- return _storage
- }
- mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
- _ = _uniqueStorage()
- try withExtendedLifetime(_storage) { (_storage: _StorageClass) in
- while let fieldNumber = try decoder.nextFieldNumber() {
- switch fieldNumber {
- case 1: try decoder.decodeSingularMessageField(value: &_storage._text)
- case 2: try decoder.decodeSingularMessageField(value: &_storage._sentiment)
- default: break
- }
- }
- }
- }
- func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
- try withExtendedLifetime(_storage) { (_storage: _StorageClass) in
- if let v = _storage._text {
- try visitor.visitSingularMessageField(value: v, fieldNumber: 1)
- }
- if let v = _storage._sentiment {
- try visitor.visitSingularMessageField(value: v, fieldNumber: 2)
- }
- }
- try unknownFields.traverse(visitor: &visitor)
- }
- static func ==(lhs: Google_Cloud_Language_V1_Sentence, rhs: Google_Cloud_Language_V1_Sentence) -> Bool {
- if lhs._storage !== rhs._storage {
- let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in
- let _storage = _args.0
- let rhs_storage = _args.1
- if _storage._text != rhs_storage._text {return false}
- if _storage._sentiment != rhs_storage._sentiment {return false}
- return true
- }
- if !storagesAreEqual {return false}
- }
- if lhs.unknownFields != rhs.unknownFields {return false}
- return true
- }
- }
- extension Google_Cloud_Language_V1_Entity: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
- static let protoMessageName: String = _protobuf_package + ".Entity"
- static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
- 1: .same(proto: "name"),
- 2: .same(proto: "type"),
- 3: .same(proto: "metadata"),
- 4: .same(proto: "salience"),
- 5: .same(proto: "mentions"),
- 6: .same(proto: "sentiment"),
- ]
- fileprivate class _StorageClass {
- var _name: String = String()
- var _type: Google_Cloud_Language_V1_Entity.TypeEnum = .unknown
- var _metadata: Dictionary<String,String> = [:]
- var _salience: Float = 0
- var _mentions: [Google_Cloud_Language_V1_EntityMention] = []
- var _sentiment: Google_Cloud_Language_V1_Sentiment? = nil
- static let defaultInstance = _StorageClass()
- private init() {}
- init(copying source: _StorageClass) {
- _name = source._name
- _type = source._type
- _metadata = source._metadata
- _salience = source._salience
- _mentions = source._mentions
- _sentiment = source._sentiment
- }
- }
- fileprivate mutating func _uniqueStorage() -> _StorageClass {
- if !isKnownUniquelyReferenced(&_storage) {
- _storage = _StorageClass(copying: _storage)
- }
- return _storage
- }
- mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
- _ = _uniqueStorage()
- try withExtendedLifetime(_storage) { (_storage: _StorageClass) in
- while let fieldNumber = try decoder.nextFieldNumber() {
- switch fieldNumber {
- case 1: try decoder.decodeSingularStringField(value: &_storage._name)
- case 2: try decoder.decodeSingularEnumField(value: &_storage._type)
- case 3: try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufString,SwiftProtobuf.ProtobufString>.self, value: &_storage._metadata)
- case 4: try decoder.decodeSingularFloatField(value: &_storage._salience)
- case 5: try decoder.decodeRepeatedMessageField(value: &_storage._mentions)
- case 6: try decoder.decodeSingularMessageField(value: &_storage._sentiment)
- default: break
- }
- }
- }
- }
- func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
- try withExtendedLifetime(_storage) { (_storage: _StorageClass) in
- if !_storage._name.isEmpty {
- try visitor.visitSingularStringField(value: _storage._name, fieldNumber: 1)
- }
- if _storage._type != .unknown {
- try visitor.visitSingularEnumField(value: _storage._type, fieldNumber: 2)
- }
- if !_storage._metadata.isEmpty {
- try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufString,SwiftProtobuf.ProtobufString>.self, value: _storage._metadata, fieldNumber: 3)
- }
- if _storage._salience != 0 {
- try visitor.visitSingularFloatField(value: _storage._salience, fieldNumber: 4)
- }
- if !_storage._mentions.isEmpty {
- try visitor.visitRepeatedMessageField(value: _storage._mentions, fieldNumber: 5)
- }
- if let v = _storage._sentiment {
- try visitor.visitSingularMessageField(value: v, fieldNumber: 6)
- }
- }
- try unknownFields.traverse(visitor: &visitor)
- }
- static func ==(lhs: Google_Cloud_Language_V1_Entity, rhs: Google_Cloud_Language_V1_Entity) -> Bool {
- if lhs._storage !== rhs._storage {
- let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in
- let _storage = _args.0
- let rhs_storage = _args.1
- if _storage._name != rhs_storage._name {return false}
- if _storage._type != rhs_storage._type {return false}
- if _storage._metadata != rhs_storage._metadata {return false}
- if _storage._salience != rhs_storage._salience {return false}
- if _storage._mentions != rhs_storage._mentions {return false}
- if _storage._sentiment != rhs_storage._sentiment {return false}
- return true
- }
- if !storagesAreEqual {return false}
- }
- if lhs.unknownFields != rhs.unknownFields {return false}
- return true
- }
- }
- extension Google_Cloud_Language_V1_Entity.TypeEnum: SwiftProtobuf._ProtoNameProviding {
- static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
- 0: .same(proto: "UNKNOWN"),
- 1: .same(proto: "PERSON"),
- 2: .same(proto: "LOCATION"),
- 3: .same(proto: "ORGANIZATION"),
- 4: .same(proto: "EVENT"),
- 5: .same(proto: "WORK_OF_ART"),
- 6: .same(proto: "CONSUMER_GOOD"),
- 7: .same(proto: "OTHER"),
- 9: .same(proto: "PHONE_NUMBER"),
- 10: .same(proto: "ADDRESS"),
- 11: .same(proto: "DATE"),
- 12: .same(proto: "NUMBER"),
- 13: .same(proto: "PRICE"),
- ]
- }
- extension Google_Cloud_Language_V1_Token: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
- static let protoMessageName: String = _protobuf_package + ".Token"
- static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
- 1: .same(proto: "text"),
- 2: .standard(proto: "part_of_speech"),
- 3: .standard(proto: "dependency_edge"),
- 4: .same(proto: "lemma"),
- ]
- fileprivate class _StorageClass {
- var _text: Google_Cloud_Language_V1_TextSpan? = nil
- var _partOfSpeech: Google_Cloud_Language_V1_PartOfSpeech? = nil
- var _dependencyEdge: Google_Cloud_Language_V1_DependencyEdge? = nil
- var _lemma: String = String()
- static let defaultInstance = _StorageClass()
- private init() {}
- init(copying source: _StorageClass) {
- _text = source._text
- _partOfSpeech = source._partOfSpeech
- _dependencyEdge = source._dependencyEdge
- _lemma = source._lemma
- }
- }
- fileprivate mutating func _uniqueStorage() -> _StorageClass {
- if !isKnownUniquelyReferenced(&_storage) {
- _storage = _StorageClass(copying: _storage)
- }
- return _storage
- }
- mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
- _ = _uniqueStorage()
- try withExtendedLifetime(_storage) { (_storage: _StorageClass) in
- while let fieldNumber = try decoder.nextFieldNumber() {
- switch fieldNumber {
- case 1: try decoder.decodeSingularMessageField(value: &_storage._text)
- case 2: try decoder.decodeSingularMessageField(value: &_storage._partOfSpeech)
- case 3: try decoder.decodeSingularMessageField(value: &_storage._dependencyEdge)
- case 4: try decoder.decodeSingularStringField(value: &_storage._lemma)
- default: break
- }
- }
- }
- }
- func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
- try withExtendedLifetime(_storage) { (_storage: _StorageClass) in
- if let v = _storage._text {
- try visitor.visitSingularMessageField(value: v, fieldNumber: 1)
- }
- if let v = _storage._partOfSpeech {
- try visitor.visitSingularMessageField(value: v, fieldNumber: 2)
- }
- if let v = _storage._dependencyEdge {
- try visitor.visitSingularMessageField(value: v, fieldNumber: 3)
- }
- if !_storage._lemma.isEmpty {
- try visitor.visitSingularStringField(value: _storage._lemma, fieldNumber: 4)
- }
- }
- try unknownFields.traverse(visitor: &visitor)
- }
- static func ==(lhs: Google_Cloud_Language_V1_Token, rhs: Google_Cloud_Language_V1_Token) -> Bool {
- if lhs._storage !== rhs._storage {
- let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in
- let _storage = _args.0
- let rhs_storage = _args.1
- if _storage._text != rhs_storage._text {return false}
- if _storage._partOfSpeech != rhs_storage._partOfSpeech {return false}
- if _storage._dependencyEdge != rhs_storage._dependencyEdge {return false}
- if _storage._lemma != rhs_storage._lemma {return false}
- return true
- }
- if !storagesAreEqual {return false}
- }
- if lhs.unknownFields != rhs.unknownFields {return false}
- return true
- }
- }
- extension Google_Cloud_Language_V1_Sentiment: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
- static let protoMessageName: String = _protobuf_package + ".Sentiment"
- static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
- 2: .same(proto: "magnitude"),
- 3: .same(proto: "score"),
- ]
- mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
- while let fieldNumber = try decoder.nextFieldNumber() {
- switch fieldNumber {
- case 2: try decoder.decodeSingularFloatField(value: &self.magnitude)
- case 3: try decoder.decodeSingularFloatField(value: &self.score)
- default: break
- }
- }
- }
- func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
- if self.magnitude != 0 {
- try visitor.visitSingularFloatField(value: self.magnitude, fieldNumber: 2)
- }
- if self.score != 0 {
- try visitor.visitSingularFloatField(value: self.score, fieldNumber: 3)
- }
- try unknownFields.traverse(visitor: &visitor)
- }
- static func ==(lhs: Google_Cloud_Language_V1_Sentiment, rhs: Google_Cloud_Language_V1_Sentiment) -> Bool {
- if lhs.magnitude != rhs.magnitude {return false}
- if lhs.score != rhs.score {return false}
- if lhs.unknownFields != rhs.unknownFields {return false}
- return true
- }
- }
- extension Google_Cloud_Language_V1_PartOfSpeech: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
- static let protoMessageName: String = _protobuf_package + ".PartOfSpeech"
- static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
- 1: .same(proto: "tag"),
- 2: .same(proto: "aspect"),
- 3: .same(proto: "case"),
- 4: .same(proto: "form"),
- 5: .same(proto: "gender"),
- 6: .same(proto: "mood"),
- 7: .same(proto: "number"),
- 8: .same(proto: "person"),
- 9: .same(proto: "proper"),
- 10: .same(proto: "reciprocity"),
- 11: .same(proto: "tense"),
- 12: .same(proto: "voice"),
- ]
- mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
- while let fieldNumber = try decoder.nextFieldNumber() {
- switch fieldNumber {
- case 1: try decoder.decodeSingularEnumField(value: &self.tag)
- case 2: try decoder.decodeSingularEnumField(value: &self.aspect)
- case 3: try decoder.decodeSingularEnumField(value: &self.`case`)
- case 4: try decoder.decodeSingularEnumField(value: &self.form)
- case 5: try decoder.decodeSingularEnumField(value: &self.gender)
- case 6: try decoder.decodeSingularEnumField(value: &self.mood)
- case 7: try decoder.decodeSingularEnumField(value: &self.number)
- case 8: try decoder.decodeSingularEnumField(value: &self.person)
- case 9: try decoder.decodeSingularEnumField(value: &self.proper)
- case 10: try decoder.decodeSingularEnumField(value: &self.reciprocity)
- case 11: try decoder.decodeSingularEnumField(value: &self.tense)
- case 12: try decoder.decodeSingularEnumField(value: &self.voice)
- default: break
- }
- }
- }
- func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
- if self.tag != .unknown {
- try visitor.visitSingularEnumField(value: self.tag, fieldNumber: 1)
- }
- if self.aspect != .unknown {
- try visitor.visitSingularEnumField(value: self.aspect, fieldNumber: 2)
- }
- if self.`case` != .unknown {
- try visitor.visitSingularEnumField(value: self.`case`, fieldNumber: 3)
- }
- if self.form != .unknown {
- try visitor.visitSingularEnumField(value: self.form, fieldNumber: 4)
- }
- if self.gender != .unknown {
- try visitor.visitSingularEnumField(value: self.gender, fieldNumber: 5)
- }
- if self.mood != .unknown {
- try visitor.visitSingularEnumField(value: self.mood, fieldNumber: 6)
- }
- if self.number != .unknown {
- try visitor.visitSingularEnumField(value: self.number, fieldNumber: 7)
- }
- if self.person != .unknown {
- try visitor.visitSingularEnumField(value: self.person, fieldNumber: 8)
- }
- if self.proper != .unknown {
- try visitor.visitSingularEnumField(value: self.proper, fieldNumber: 9)
- }
- if self.reciprocity != .unknown {
- try visitor.visitSingularEnumField(value: self.reciprocity, fieldNumber: 10)
- }
- if self.tense != .unknown {
- try visitor.visitSingularEnumField(value: self.tense, fieldNumber: 11)
- }
- if self.voice != .unknown {
- try visitor.visitSingularEnumField(value: self.voice, fieldNumber: 12)
- }
- try unknownFields.traverse(visitor: &visitor)
- }
- static func ==(lhs: Google_Cloud_Language_V1_PartOfSpeech, rhs: Google_Cloud_Language_V1_PartOfSpeech) -> Bool {
- if lhs.tag != rhs.tag {return false}
- if lhs.aspect != rhs.aspect {return false}
- if lhs.`case` != rhs.`case` {return false}
- if lhs.form != rhs.form {return false}
- if lhs.gender != rhs.gender {return false}
- if lhs.mood != rhs.mood {return false}
- if lhs.number != rhs.number {return false}
- if lhs.person != rhs.person {return false}
- if lhs.proper != rhs.proper {return false}
- if lhs.reciprocity != rhs.reciprocity {return false}
- if lhs.tense != rhs.tense {return false}
- if lhs.voice != rhs.voice {return false}
- if lhs.unknownFields != rhs.unknownFields {return false}
- return true
- }
- }
- extension Google_Cloud_Language_V1_PartOfSpeech.Tag: SwiftProtobuf._ProtoNameProviding {
- static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
- 0: .same(proto: "UNKNOWN"),
- 1: .same(proto: "ADJ"),
- 2: .same(proto: "ADP"),
- 3: .same(proto: "ADV"),
- 4: .same(proto: "CONJ"),
- 5: .same(proto: "DET"),
- 6: .same(proto: "NOUN"),
- 7: .same(proto: "NUM"),
- 8: .same(proto: "PRON"),
- 9: .same(proto: "PRT"),
- 10: .same(proto: "PUNCT"),
- 11: .same(proto: "VERB"),
- 12: .same(proto: "X"),
- 13: .same(proto: "AFFIX"),
- ]
- }
- extension Google_Cloud_Language_V1_PartOfSpeech.Aspect: SwiftProtobuf._ProtoNameProviding {
- static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
- 0: .same(proto: "ASPECT_UNKNOWN"),
- 1: .same(proto: "PERFECTIVE"),
- 2: .same(proto: "IMPERFECTIVE"),
- 3: .same(proto: "PROGRESSIVE"),
- ]
- }
- extension Google_Cloud_Language_V1_PartOfSpeech.Case: SwiftProtobuf._ProtoNameProviding {
- static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
- 0: .same(proto: "CASE_UNKNOWN"),
- 1: .same(proto: "ACCUSATIVE"),
- 2: .same(proto: "ADVERBIAL"),
- 3: .same(proto: "COMPLEMENTIVE"),
- 4: .same(proto: "DATIVE"),
- 5: .same(proto: "GENITIVE"),
- 6: .same(proto: "INSTRUMENTAL"),
- 7: .same(proto: "LOCATIVE"),
- 8: .same(proto: "NOMINATIVE"),
- 9: .same(proto: "OBLIQUE"),
- 10: .same(proto: "PARTITIVE"),
- 11: .same(proto: "PREPOSITIONAL"),
- 12: .same(proto: "REFLEXIVE_CASE"),
- 13: .same(proto: "RELATIVE_CASE"),
- 14: .same(proto: "VOCATIVE"),
- ]
- }
- extension Google_Cloud_Language_V1_PartOfSpeech.Form: SwiftProtobuf._ProtoNameProviding {
- static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
- 0: .same(proto: "FORM_UNKNOWN"),
- 1: .same(proto: "ADNOMIAL"),
- 2: .same(proto: "AUXILIARY"),
- 3: .same(proto: "COMPLEMENTIZER"),
- 4: .same(proto: "FINAL_ENDING"),
- 5: .same(proto: "GERUND"),
- 6: .same(proto: "REALIS"),
- 7: .same(proto: "IRREALIS"),
- 8: .same(proto: "SHORT"),
- 9: .same(proto: "LONG"),
- 10: .same(proto: "ORDER"),
- 11: .same(proto: "SPECIFIC"),
- ]
- }
- extension Google_Cloud_Language_V1_PartOfSpeech.Gender: SwiftProtobuf._ProtoNameProviding {
- static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
- 0: .same(proto: "GENDER_UNKNOWN"),
- 1: .same(proto: "FEMININE"),
- 2: .same(proto: "MASCULINE"),
- 3: .same(proto: "NEUTER"),
- ]
- }
- extension Google_Cloud_Language_V1_PartOfSpeech.Mood: SwiftProtobuf._ProtoNameProviding {
- static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
- 0: .same(proto: "MOOD_UNKNOWN"),
- 1: .same(proto: "CONDITIONAL_MOOD"),
- 2: .same(proto: "IMPERATIVE"),
- 3: .same(proto: "INDICATIVE"),
- 4: .same(proto: "INTERROGATIVE"),
- 5: .same(proto: "JUSSIVE"),
- 6: .same(proto: "SUBJUNCTIVE"),
- ]
- }
- extension Google_Cloud_Language_V1_PartOfSpeech.Number: SwiftProtobuf._ProtoNameProviding {
- static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
- 0: .same(proto: "NUMBER_UNKNOWN"),
- 1: .same(proto: "SINGULAR"),
- 2: .same(proto: "PLURAL"),
- 3: .same(proto: "DUAL"),
- ]
- }
- extension Google_Cloud_Language_V1_PartOfSpeech.Person: SwiftProtobuf._ProtoNameProviding {
- static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
- 0: .same(proto: "PERSON_UNKNOWN"),
- 1: .same(proto: "FIRST"),
- 2: .same(proto: "SECOND"),
- 3: .same(proto: "THIRD"),
- 4: .same(proto: "REFLEXIVE_PERSON"),
- ]
- }
- extension Google_Cloud_Language_V1_PartOfSpeech.Proper: SwiftProtobuf._ProtoNameProviding {
- static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
- 0: .same(proto: "PROPER_UNKNOWN"),
- 1: .same(proto: "PROPER"),
- 2: .same(proto: "NOT_PROPER"),
- ]
- }
- extension Google_Cloud_Language_V1_PartOfSpeech.Reciprocity: SwiftProtobuf._ProtoNameProviding {
- static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
- 0: .same(proto: "RECIPROCITY_UNKNOWN"),
- 1: .same(proto: "RECIPROCAL"),
- 2: .same(proto: "NON_RECIPROCAL"),
- ]
- }
- extension Google_Cloud_Language_V1_PartOfSpeech.Tense: SwiftProtobuf._ProtoNameProviding {
- static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
- 0: .same(proto: "TENSE_UNKNOWN"),
- 1: .same(proto: "CONDITIONAL_TENSE"),
- 2: .same(proto: "FUTURE"),
- 3: .same(proto: "PAST"),
- 4: .same(proto: "PRESENT"),
- 5: .same(proto: "IMPERFECT"),
- 6: .same(proto: "PLUPERFECT"),
- ]
- }
- extension Google_Cloud_Language_V1_PartOfSpeech.Voice: SwiftProtobuf._ProtoNameProviding {
- static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
- 0: .same(proto: "VOICE_UNKNOWN"),
- 1: .same(proto: "ACTIVE"),
- 2: .same(proto: "CAUSATIVE"),
- 3: .same(proto: "PASSIVE"),
- ]
- }
- extension Google_Cloud_Language_V1_DependencyEdge: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
- static let protoMessageName: String = _protobuf_package + ".DependencyEdge"
- static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
- 1: .standard(proto: "head_token_index"),
- 2: .same(proto: "label"),
- ]
- mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
- while let fieldNumber = try decoder.nextFieldNumber() {
- switch fieldNumber {
- case 1: try decoder.decodeSingularInt32Field(value: &self.headTokenIndex)
- case 2: try decoder.decodeSingularEnumField(value: &self.label)
- default: break
- }
- }
- }
- func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
- if self.headTokenIndex != 0 {
- try visitor.visitSingularInt32Field(value: self.headTokenIndex, fieldNumber: 1)
- }
- if self.label != .unknown {
- try visitor.visitSingularEnumField(value: self.label, fieldNumber: 2)
- }
- try unknownFields.traverse(visitor: &visitor)
- }
- static func ==(lhs: Google_Cloud_Language_V1_DependencyEdge, rhs: Google_Cloud_Language_V1_DependencyEdge) -> Bool {
- if lhs.headTokenIndex != rhs.headTokenIndex {return false}
- if lhs.label != rhs.label {return false}
- if lhs.unknownFields != rhs.unknownFields {return false}
- return true
- }
- }
- extension Google_Cloud_Language_V1_DependencyEdge.Label: SwiftProtobuf._ProtoNameProviding {
- static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
- 0: .same(proto: "UNKNOWN"),
- 1: .same(proto: "ABBREV"),
- 2: .same(proto: "ACOMP"),
- 3: .same(proto: "ADVCL"),
- 4: .same(proto: "ADVMOD"),
- 5: .same(proto: "AMOD"),
- 6: .same(proto: "APPOS"),
- 7: .same(proto: "ATTR"),
- 8: .same(proto: "AUX"),
- 9: .same(proto: "AUXPASS"),
- 10: .same(proto: "CC"),
- 11: .same(proto: "CCOMP"),
- 12: .same(proto: "CONJ"),
- 13: .same(proto: "CSUBJ"),
- 14: .same(proto: "CSUBJPASS"),
- 15: .same(proto: "DEP"),
- 16: .same(proto: "DET"),
- 17: .same(proto: "DISCOURSE"),
- 18: .same(proto: "DOBJ"),
- 19: .same(proto: "EXPL"),
- 20: .same(proto: "GOESWITH"),
- 21: .same(proto: "IOBJ"),
- 22: .same(proto: "MARK"),
- 23: .same(proto: "MWE"),
- 24: .same(proto: "MWV"),
- 25: .same(proto: "NEG"),
- 26: .same(proto: "NN"),
- 27: .same(proto: "NPADVMOD"),
- 28: .same(proto: "NSUBJ"),
- 29: .same(proto: "NSUBJPASS"),
- 30: .same(proto: "NUM"),
- 31: .same(proto: "NUMBER"),
- 32: .same(proto: "P"),
- 33: .same(proto: "PARATAXIS"),
- 34: .same(proto: "PARTMOD"),
- 35: .same(proto: "PCOMP"),
- 36: .same(proto: "POBJ"),
- 37: .same(proto: "POSS"),
- 38: .same(proto: "POSTNEG"),
- 39: .same(proto: "PRECOMP"),
- 40: .same(proto: "PRECONJ"),
- 41: .same(proto: "PREDET"),
- 42: .same(proto: "PREF"),
- 43: .same(proto: "PREP"),
- 44: .same(proto: "PRONL"),
- 45: .same(proto: "PRT"),
- 46: .same(proto: "PS"),
- 47: .same(proto: "QUANTMOD"),
- 48: .same(proto: "RCMOD"),
- 49: .same(proto: "RCMODREL"),
- 50: .same(proto: "RDROP"),
- 51: .same(proto: "REF"),
- 52: .same(proto: "REMNANT"),
- 53: .same(proto: "REPARANDUM"),
- 54: .same(proto: "ROOT"),
- 55: .same(proto: "SNUM"),
- 56: .same(proto: "SUFF"),
- 57: .same(proto: "TMOD"),
- 58: .same(proto: "TOPIC"),
- 59: .same(proto: "VMOD"),
- 60: .same(proto: "VOCATIVE"),
- 61: .same(proto: "XCOMP"),
- 62: .same(proto: "SUFFIX"),
- 63: .same(proto: "TITLE"),
- 64: .same(proto: "ADVPHMOD"),
- 65: .same(proto: "AUXCAUS"),
- 66: .same(proto: "AUXVV"),
- 67: .same(proto: "DTMOD"),
- 68: .same(proto: "FOREIGN"),
- 69: .same(proto: "KW"),
- 70: .same(proto: "LIST"),
- 71: .same(proto: "NOMC"),
- 72: .same(proto: "NOMCSUBJ"),
- 73: .same(proto: "NOMCSUBJPASS"),
- 74: .same(proto: "NUMC"),
- 75: .same(proto: "COP"),
- 76: .same(proto: "DISLOCATED"),
- 77: .same(proto: "ASP"),
- 78: .same(proto: "GMOD"),
- 79: .same(proto: "GOBJ"),
- 80: .same(proto: "INFMOD"),
- 81: .same(proto: "MES"),
- 82: .same(proto: "NCOMP"),
- ]
- }
- extension Google_Cloud_Language_V1_EntityMention: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
- static let protoMessageName: String = _protobuf_package + ".EntityMention"
- static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
- 1: .same(proto: "text"),
- 2: .same(proto: "type"),
- 3: .same(proto: "sentiment"),
- ]
- fileprivate class _StorageClass {
- var _text: Google_Cloud_Language_V1_TextSpan? = nil
- var _type: Google_Cloud_Language_V1_EntityMention.TypeEnum = .unknown
- var _sentiment: Google_Cloud_Language_V1_Sentiment? = nil
- static let defaultInstance = _StorageClass()
- private init() {}
- init(copying source: _StorageClass) {
- _text = source._text
- _type = source._type
- _sentiment = source._sentiment
- }
- }
- fileprivate mutating func _uniqueStorage() -> _StorageClass {
- if !isKnownUniquelyReferenced(&_storage) {
- _storage = _StorageClass(copying: _storage)
- }
- return _storage
- }
- mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
- _ = _uniqueStorage()
- try withExtendedLifetime(_storage) { (_storage: _StorageClass) in
- while let fieldNumber = try decoder.nextFieldNumber() {
- switch fieldNumber {
- case 1: try decoder.decodeSingularMessageField(value: &_storage._text)
- case 2: try decoder.decodeSingularEnumField(value: &_storage._type)
- case 3: try decoder.decodeSingularMessageField(value: &_storage._sentiment)
- default: break
- }
- }
- }
- }
- func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
- try withExtendedLifetime(_storage) { (_storage: _StorageClass) in
- if let v = _storage._text {
- try visitor.visitSingularMessageField(value: v, fieldNumber: 1)
- }
- if _storage._type != .unknown {
- try visitor.visitSingularEnumField(value: _storage._type, fieldNumber: 2)
- }
- if let v = _storage._sentiment {
- try visitor.visitSingularMessageField(value: v, fieldNumber: 3)
- }
- }
- try unknownFields.traverse(visitor: &visitor)
- }
- static func ==(lhs: Google_Cloud_Language_V1_EntityMention, rhs: Google_Cloud_Language_V1_EntityMention) -> Bool {
- if lhs._storage !== rhs._storage {
- let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in
- let _storage = _args.0
- let rhs_storage = _args.1
- if _storage._text != rhs_storage._text {return false}
- if _storage._type != rhs_storage._type {return false}
- if _storage._sentiment != rhs_storage._sentiment {return false}
- return true
- }
- if !storagesAreEqual {return false}
- }
- if lhs.unknownFields != rhs.unknownFields {return false}
- return true
- }
- }
- extension Google_Cloud_Language_V1_EntityMention.TypeEnum: SwiftProtobuf._ProtoNameProviding {
- static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
- 0: .same(proto: "TYPE_UNKNOWN"),
- 1: .same(proto: "PROPER"),
- 2: .same(proto: "COMMON"),
- ]
- }
- extension Google_Cloud_Language_V1_TextSpan: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
- static let protoMessageName: String = _protobuf_package + ".TextSpan"
- static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
- 1: .same(proto: "content"),
- 2: .standard(proto: "begin_offset"),
- ]
- mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
- while let fieldNumber = try decoder.nextFieldNumber() {
- switch fieldNumber {
- case 1: try decoder.decodeSingularStringField(value: &self.content)
- case 2: try decoder.decodeSingularInt32Field(value: &self.beginOffset)
- default: break
- }
- }
- }
- func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
- if !self.content.isEmpty {
- try visitor.visitSingularStringField(value: self.content, fieldNumber: 1)
- }
- if self.beginOffset != 0 {
- try visitor.visitSingularInt32Field(value: self.beginOffset, fieldNumber: 2)
- }
- try unknownFields.traverse(visitor: &visitor)
- }
- static func ==(lhs: Google_Cloud_Language_V1_TextSpan, rhs: Google_Cloud_Language_V1_TextSpan) -> Bool {
- if lhs.content != rhs.content {return false}
- if lhs.beginOffset != rhs.beginOffset {return false}
- if lhs.unknownFields != rhs.unknownFields {return false}
- return true
- }
- }
- extension Google_Cloud_Language_V1_ClassificationCategory: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
- static let protoMessageName: String = _protobuf_package + ".ClassificationCategory"
- static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
- 1: .same(proto: "name"),
- 2: .same(proto: "confidence"),
- ]
- mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
- while let fieldNumber = try decoder.nextFieldNumber() {
- switch fieldNumber {
- case 1: try decoder.decodeSingularStringField(value: &self.name)
- case 2: try decoder.decodeSingularFloatField(value: &self.confidence)
- default: break
- }
- }
- }
- func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
- if !self.name.isEmpty {
- try visitor.visitSingularStringField(value: self.name, fieldNumber: 1)
- }
- if self.confidence != 0 {
- try visitor.visitSingularFloatField(value: self.confidence, fieldNumber: 2)
- }
- try unknownFields.traverse(visitor: &visitor)
- }
- static func ==(lhs: Google_Cloud_Language_V1_ClassificationCategory, rhs: Google_Cloud_Language_V1_ClassificationCategory) -> Bool {
- if lhs.name != rhs.name {return false}
- if lhs.confidence != rhs.confidence {return false}
- if lhs.unknownFields != rhs.unknownFields {return false}
- return true
- }
- }
- extension Google_Cloud_Language_V1_AnalyzeSentimentRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
- static let protoMessageName: String = _protobuf_package + ".AnalyzeSentimentRequest"
- static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
- 1: .same(proto: "document"),
- 2: .standard(proto: "encoding_type"),
- ]
- fileprivate class _StorageClass {
- var _document: Google_Cloud_Language_V1_Document? = nil
- var _encodingType: Google_Cloud_Language_V1_EncodingType = .none
- static let defaultInstance = _StorageClass()
- private init() {}
- init(copying source: _StorageClass) {
- _document = source._document
- _encodingType = source._encodingType
- }
- }
- fileprivate mutating func _uniqueStorage() -> _StorageClass {
- if !isKnownUniquelyReferenced(&_storage) {
- _storage = _StorageClass(copying: _storage)
- }
- return _storage
- }
- mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
- _ = _uniqueStorage()
- try withExtendedLifetime(_storage) { (_storage: _StorageClass) in
- while let fieldNumber = try decoder.nextFieldNumber() {
- switch fieldNumber {
- case 1: try decoder.decodeSingularMessageField(value: &_storage._document)
- case 2: try decoder.decodeSingularEnumField(value: &_storage._encodingType)
- default: break
- }
- }
- }
- }
- func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
- try withExtendedLifetime(_storage) { (_storage: _StorageClass) in
- if let v = _storage._document {
- try visitor.visitSingularMessageField(value: v, fieldNumber: 1)
- }
- if _storage._encodingType != .none {
- try visitor.visitSingularEnumField(value: _storage._encodingType, fieldNumber: 2)
- }
- }
- try unknownFields.traverse(visitor: &visitor)
- }
- static func ==(lhs: Google_Cloud_Language_V1_AnalyzeSentimentRequest, rhs: Google_Cloud_Language_V1_AnalyzeSentimentRequest) -> Bool {
- if lhs._storage !== rhs._storage {
- let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in
- let _storage = _args.0
- let rhs_storage = _args.1
- if _storage._document != rhs_storage._document {return false}
- if _storage._encodingType != rhs_storage._encodingType {return false}
- return true
- }
- if !storagesAreEqual {return false}
- }
- if lhs.unknownFields != rhs.unknownFields {return false}
- return true
- }
- }
- extension Google_Cloud_Language_V1_AnalyzeSentimentResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
- static let protoMessageName: String = _protobuf_package + ".AnalyzeSentimentResponse"
- static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
- 1: .standard(proto: "document_sentiment"),
- 2: .same(proto: "language"),
- 3: .same(proto: "sentences"),
- ]
- fileprivate class _StorageClass {
- var _documentSentiment: Google_Cloud_Language_V1_Sentiment? = nil
- var _language: String = String()
- var _sentences: [Google_Cloud_Language_V1_Sentence] = []
- static let defaultInstance = _StorageClass()
- private init() {}
- init(copying source: _StorageClass) {
- _documentSentiment = source._documentSentiment
- _language = source._language
- _sentences = source._sentences
- }
- }
- fileprivate mutating func _uniqueStorage() -> _StorageClass {
- if !isKnownUniquelyReferenced(&_storage) {
- _storage = _StorageClass(copying: _storage)
- }
- return _storage
- }
- mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
- _ = _uniqueStorage()
- try withExtendedLifetime(_storage) { (_storage: _StorageClass) in
- while let fieldNumber = try decoder.nextFieldNumber() {
- switch fieldNumber {
- case 1: try decoder.decodeSingularMessageField(value: &_storage._documentSentiment)
- case 2: try decoder.decodeSingularStringField(value: &_storage._language)
- case 3: try decoder.decodeRepeatedMessageField(value: &_storage._sentences)
- default: break
- }
- }
- }
- }
- func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
- try withExtendedLifetime(_storage) { (_storage: _StorageClass) in
- if let v = _storage._documentSentiment {
- try visitor.visitSingularMessageField(value: v, fieldNumber: 1)
- }
- if !_storage._language.isEmpty {
- try visitor.visitSingularStringField(value: _storage._language, fieldNumber: 2)
- }
- if !_storage._sentences.isEmpty {
- try visitor.visitRepeatedMessageField(value: _storage._sentences, fieldNumber: 3)
- }
- }
- try unknownFields.traverse(visitor: &visitor)
- }
- static func ==(lhs: Google_Cloud_Language_V1_AnalyzeSentimentResponse, rhs: Google_Cloud_Language_V1_AnalyzeSentimentResponse) -> Bool {
- if lhs._storage !== rhs._storage {
- let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in
- let _storage = _args.0
- let rhs_storage = _args.1
- if _storage._documentSentiment != rhs_storage._documentSentiment {return false}
- if _storage._language != rhs_storage._language {return false}
- if _storage._sentences != rhs_storage._sentences {return false}
- return true
- }
- if !storagesAreEqual {return false}
- }
- if lhs.unknownFields != rhs.unknownFields {return false}
- return true
- }
- }
- extension Google_Cloud_Language_V1_AnalyzeEntitySentimentRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
- static let protoMessageName: String = _protobuf_package + ".AnalyzeEntitySentimentRequest"
- static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
- 1: .same(proto: "document"),
- 2: .standard(proto: "encoding_type"),
- ]
- fileprivate class _StorageClass {
- var _document: Google_Cloud_Language_V1_Document? = nil
- var _encodingType: Google_Cloud_Language_V1_EncodingType = .none
- static let defaultInstance = _StorageClass()
- private init() {}
- init(copying source: _StorageClass) {
- _document = source._document
- _encodingType = source._encodingType
- }
- }
- fileprivate mutating func _uniqueStorage() -> _StorageClass {
- if !isKnownUniquelyReferenced(&_storage) {
- _storage = _StorageClass(copying: _storage)
- }
- return _storage
- }
- mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
- _ = _uniqueStorage()
- try withExtendedLifetime(_storage) { (_storage: _StorageClass) in
- while let fieldNumber = try decoder.nextFieldNumber() {
- switch fieldNumber {
- case 1: try decoder.decodeSingularMessageField(value: &_storage._document)
- case 2: try decoder.decodeSingularEnumField(value: &_storage._encodingType)
- default: break
- }
- }
- }
- }
- func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
- try withExtendedLifetime(_storage) { (_storage: _StorageClass) in
- if let v = _storage._document {
- try visitor.visitSingularMessageField(value: v, fieldNumber: 1)
- }
- if _storage._encodingType != .none {
- try visitor.visitSingularEnumField(value: _storage._encodingType, fieldNumber: 2)
- }
- }
- try unknownFields.traverse(visitor: &visitor)
- }
- static func ==(lhs: Google_Cloud_Language_V1_AnalyzeEntitySentimentRequest, rhs: Google_Cloud_Language_V1_AnalyzeEntitySentimentRequest) -> Bool {
- if lhs._storage !== rhs._storage {
- let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in
- let _storage = _args.0
- let rhs_storage = _args.1
- if _storage._document != rhs_storage._document {return false}
- if _storage._encodingType != rhs_storage._encodingType {return false}
- return true
- }
- if !storagesAreEqual {return false}
- }
- if lhs.unknownFields != rhs.unknownFields {return false}
- return true
- }
- }
- extension Google_Cloud_Language_V1_AnalyzeEntitySentimentResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
- static let protoMessageName: String = _protobuf_package + ".AnalyzeEntitySentimentResponse"
- static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
- 1: .same(proto: "entities"),
- 2: .same(proto: "language"),
- ]
- mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
- while let fieldNumber = try decoder.nextFieldNumber() {
- switch fieldNumber {
- case 1: try decoder.decodeRepeatedMessageField(value: &self.entities)
- case 2: try decoder.decodeSingularStringField(value: &self.language)
- default: break
- }
- }
- }
- func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
- if !self.entities.isEmpty {
- try visitor.visitRepeatedMessageField(value: self.entities, fieldNumber: 1)
- }
- if !self.language.isEmpty {
- try visitor.visitSingularStringField(value: self.language, fieldNumber: 2)
- }
- try unknownFields.traverse(visitor: &visitor)
- }
- static func ==(lhs: Google_Cloud_Language_V1_AnalyzeEntitySentimentResponse, rhs: Google_Cloud_Language_V1_AnalyzeEntitySentimentResponse) -> Bool {
- if lhs.entities != rhs.entities {return false}
- if lhs.language != rhs.language {return false}
- if lhs.unknownFields != rhs.unknownFields {return false}
- return true
- }
- }
- extension Google_Cloud_Language_V1_AnalyzeEntitiesRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
- static let protoMessageName: String = _protobuf_package + ".AnalyzeEntitiesRequest"
- static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
- 1: .same(proto: "document"),
- 2: .standard(proto: "encoding_type"),
- ]
- fileprivate class _StorageClass {
- var _document: Google_Cloud_Language_V1_Document? = nil
- var _encodingType: Google_Cloud_Language_V1_EncodingType = .none
- static let defaultInstance = _StorageClass()
- private init() {}
- init(copying source: _StorageClass) {
- _document = source._document
- _encodingType = source._encodingType
- }
- }
- fileprivate mutating func _uniqueStorage() -> _StorageClass {
- if !isKnownUniquelyReferenced(&_storage) {
- _storage = _StorageClass(copying: _storage)
- }
- return _storage
- }
- mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
- _ = _uniqueStorage()
- try withExtendedLifetime(_storage) { (_storage: _StorageClass) in
- while let fieldNumber = try decoder.nextFieldNumber() {
- switch fieldNumber {
- case 1: try decoder.decodeSingularMessageField(value: &_storage._document)
- case 2: try decoder.decodeSingularEnumField(value: &_storage._encodingType)
- default: break
- }
- }
- }
- }
- func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
- try withExtendedLifetime(_storage) { (_storage: _StorageClass) in
- if let v = _storage._document {
- try visitor.visitSingularMessageField(value: v, fieldNumber: 1)
- }
- if _storage._encodingType != .none {
- try visitor.visitSingularEnumField(value: _storage._encodingType, fieldNumber: 2)
- }
- }
- try unknownFields.traverse(visitor: &visitor)
- }
- static func ==(lhs: Google_Cloud_Language_V1_AnalyzeEntitiesRequest, rhs: Google_Cloud_Language_V1_AnalyzeEntitiesRequest) -> Bool {
- if lhs._storage !== rhs._storage {
- let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in
- let _storage = _args.0
- let rhs_storage = _args.1
- if _storage._document != rhs_storage._document {return false}
- if _storage._encodingType != rhs_storage._encodingType {return false}
- return true
- }
- if !storagesAreEqual {return false}
- }
- if lhs.unknownFields != rhs.unknownFields {return false}
- return true
- }
- }
- extension Google_Cloud_Language_V1_AnalyzeEntitiesResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
- static let protoMessageName: String = _protobuf_package + ".AnalyzeEntitiesResponse"
- static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
- 1: .same(proto: "entities"),
- 2: .same(proto: "language"),
- ]
- mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
- while let fieldNumber = try decoder.nextFieldNumber() {
- switch fieldNumber {
- case 1: try decoder.decodeRepeatedMessageField(value: &self.entities)
- case 2: try decoder.decodeSingularStringField(value: &self.language)
- default: break
- }
- }
- }
- func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
- if !self.entities.isEmpty {
- try visitor.visitRepeatedMessageField(value: self.entities, fieldNumber: 1)
- }
- if !self.language.isEmpty {
- try visitor.visitSingularStringField(value: self.language, fieldNumber: 2)
- }
- try unknownFields.traverse(visitor: &visitor)
- }
- static func ==(lhs: Google_Cloud_Language_V1_AnalyzeEntitiesResponse, rhs: Google_Cloud_Language_V1_AnalyzeEntitiesResponse) -> Bool {
- if lhs.entities != rhs.entities {return false}
- if lhs.language != rhs.language {return false}
- if lhs.unknownFields != rhs.unknownFields {return false}
- return true
- }
- }
- extension Google_Cloud_Language_V1_AnalyzeSyntaxRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
- static let protoMessageName: String = _protobuf_package + ".AnalyzeSyntaxRequest"
- static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
- 1: .same(proto: "document"),
- 2: .standard(proto: "encoding_type"),
- ]
- fileprivate class _StorageClass {
- var _document: Google_Cloud_Language_V1_Document? = nil
- var _encodingType: Google_Cloud_Language_V1_EncodingType = .none
- static let defaultInstance = _StorageClass()
- private init() {}
- init(copying source: _StorageClass) {
- _document = source._document
- _encodingType = source._encodingType
- }
- }
- fileprivate mutating func _uniqueStorage() -> _StorageClass {
- if !isKnownUniquelyReferenced(&_storage) {
- _storage = _StorageClass(copying: _storage)
- }
- return _storage
- }
- mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
- _ = _uniqueStorage()
- try withExtendedLifetime(_storage) { (_storage: _StorageClass) in
- while let fieldNumber = try decoder.nextFieldNumber() {
- switch fieldNumber {
- case 1: try decoder.decodeSingularMessageField(value: &_storage._document)
- case 2: try decoder.decodeSingularEnumField(value: &_storage._encodingType)
- default: break
- }
- }
- }
- }
- func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
- try withExtendedLifetime(_storage) { (_storage: _StorageClass) in
- if let v = _storage._document {
- try visitor.visitSingularMessageField(value: v, fieldNumber: 1)
- }
- if _storage._encodingType != .none {
- try visitor.visitSingularEnumField(value: _storage._encodingType, fieldNumber: 2)
- }
- }
- try unknownFields.traverse(visitor: &visitor)
- }
- static func ==(lhs: Google_Cloud_Language_V1_AnalyzeSyntaxRequest, rhs: Google_Cloud_Language_V1_AnalyzeSyntaxRequest) -> Bool {
- if lhs._storage !== rhs._storage {
- let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in
- let _storage = _args.0
- let rhs_storage = _args.1
- if _storage._document != rhs_storage._document {return false}
- if _storage._encodingType != rhs_storage._encodingType {return false}
- return true
- }
- if !storagesAreEqual {return false}
- }
- if lhs.unknownFields != rhs.unknownFields {return false}
- return true
- }
- }
- extension Google_Cloud_Language_V1_AnalyzeSyntaxResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
- static let protoMessageName: String = _protobuf_package + ".AnalyzeSyntaxResponse"
- static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
- 1: .same(proto: "sentences"),
- 2: .same(proto: "tokens"),
- 3: .same(proto: "language"),
- ]
- mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
- while let fieldNumber = try decoder.nextFieldNumber() {
- switch fieldNumber {
- case 1: try decoder.decodeRepeatedMessageField(value: &self.sentences)
- case 2: try decoder.decodeRepeatedMessageField(value: &self.tokens)
- case 3: try decoder.decodeSingularStringField(value: &self.language)
- default: break
- }
- }
- }
- func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
- if !self.sentences.isEmpty {
- try visitor.visitRepeatedMessageField(value: self.sentences, fieldNumber: 1)
- }
- if !self.tokens.isEmpty {
- try visitor.visitRepeatedMessageField(value: self.tokens, fieldNumber: 2)
- }
- if !self.language.isEmpty {
- try visitor.visitSingularStringField(value: self.language, fieldNumber: 3)
- }
- try unknownFields.traverse(visitor: &visitor)
- }
- static func ==(lhs: Google_Cloud_Language_V1_AnalyzeSyntaxResponse, rhs: Google_Cloud_Language_V1_AnalyzeSyntaxResponse) -> Bool {
- if lhs.sentences != rhs.sentences {return false}
- if lhs.tokens != rhs.tokens {return false}
- if lhs.language != rhs.language {return false}
- if lhs.unknownFields != rhs.unknownFields {return false}
- return true
- }
- }
- extension Google_Cloud_Language_V1_ClassifyTextRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
- static let protoMessageName: String = _protobuf_package + ".ClassifyTextRequest"
- static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
- 1: .same(proto: "document"),
- ]
- fileprivate class _StorageClass {
- var _document: Google_Cloud_Language_V1_Document? = nil
- static let defaultInstance = _StorageClass()
- private init() {}
- init(copying source: _StorageClass) {
- _document = source._document
- }
- }
- fileprivate mutating func _uniqueStorage() -> _StorageClass {
- if !isKnownUniquelyReferenced(&_storage) {
- _storage = _StorageClass(copying: _storage)
- }
- return _storage
- }
- mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
- _ = _uniqueStorage()
- try withExtendedLifetime(_storage) { (_storage: _StorageClass) in
- while let fieldNumber = try decoder.nextFieldNumber() {
- switch fieldNumber {
- case 1: try decoder.decodeSingularMessageField(value: &_storage._document)
- default: break
- }
- }
- }
- }
- func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
- try withExtendedLifetime(_storage) { (_storage: _StorageClass) in
- if let v = _storage._document {
- try visitor.visitSingularMessageField(value: v, fieldNumber: 1)
- }
- }
- try unknownFields.traverse(visitor: &visitor)
- }
- static func ==(lhs: Google_Cloud_Language_V1_ClassifyTextRequest, rhs: Google_Cloud_Language_V1_ClassifyTextRequest) -> Bool {
- if lhs._storage !== rhs._storage {
- let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in
- let _storage = _args.0
- let rhs_storage = _args.1
- if _storage._document != rhs_storage._document {return false}
- return true
- }
- if !storagesAreEqual {return false}
- }
- if lhs.unknownFields != rhs.unknownFields {return false}
- return true
- }
- }
- extension Google_Cloud_Language_V1_ClassifyTextResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
- static let protoMessageName: String = _protobuf_package + ".ClassifyTextResponse"
- static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
- 1: .same(proto: "categories"),
- ]
- mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
- while let fieldNumber = try decoder.nextFieldNumber() {
- switch fieldNumber {
- case 1: try decoder.decodeRepeatedMessageField(value: &self.categories)
- default: break
- }
- }
- }
- func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
- if !self.categories.isEmpty {
- try visitor.visitRepeatedMessageField(value: self.categories, fieldNumber: 1)
- }
- try unknownFields.traverse(visitor: &visitor)
- }
- static func ==(lhs: Google_Cloud_Language_V1_ClassifyTextResponse, rhs: Google_Cloud_Language_V1_ClassifyTextResponse) -> Bool {
- if lhs.categories != rhs.categories {return false}
- if lhs.unknownFields != rhs.unknownFields {return false}
- return true
- }
- }
- extension Google_Cloud_Language_V1_AnnotateTextRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
- static let protoMessageName: String = _protobuf_package + ".AnnotateTextRequest"
- static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
- 1: .same(proto: "document"),
- 2: .same(proto: "features"),
- 3: .standard(proto: "encoding_type"),
- ]
- fileprivate class _StorageClass {
- var _document: Google_Cloud_Language_V1_Document? = nil
- var _features: Google_Cloud_Language_V1_AnnotateTextRequest.Features? = nil
- var _encodingType: Google_Cloud_Language_V1_EncodingType = .none
- static let defaultInstance = _StorageClass()
- private init() {}
- init(copying source: _StorageClass) {
- _document = source._document
- _features = source._features
- _encodingType = source._encodingType
- }
- }
- fileprivate mutating func _uniqueStorage() -> _StorageClass {
- if !isKnownUniquelyReferenced(&_storage) {
- _storage = _StorageClass(copying: _storage)
- }
- return _storage
- }
- mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
- _ = _uniqueStorage()
- try withExtendedLifetime(_storage) { (_storage: _StorageClass) in
- while let fieldNumber = try decoder.nextFieldNumber() {
- switch fieldNumber {
- case 1: try decoder.decodeSingularMessageField(value: &_storage._document)
- case 2: try decoder.decodeSingularMessageField(value: &_storage._features)
- case 3: try decoder.decodeSingularEnumField(value: &_storage._encodingType)
- default: break
- }
- }
- }
- }
- func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
- try withExtendedLifetime(_storage) { (_storage: _StorageClass) in
- if let v = _storage._document {
- try visitor.visitSingularMessageField(value: v, fieldNumber: 1)
- }
- if let v = _storage._features {
- try visitor.visitSingularMessageField(value: v, fieldNumber: 2)
- }
- if _storage._encodingType != .none {
- try visitor.visitSingularEnumField(value: _storage._encodingType, fieldNumber: 3)
- }
- }
- try unknownFields.traverse(visitor: &visitor)
- }
- static func ==(lhs: Google_Cloud_Language_V1_AnnotateTextRequest, rhs: Google_Cloud_Language_V1_AnnotateTextRequest) -> Bool {
- if lhs._storage !== rhs._storage {
- let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in
- let _storage = _args.0
- let rhs_storage = _args.1
- if _storage._document != rhs_storage._document {return false}
- if _storage._features != rhs_storage._features {return false}
- if _storage._encodingType != rhs_storage._encodingType {return false}
- return true
- }
- if !storagesAreEqual {return false}
- }
- if lhs.unknownFields != rhs.unknownFields {return false}
- return true
- }
- }
- extension Google_Cloud_Language_V1_AnnotateTextRequest.Features: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
- static let protoMessageName: String = Google_Cloud_Language_V1_AnnotateTextRequest.protoMessageName + ".Features"
- static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
- 1: .standard(proto: "extract_syntax"),
- 2: .standard(proto: "extract_entities"),
- 3: .standard(proto: "extract_document_sentiment"),
- 4: .standard(proto: "extract_entity_sentiment"),
- 6: .standard(proto: "classify_text"),
- ]
- mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
- while let fieldNumber = try decoder.nextFieldNumber() {
- switch fieldNumber {
- case 1: try decoder.decodeSingularBoolField(value: &self.extractSyntax)
- case 2: try decoder.decodeSingularBoolField(value: &self.extractEntities)
- case 3: try decoder.decodeSingularBoolField(value: &self.extractDocumentSentiment)
- case 4: try decoder.decodeSingularBoolField(value: &self.extractEntitySentiment)
- case 6: try decoder.decodeSingularBoolField(value: &self.classifyText)
- default: break
- }
- }
- }
- func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
- if self.extractSyntax != false {
- try visitor.visitSingularBoolField(value: self.extractSyntax, fieldNumber: 1)
- }
- if self.extractEntities != false {
- try visitor.visitSingularBoolField(value: self.extractEntities, fieldNumber: 2)
- }
- if self.extractDocumentSentiment != false {
- try visitor.visitSingularBoolField(value: self.extractDocumentSentiment, fieldNumber: 3)
- }
- if self.extractEntitySentiment != false {
- try visitor.visitSingularBoolField(value: self.extractEntitySentiment, fieldNumber: 4)
- }
- if self.classifyText != false {
- try visitor.visitSingularBoolField(value: self.classifyText, fieldNumber: 6)
- }
- try unknownFields.traverse(visitor: &visitor)
- }
- static func ==(lhs: Google_Cloud_Language_V1_AnnotateTextRequest.Features, rhs: Google_Cloud_Language_V1_AnnotateTextRequest.Features) -> Bool {
- if lhs.extractSyntax != rhs.extractSyntax {return false}
- if lhs.extractEntities != rhs.extractEntities {return false}
- if lhs.extractDocumentSentiment != rhs.extractDocumentSentiment {return false}
- if lhs.extractEntitySentiment != rhs.extractEntitySentiment {return false}
- if lhs.classifyText != rhs.classifyText {return false}
- if lhs.unknownFields != rhs.unknownFields {return false}
- return true
- }
- }
- extension Google_Cloud_Language_V1_AnnotateTextResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
- static let protoMessageName: String = _protobuf_package + ".AnnotateTextResponse"
- static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
- 1: .same(proto: "sentences"),
- 2: .same(proto: "tokens"),
- 3: .same(proto: "entities"),
- 4: .standard(proto: "document_sentiment"),
- 5: .same(proto: "language"),
- 6: .same(proto: "categories"),
- ]
- fileprivate class _StorageClass {
- var _sentences: [Google_Cloud_Language_V1_Sentence] = []
- var _tokens: [Google_Cloud_Language_V1_Token] = []
- var _entities: [Google_Cloud_Language_V1_Entity] = []
- var _documentSentiment: Google_Cloud_Language_V1_Sentiment? = nil
- var _language: String = String()
- var _categories: [Google_Cloud_Language_V1_ClassificationCategory] = []
- static let defaultInstance = _StorageClass()
- private init() {}
- init(copying source: _StorageClass) {
- _sentences = source._sentences
- _tokens = source._tokens
- _entities = source._entities
- _documentSentiment = source._documentSentiment
- _language = source._language
- _categories = source._categories
- }
- }
- fileprivate mutating func _uniqueStorage() -> _StorageClass {
- if !isKnownUniquelyReferenced(&_storage) {
- _storage = _StorageClass(copying: _storage)
- }
- return _storage
- }
- mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
- _ = _uniqueStorage()
- try withExtendedLifetime(_storage) { (_storage: _StorageClass) in
- while let fieldNumber = try decoder.nextFieldNumber() {
- switch fieldNumber {
- case 1: try decoder.decodeRepeatedMessageField(value: &_storage._sentences)
- case 2: try decoder.decodeRepeatedMessageField(value: &_storage._tokens)
- case 3: try decoder.decodeRepeatedMessageField(value: &_storage._entities)
- case 4: try decoder.decodeSingularMessageField(value: &_storage._documentSentiment)
- case 5: try decoder.decodeSingularStringField(value: &_storage._language)
- case 6: try decoder.decodeRepeatedMessageField(value: &_storage._categories)
- default: break
- }
- }
- }
- }
- func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
- try withExtendedLifetime(_storage) { (_storage: _StorageClass) in
- if !_storage._sentences.isEmpty {
- try visitor.visitRepeatedMessageField(value: _storage._sentences, fieldNumber: 1)
- }
- if !_storage._tokens.isEmpty {
- try visitor.visitRepeatedMessageField(value: _storage._tokens, fieldNumber: 2)
- }
- if !_storage._entities.isEmpty {
- try visitor.visitRepeatedMessageField(value: _storage._entities, fieldNumber: 3)
- }
- if let v = _storage._documentSentiment {
- try visitor.visitSingularMessageField(value: v, fieldNumber: 4)
- }
- if !_storage._language.isEmpty {
- try visitor.visitSingularStringField(value: _storage._language, fieldNumber: 5)
- }
- if !_storage._categories.isEmpty {
- try visitor.visitRepeatedMessageField(value: _storage._categories, fieldNumber: 6)
- }
- }
- try unknownFields.traverse(visitor: &visitor)
- }
- static func ==(lhs: Google_Cloud_Language_V1_AnnotateTextResponse, rhs: Google_Cloud_Language_V1_AnnotateTextResponse) -> Bool {
- if lhs._storage !== rhs._storage {
- let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in
- let _storage = _args.0
- let rhs_storage = _args.1
- if _storage._sentences != rhs_storage._sentences {return false}
- if _storage._tokens != rhs_storage._tokens {return false}
- if _storage._entities != rhs_storage._entities {return false}
- if _storage._documentSentiment != rhs_storage._documentSentiment {return false}
- if _storage._language != rhs_storage._language {return false}
- if _storage._categories != rhs_storage._categories {return false}
- return true
- }
- if !storagesAreEqual {return false}
- }
- if lhs.unknownFields != rhs.unknownFields {return false}
- return true
- }
- }
|