| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261 |
- // DO NOT EDIT.
- // swift-format-ignore-file
- //
- // 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 you 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](https://cloud.google.com/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 {
- // The use of inline closures is to circumvent an issue where the compiler
- // allocates stack space for every case branch when no optimizations are
- // enabled. https://github.com/apple/swift-protobuf/issues/1034
- switch (lhs, rhs) {
- case (.content, .content): return {
- guard case .content(let l) = lhs, case .content(let r) = rhs else { preconditionFailure() }
- return l == r
- }()
- case (.gcsContentUri, .gcsContentUri): return {
- guard case .gcsContentUri(let l) = lhs, case .gcsContentUri(let r) = rhs else { preconditionFailure() }
- 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 _text ?? Google_Cloud_Language_V1_TextSpan()}
- set {_text = newValue}
- }
- /// Returns true if `text` has been explicitly set.
- var hasText: Bool {return self._text != nil}
- /// Clears the value of `text`. Subsequent reads from it will return its default value.
- mutating func clearText() {self._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 _sentiment ?? Google_Cloud_Language_V1_Sentiment()}
- set {_sentiment = newValue}
- }
- /// Returns true if `sentiment` has been explicitly set.
- var hasSentiment: Bool {return self._sentiment != nil}
- /// Clears the value of `sentiment`. Subsequent reads from it will return its default value.
- mutating func clearSentiment() {self._sentiment = nil}
- var unknownFields = SwiftProtobuf.UnknownStorage()
- init() {}
- fileprivate var _text: Google_Cloud_Language_V1_TextSpan? = nil
- fileprivate var _sentiment: Google_Cloud_Language_V1_Sentiment? = nil
- }
- /// 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 = String()
- /// The entity type.
- var type: Google_Cloud_Language_V1_Entity.TypeEnum = .unknown
- /// 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> = [:]
- /// 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 = 0
- /// The mentions of this entity in the input document. The API currently
- /// supports proper noun mentions.
- var mentions: [Google_Cloud_Language_V1_EntityMention] = []
- /// 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 _sentiment ?? Google_Cloud_Language_V1_Sentiment()}
- set {_sentiment = newValue}
- }
- /// Returns true if `sentiment` has been explicitly set.
- var hasSentiment: Bool {return self._sentiment != nil}
- /// Clears the value of `sentiment`. Subsequent reads from it will return its default value.
- mutating func clearSentiment() {self._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
- ///
- /// The metadata lists the phone number, formatted according to local
- /// convention, plus whichever additional elements appear in the text:
- ///
- /// * `number` - the actual number, broken down into sections as per local
- /// convention
- /// * `national_prefix` - country code, if detected
- /// * `area_code` - region or area code, if detected
- /// * `extension` - phone extension (to be dialed after connection), if
- /// detected
- case phoneNumber // = 9
- /// Address
- ///
- /// The metadata identifies the street number and locality plus whichever
- /// additional elements appear in the text:
- ///
- /// * `street_number` - street number
- /// * `locality` - city or town
- /// * `street_name` - street/route name, if detected
- /// * `postal_code` - postal code, if detected
- /// * `country` - country, if detected<
- /// * `broad_region` - administrative area, such as the state, if detected
- /// * `narrow_region` - smaller administrative area, such as county, if
- /// detected
- /// * `sublocality` - used in Asian addresses to demark a district within a
- /// city, if detected
- case address // = 10
- /// Date
- ///
- /// The metadata identifies the components of the date:
- ///
- /// * `year` - four digit year, if detected
- /// * `month` - two digit month number, if detected
- /// * `day` - two digit day number, if detected
- case date // = 11
- /// Number
- ///
- /// The metadata is the number itself.
- case number // = 12
- /// Price
- ///
- /// The metadata identifies the `value` and `currency`.
- 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 _sentiment: Google_Cloud_Language_V1_Sentiment? = nil
- }
- #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 _text ?? Google_Cloud_Language_V1_TextSpan()}
- set {_text = newValue}
- }
- /// Returns true if `text` has been explicitly set.
- var hasText: Bool {return self._text != nil}
- /// Clears the value of `text`. Subsequent reads from it will return its default value.
- mutating func clearText() {self._text = nil}
- /// The type of the entity mention.
- var type: Google_Cloud_Language_V1_EntityMention.TypeEnum = .unknown
- /// 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 _sentiment ?? Google_Cloud_Language_V1_Sentiment()}
- set {_sentiment = newValue}
- }
- /// Returns true if `sentiment` has been explicitly set.
- var hasSentiment: Bool {return self._sentiment != nil}
- /// Clears the value of `sentiment`. Subsequent reads from it will return its default value.
- mutating func clearSentiment() {self._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 _text: Google_Cloud_Language_V1_TextSpan? = nil
- fileprivate var _sentiment: Google_Cloud_Language_V1_Sentiment? = nil
- }
- #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](https://cloud.google.com/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() {}
- }
- /// Model options available for classification requests.
- struct Google_Cloud_Language_V1_ClassificationModelOptions {
- // 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.
- /// If this field is not set, then the `v1_model` will be used by default.
- var modelType: Google_Cloud_Language_V1_ClassificationModelOptions.OneOf_ModelType? = nil
- /// Setting this field will use the V1 model and V1 content categories
- /// version. The V1 model is a legacy model; support for this will be
- /// discontinued in the future.
- var v1Model: Google_Cloud_Language_V1_ClassificationModelOptions.V1Model {
- get {
- if case .v1Model(let v)? = modelType {return v}
- return Google_Cloud_Language_V1_ClassificationModelOptions.V1Model()
- }
- set {modelType = .v1Model(newValue)}
- }
- /// Setting this field will use the V2 model with the appropriate content
- /// categories version. The V2 model is a better performing model.
- var v2Model: Google_Cloud_Language_V1_ClassificationModelOptions.V2Model {
- get {
- if case .v2Model(let v)? = modelType {return v}
- return Google_Cloud_Language_V1_ClassificationModelOptions.V2Model()
- }
- set {modelType = .v2Model(newValue)}
- }
- var unknownFields = SwiftProtobuf.UnknownStorage()
- /// If this field is not set, then the `v1_model` will be used by default.
- enum OneOf_ModelType: Equatable {
- /// Setting this field will use the V1 model and V1 content categories
- /// version. The V1 model is a legacy model; support for this will be
- /// discontinued in the future.
- case v1Model(Google_Cloud_Language_V1_ClassificationModelOptions.V1Model)
- /// Setting this field will use the V2 model with the appropriate content
- /// categories version. The V2 model is a better performing model.
- case v2Model(Google_Cloud_Language_V1_ClassificationModelOptions.V2Model)
- #if !swift(>=4.1)
- static func ==(lhs: Google_Cloud_Language_V1_ClassificationModelOptions.OneOf_ModelType, rhs: Google_Cloud_Language_V1_ClassificationModelOptions.OneOf_ModelType) -> Bool {
- // The use of inline closures is to circumvent an issue where the compiler
- // allocates stack space for every case branch when no optimizations are
- // enabled. https://github.com/apple/swift-protobuf/issues/1034
- switch (lhs, rhs) {
- case (.v1Model, .v1Model): return {
- guard case .v1Model(let l) = lhs, case .v1Model(let r) = rhs else { preconditionFailure() }
- return l == r
- }()
- case (.v2Model, .v2Model): return {
- guard case .v2Model(let l) = lhs, case .v2Model(let r) = rhs else { preconditionFailure() }
- return l == r
- }()
- default: return false
- }
- }
- #endif
- }
- /// Options for the V1 model.
- struct V1Model {
- // 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.
- var unknownFields = SwiftProtobuf.UnknownStorage()
- init() {}
- }
- /// Options for the V2 model.
- struct V2Model {
- // 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 categories used for classification.
- var contentCategoriesVersion: Google_Cloud_Language_V1_ClassificationModelOptions.V2Model.ContentCategoriesVersion = .unspecified
- var unknownFields = SwiftProtobuf.UnknownStorage()
- /// The content categories used for classification.
- enum ContentCategoriesVersion: SwiftProtobuf.Enum {
- typealias RawValue = Int
- /// If `ContentCategoriesVersion` is not specified, this option will
- /// default to `V1`.
- case unspecified // = 0
- /// Legacy content categories of our initial launch in 2017.
- case v1 // = 1
- /// Updated content categories in 2022.
- case v2 // = 2
- case UNRECOGNIZED(Int)
- init() {
- self = .unspecified
- }
- init?(rawValue: Int) {
- switch rawValue {
- case 0: self = .unspecified
- case 1: self = .v1
- case 2: self = .v2
- default: self = .UNRECOGNIZED(rawValue)
- }
- }
- var rawValue: Int {
- switch self {
- case .unspecified: return 0
- case .v1: return 1
- case .v2: return 2
- case .UNRECOGNIZED(let i): return i
- }
- }
- }
- init() {}
- }
- init() {}
- }
- #if swift(>=4.2)
- extension Google_Cloud_Language_V1_ClassificationModelOptions.V2Model.ContentCategoriesVersion: CaseIterable {
- // The compiler won't synthesize support with the UNRECOGNIZED case.
- static var allCases: [Google_Cloud_Language_V1_ClassificationModelOptions.V2Model.ContentCategoriesVersion] = [
- .unspecified,
- .v1,
- .v2,
- ]
- }
- #endif // swift(>=4.2)
- /// 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.
- /// Required. Input document.
- var document: Google_Cloud_Language_V1_Document {
- get {return _document ?? Google_Cloud_Language_V1_Document()}
- set {_document = newValue}
- }
- /// Returns true if `document` has been explicitly set.
- var hasDocument: Bool {return self._document != nil}
- /// Clears the value of `document`. Subsequent reads from it will return its default value.
- mutating func clearDocument() {self._document = nil}
- /// The encoding type used by the API to calculate sentence offsets.
- var encodingType: Google_Cloud_Language_V1_EncodingType = .none
- var unknownFields = SwiftProtobuf.UnknownStorage()
- init() {}
- fileprivate var _document: Google_Cloud_Language_V1_Document? = nil
- }
- /// 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 _documentSentiment ?? Google_Cloud_Language_V1_Sentiment()}
- set {_documentSentiment = newValue}
- }
- /// Returns true if `documentSentiment` has been explicitly set.
- var hasDocumentSentiment: Bool {return self._documentSentiment != nil}
- /// Clears the value of `documentSentiment`. Subsequent reads from it will return its default value.
- mutating func clearDocumentSentiment() {self._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 = String()
- /// The sentiment for all the sentences in the document.
- var sentences: [Google_Cloud_Language_V1_Sentence] = []
- var unknownFields = SwiftProtobuf.UnknownStorage()
- init() {}
- fileprivate var _documentSentiment: Google_Cloud_Language_V1_Sentiment? = nil
- }
- /// 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.
- /// Required. Input document.
- var document: Google_Cloud_Language_V1_Document {
- get {return _document ?? Google_Cloud_Language_V1_Document()}
- set {_document = newValue}
- }
- /// Returns true if `document` has been explicitly set.
- var hasDocument: Bool {return self._document != nil}
- /// Clears the value of `document`. Subsequent reads from it will return its default value.
- mutating func clearDocument() {self._document = nil}
- /// The encoding type used by the API to calculate offsets.
- var encodingType: Google_Cloud_Language_V1_EncodingType = .none
- var unknownFields = SwiftProtobuf.UnknownStorage()
- init() {}
- fileprivate var _document: Google_Cloud_Language_V1_Document? = nil
- }
- /// 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.
- /// Required. Input document.
- var document: Google_Cloud_Language_V1_Document {
- get {return _document ?? Google_Cloud_Language_V1_Document()}
- set {_document = newValue}
- }
- /// Returns true if `document` has been explicitly set.
- var hasDocument: Bool {return self._document != nil}
- /// Clears the value of `document`. Subsequent reads from it will return its default value.
- mutating func clearDocument() {self._document = nil}
- /// The encoding type used by the API to calculate offsets.
- var encodingType: Google_Cloud_Language_V1_EncodingType = .none
- var unknownFields = SwiftProtobuf.UnknownStorage()
- init() {}
- fileprivate var _document: Google_Cloud_Language_V1_Document? = nil
- }
- /// 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.
- /// Required. Input document.
- var document: Google_Cloud_Language_V1_Document {
- get {return _document ?? Google_Cloud_Language_V1_Document()}
- set {_document = newValue}
- }
- /// Returns true if `document` has been explicitly set.
- var hasDocument: Bool {return self._document != nil}
- /// Clears the value of `document`. Subsequent reads from it will return its default value.
- mutating func clearDocument() {self._document = nil}
- /// The encoding type used by the API to calculate offsets.
- var encodingType: Google_Cloud_Language_V1_EncodingType = .none
- var unknownFields = SwiftProtobuf.UnknownStorage()
- init() {}
- fileprivate var _document: Google_Cloud_Language_V1_Document? = nil
- }
- /// 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.
- /// Required. Input document.
- var document: Google_Cloud_Language_V1_Document {
- get {return _document ?? Google_Cloud_Language_V1_Document()}
- set {_document = newValue}
- }
- /// Returns true if `document` has been explicitly set.
- var hasDocument: Bool {return self._document != nil}
- /// Clears the value of `document`. Subsequent reads from it will return its default value.
- mutating func clearDocument() {self._document = nil}
- /// Model options to use for classification. Defaults to v1 options if not
- /// specified.
- var classificationModelOptions: Google_Cloud_Language_V1_ClassificationModelOptions {
- get {return _classificationModelOptions ?? Google_Cloud_Language_V1_ClassificationModelOptions()}
- set {_classificationModelOptions = newValue}
- }
- /// Returns true if `classificationModelOptions` has been explicitly set.
- var hasClassificationModelOptions: Bool {return self._classificationModelOptions != nil}
- /// Clears the value of `classificationModelOptions`. Subsequent reads from it will return its default value.
- mutating func clearClassificationModelOptions() {self._classificationModelOptions = nil}
- var unknownFields = SwiftProtobuf.UnknownStorage()
- init() {}
- fileprivate var _document: Google_Cloud_Language_V1_Document? = nil
- fileprivate var _classificationModelOptions: Google_Cloud_Language_V1_ClassificationModelOptions? = nil
- }
- /// 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.
- /// Required. Input document.
- var document: Google_Cloud_Language_V1_Document {
- get {return _document ?? Google_Cloud_Language_V1_Document()}
- set {_document = newValue}
- }
- /// Returns true if `document` has been explicitly set.
- var hasDocument: Bool {return self._document != nil}
- /// Clears the value of `document`. Subsequent reads from it will return its default value.
- mutating func clearDocument() {self._document = nil}
- /// Required. The enabled features.
- var features: Google_Cloud_Language_V1_AnnotateTextRequest.Features {
- get {return _features ?? Google_Cloud_Language_V1_AnnotateTextRequest.Features()}
- set {_features = newValue}
- }
- /// Returns true if `features` has been explicitly set.
- var hasFeatures: Bool {return self._features != nil}
- /// Clears the value of `features`. Subsequent reads from it will return its default value.
- mutating func clearFeatures() {self._features = nil}
- /// The encoding type used by the API to calculate offsets.
- var encodingType: Google_Cloud_Language_V1_EncodingType = .none
- 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
- /// The model options to use for classification. Defaults to v1 options
- /// if not specified. Only used if `classify_text` is set to true.
- var classificationModelOptions: Google_Cloud_Language_V1_ClassificationModelOptions {
- get {return _classificationModelOptions ?? Google_Cloud_Language_V1_ClassificationModelOptions()}
- set {_classificationModelOptions = newValue}
- }
- /// Returns true if `classificationModelOptions` has been explicitly set.
- var hasClassificationModelOptions: Bool {return self._classificationModelOptions != nil}
- /// Clears the value of `classificationModelOptions`. Subsequent reads from it will return its default value.
- mutating func clearClassificationModelOptions() {self._classificationModelOptions = nil}
- var unknownFields = SwiftProtobuf.UnknownStorage()
- init() {}
- fileprivate var _classificationModelOptions: Google_Cloud_Language_V1_ClassificationModelOptions? = nil
- }
- init() {}
- fileprivate var _document: Google_Cloud_Language_V1_Document? = nil
- fileprivate var _features: Google_Cloud_Language_V1_AnnotateTextRequest.Features? = nil
- }
- /// 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] = []
- /// 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] = []
- /// 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] = []
- /// 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 _documentSentiment ?? Google_Cloud_Language_V1_Sentiment()}
- set {_documentSentiment = newValue}
- }
- /// Returns true if `documentSentiment` has been explicitly set.
- var hasDocumentSentiment: Bool {return self._documentSentiment != nil}
- /// Clears the value of `documentSentiment`. Subsequent reads from it will return its default value.
- mutating func clearDocumentSentiment() {self._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 = String()
- /// Categories identified in the input document.
- var categories: [Google_Cloud_Language_V1_ClassificationCategory] = []
- var unknownFields = SwiftProtobuf.UnknownStorage()
- init() {}
- fileprivate var _documentSentiment: Google_Cloud_Language_V1_Sentiment? = nil
- }
- #if swift(>=5.5) && canImport(_Concurrency)
- extension Google_Cloud_Language_V1_EncodingType: @unchecked Sendable {}
- extension Google_Cloud_Language_V1_Document: @unchecked Sendable {}
- extension Google_Cloud_Language_V1_Document.OneOf_Source: @unchecked Sendable {}
- extension Google_Cloud_Language_V1_Document.TypeEnum: @unchecked Sendable {}
- extension Google_Cloud_Language_V1_Sentence: @unchecked Sendable {}
- extension Google_Cloud_Language_V1_Entity: @unchecked Sendable {}
- extension Google_Cloud_Language_V1_Entity.TypeEnum: @unchecked Sendable {}
- extension Google_Cloud_Language_V1_Token: @unchecked Sendable {}
- extension Google_Cloud_Language_V1_Sentiment: @unchecked Sendable {}
- extension Google_Cloud_Language_V1_PartOfSpeech: @unchecked Sendable {}
- extension Google_Cloud_Language_V1_PartOfSpeech.Tag: @unchecked Sendable {}
- extension Google_Cloud_Language_V1_PartOfSpeech.Aspect: @unchecked Sendable {}
- extension Google_Cloud_Language_V1_PartOfSpeech.Case: @unchecked Sendable {}
- extension Google_Cloud_Language_V1_PartOfSpeech.Form: @unchecked Sendable {}
- extension Google_Cloud_Language_V1_PartOfSpeech.Gender: @unchecked Sendable {}
- extension Google_Cloud_Language_V1_PartOfSpeech.Mood: @unchecked Sendable {}
- extension Google_Cloud_Language_V1_PartOfSpeech.Number: @unchecked Sendable {}
- extension Google_Cloud_Language_V1_PartOfSpeech.Person: @unchecked Sendable {}
- extension Google_Cloud_Language_V1_PartOfSpeech.Proper: @unchecked Sendable {}
- extension Google_Cloud_Language_V1_PartOfSpeech.Reciprocity: @unchecked Sendable {}
- extension Google_Cloud_Language_V1_PartOfSpeech.Tense: @unchecked Sendable {}
- extension Google_Cloud_Language_V1_PartOfSpeech.Voice: @unchecked Sendable {}
- extension Google_Cloud_Language_V1_DependencyEdge: @unchecked Sendable {}
- extension Google_Cloud_Language_V1_DependencyEdge.Label: @unchecked Sendable {}
- extension Google_Cloud_Language_V1_EntityMention: @unchecked Sendable {}
- extension Google_Cloud_Language_V1_EntityMention.TypeEnum: @unchecked Sendable {}
- extension Google_Cloud_Language_V1_TextSpan: @unchecked Sendable {}
- extension Google_Cloud_Language_V1_ClassificationCategory: @unchecked Sendable {}
- extension Google_Cloud_Language_V1_ClassificationModelOptions: @unchecked Sendable {}
- extension Google_Cloud_Language_V1_ClassificationModelOptions.OneOf_ModelType: @unchecked Sendable {}
- extension Google_Cloud_Language_V1_ClassificationModelOptions.V1Model: @unchecked Sendable {}
- extension Google_Cloud_Language_V1_ClassificationModelOptions.V2Model: @unchecked Sendable {}
- extension Google_Cloud_Language_V1_ClassificationModelOptions.V2Model.ContentCategoriesVersion: @unchecked Sendable {}
- extension Google_Cloud_Language_V1_AnalyzeSentimentRequest: @unchecked Sendable {}
- extension Google_Cloud_Language_V1_AnalyzeSentimentResponse: @unchecked Sendable {}
- extension Google_Cloud_Language_V1_AnalyzeEntitySentimentRequest: @unchecked Sendable {}
- extension Google_Cloud_Language_V1_AnalyzeEntitySentimentResponse: @unchecked Sendable {}
- extension Google_Cloud_Language_V1_AnalyzeEntitiesRequest: @unchecked Sendable {}
- extension Google_Cloud_Language_V1_AnalyzeEntitiesResponse: @unchecked Sendable {}
- extension Google_Cloud_Language_V1_AnalyzeSyntaxRequest: @unchecked Sendable {}
- extension Google_Cloud_Language_V1_AnalyzeSyntaxResponse: @unchecked Sendable {}
- extension Google_Cloud_Language_V1_ClassifyTextRequest: @unchecked Sendable {}
- extension Google_Cloud_Language_V1_ClassifyTextResponse: @unchecked Sendable {}
- extension Google_Cloud_Language_V1_AnnotateTextRequest: @unchecked Sendable {}
- extension Google_Cloud_Language_V1_AnnotateTextRequest.Features: @unchecked Sendable {}
- extension Google_Cloud_Language_V1_AnnotateTextResponse: @unchecked Sendable {}
- #endif // swift(>=5.5) && canImport(_Concurrency)
- // 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() {
- // The use of inline closures is to circumvent an issue where the compiler
- // allocates stack space for every case branch when no optimizations are
- // enabled. https://github.com/apple/swift-protobuf/issues/1034
- switch fieldNumber {
- case 1: try { try decoder.decodeSingularEnumField(value: &self.type) }()
- case 2: try {
- var v: String?
- try decoder.decodeSingularStringField(value: &v)
- if let v = v {
- if self.source != nil {try decoder.handleConflictingOneOf()}
- self.source = .content(v)
- }
- }()
- case 3: try {
- var v: String?
- try decoder.decodeSingularStringField(value: &v)
- if let v = v {
- if self.source != nil {try decoder.handleConflictingOneOf()}
- self.source = .gcsContentUri(v)
- }
- }()
- case 4: try { try decoder.decodeSingularStringField(value: &self.language) }()
- default: break
- }
- }
- }
- func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
- // The use of inline closures is to circumvent an issue where the compiler
- // allocates stack space for every if/case branch local when no optimizations
- // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
- // https://github.com/apple/swift-protobuf/issues/1182
- if self.type != .unspecified {
- try visitor.visitSingularEnumField(value: self.type, fieldNumber: 1)
- }
- switch self.source {
- case .content?: try {
- guard case .content(let v)? = self.source else { preconditionFailure() }
- try visitor.visitSingularStringField(value: v, fieldNumber: 2)
- }()
- case .gcsContentUri?: try {
- guard case .gcsContentUri(let v)? = self.source else { preconditionFailure() }
- 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"),
- ]
- mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
- while let fieldNumber = try decoder.nextFieldNumber() {
- // The use of inline closures is to circumvent an issue where the compiler
- // allocates stack space for every case branch when no optimizations are
- // enabled. https://github.com/apple/swift-protobuf/issues/1034
- switch fieldNumber {
- case 1: try { try decoder.decodeSingularMessageField(value: &self._text) }()
- case 2: try { try decoder.decodeSingularMessageField(value: &self._sentiment) }()
- default: break
- }
- }
- }
- func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
- // The use of inline closures is to circumvent an issue where the compiler
- // allocates stack space for every if/case branch local when no optimizations
- // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
- // https://github.com/apple/swift-protobuf/issues/1182
- try { if let v = self._text {
- try visitor.visitSingularMessageField(value: v, fieldNumber: 1)
- } }()
- try { if let v = self._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._text != rhs._text {return false}
- if lhs._sentiment != rhs._sentiment {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"),
- ]
- mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
- while let fieldNumber = try decoder.nextFieldNumber() {
- // The use of inline closures is to circumvent an issue where the compiler
- // allocates stack space for every case branch when no optimizations are
- // enabled. https://github.com/apple/swift-protobuf/issues/1034
- switch fieldNumber {
- case 1: try { try decoder.decodeSingularStringField(value: &self.name) }()
- case 2: try { try decoder.decodeSingularEnumField(value: &self.type) }()
- case 3: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufString,SwiftProtobuf.ProtobufString>.self, value: &self.metadata) }()
- case 4: try { try decoder.decodeSingularFloatField(value: &self.salience) }()
- case 5: try { try decoder.decodeRepeatedMessageField(value: &self.mentions) }()
- case 6: try { try decoder.decodeSingularMessageField(value: &self._sentiment) }()
- default: break
- }
- }
- }
- func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
- // The use of inline closures is to circumvent an issue where the compiler
- // allocates stack space for every if/case branch local when no optimizations
- // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
- // https://github.com/apple/swift-protobuf/issues/1182
- if !self.name.isEmpty {
- try visitor.visitSingularStringField(value: self.name, fieldNumber: 1)
- }
- if self.type != .unknown {
- try visitor.visitSingularEnumField(value: self.type, fieldNumber: 2)
- }
- if !self.metadata.isEmpty {
- try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufString,SwiftProtobuf.ProtobufString>.self, value: self.metadata, fieldNumber: 3)
- }
- if self.salience != 0 {
- try visitor.visitSingularFloatField(value: self.salience, fieldNumber: 4)
- }
- if !self.mentions.isEmpty {
- try visitor.visitRepeatedMessageField(value: self.mentions, fieldNumber: 5)
- }
- try { if let v = self._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.name != rhs.name {return false}
- if lhs.type != rhs.type {return false}
- if lhs.metadata != rhs.metadata {return false}
- if lhs.salience != rhs.salience {return false}
- if lhs.mentions != rhs.mentions {return false}
- if lhs._sentiment != rhs._sentiment {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() {
- // The use of inline closures is to circumvent an issue where the compiler
- // allocates stack space for every case branch when no optimizations are
- // enabled. https://github.com/apple/swift-protobuf/issues/1034
- switch fieldNumber {
- case 1: try { try decoder.decodeSingularMessageField(value: &_storage._text) }()
- case 2: try { try decoder.decodeSingularMessageField(value: &_storage._partOfSpeech) }()
- case 3: try { try decoder.decodeSingularMessageField(value: &_storage._dependencyEdge) }()
- case 4: try { try decoder.decodeSingularStringField(value: &_storage._lemma) }()
- default: break
- }
- }
- }
- }
- func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
- try withExtendedLifetime(_storage) { (_storage: _StorageClass) in
- // The use of inline closures is to circumvent an issue where the compiler
- // allocates stack space for every if/case branch local when no optimizations
- // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
- // https://github.com/apple/swift-protobuf/issues/1182
- try { if let v = _storage._text {
- try visitor.visitSingularMessageField(value: v, fieldNumber: 1)
- } }()
- try { if let v = _storage._partOfSpeech {
- try visitor.visitSingularMessageField(value: v, fieldNumber: 2)
- } }()
- try { 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() {
- // The use of inline closures is to circumvent an issue where the compiler
- // allocates stack space for every case branch when no optimizations are
- // enabled. https://github.com/apple/swift-protobuf/issues/1034
- switch fieldNumber {
- case 2: try { try decoder.decodeSingularFloatField(value: &self.magnitude) }()
- case 3: try { 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() {
- // The use of inline closures is to circumvent an issue where the compiler
- // allocates stack space for every case branch when no optimizations are
- // enabled. https://github.com/apple/swift-protobuf/issues/1034
- switch fieldNumber {
- case 1: try { try decoder.decodeSingularEnumField(value: &self.tag) }()
- case 2: try { try decoder.decodeSingularEnumField(value: &self.aspect) }()
- case 3: try { try decoder.decodeSingularEnumField(value: &self.`case`) }()
- case 4: try { try decoder.decodeSingularEnumField(value: &self.form) }()
- case 5: try { try decoder.decodeSingularEnumField(value: &self.gender) }()
- case 6: try { try decoder.decodeSingularEnumField(value: &self.mood) }()
- case 7: try { try decoder.decodeSingularEnumField(value: &self.number) }()
- case 8: try { try decoder.decodeSingularEnumField(value: &self.person) }()
- case 9: try { try decoder.decodeSingularEnumField(value: &self.proper) }()
- case 10: try { try decoder.decodeSingularEnumField(value: &self.reciprocity) }()
- case 11: try { try decoder.decodeSingularEnumField(value: &self.tense) }()
- case 12: try { 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() {
- // The use of inline closures is to circumvent an issue where the compiler
- // allocates stack space for every case branch when no optimizations are
- // enabled. https://github.com/apple/swift-protobuf/issues/1034
- switch fieldNumber {
- case 1: try { try decoder.decodeSingularInt32Field(value: &self.headTokenIndex) }()
- case 2: try { 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"),
- ]
- mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
- while let fieldNumber = try decoder.nextFieldNumber() {
- // The use of inline closures is to circumvent an issue where the compiler
- // allocates stack space for every case branch when no optimizations are
- // enabled. https://github.com/apple/swift-protobuf/issues/1034
- switch fieldNumber {
- case 1: try { try decoder.decodeSingularMessageField(value: &self._text) }()
- case 2: try { try decoder.decodeSingularEnumField(value: &self.type) }()
- case 3: try { try decoder.decodeSingularMessageField(value: &self._sentiment) }()
- default: break
- }
- }
- }
- func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
- // The use of inline closures is to circumvent an issue where the compiler
- // allocates stack space for every if/case branch local when no optimizations
- // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
- // https://github.com/apple/swift-protobuf/issues/1182
- try { if let v = self._text {
- try visitor.visitSingularMessageField(value: v, fieldNumber: 1)
- } }()
- if self.type != .unknown {
- try visitor.visitSingularEnumField(value: self.type, fieldNumber: 2)
- }
- try { if let v = self._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._text != rhs._text {return false}
- if lhs.type != rhs.type {return false}
- if lhs._sentiment != rhs._sentiment {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() {
- // The use of inline closures is to circumvent an issue where the compiler
- // allocates stack space for every case branch when no optimizations are
- // enabled. https://github.com/apple/swift-protobuf/issues/1034
- switch fieldNumber {
- case 1: try { try decoder.decodeSingularStringField(value: &self.content) }()
- case 2: try { 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() {
- // The use of inline closures is to circumvent an issue where the compiler
- // allocates stack space for every case branch when no optimizations are
- // enabled. https://github.com/apple/swift-protobuf/issues/1034
- switch fieldNumber {
- case 1: try { try decoder.decodeSingularStringField(value: &self.name) }()
- case 2: try { 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_ClassificationModelOptions: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
- static let protoMessageName: String = _protobuf_package + ".ClassificationModelOptions"
- static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
- 1: .standard(proto: "v1_model"),
- 2: .standard(proto: "v2_model"),
- ]
- mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
- while let fieldNumber = try decoder.nextFieldNumber() {
- // The use of inline closures is to circumvent an issue where the compiler
- // allocates stack space for every case branch when no optimizations are
- // enabled. https://github.com/apple/swift-protobuf/issues/1034
- switch fieldNumber {
- case 1: try {
- var v: Google_Cloud_Language_V1_ClassificationModelOptions.V1Model?
- var hadOneofValue = false
- if let current = self.modelType {
- hadOneofValue = true
- if case .v1Model(let m) = current {v = m}
- }
- try decoder.decodeSingularMessageField(value: &v)
- if let v = v {
- if hadOneofValue {try decoder.handleConflictingOneOf()}
- self.modelType = .v1Model(v)
- }
- }()
- case 2: try {
- var v: Google_Cloud_Language_V1_ClassificationModelOptions.V2Model?
- var hadOneofValue = false
- if let current = self.modelType {
- hadOneofValue = true
- if case .v2Model(let m) = current {v = m}
- }
- try decoder.decodeSingularMessageField(value: &v)
- if let v = v {
- if hadOneofValue {try decoder.handleConflictingOneOf()}
- self.modelType = .v2Model(v)
- }
- }()
- default: break
- }
- }
- }
- func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
- // The use of inline closures is to circumvent an issue where the compiler
- // allocates stack space for every if/case branch local when no optimizations
- // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
- // https://github.com/apple/swift-protobuf/issues/1182
- switch self.modelType {
- case .v1Model?: try {
- guard case .v1Model(let v)? = self.modelType else { preconditionFailure() }
- try visitor.visitSingularMessageField(value: v, fieldNumber: 1)
- }()
- case .v2Model?: try {
- guard case .v2Model(let v)? = self.modelType else { preconditionFailure() }
- try visitor.visitSingularMessageField(value: v, fieldNumber: 2)
- }()
- case nil: break
- }
- try unknownFields.traverse(visitor: &visitor)
- }
- static func ==(lhs: Google_Cloud_Language_V1_ClassificationModelOptions, rhs: Google_Cloud_Language_V1_ClassificationModelOptions) -> Bool {
- if lhs.modelType != rhs.modelType {return false}
- if lhs.unknownFields != rhs.unknownFields {return false}
- return true
- }
- }
- extension Google_Cloud_Language_V1_ClassificationModelOptions.V1Model: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
- static let protoMessageName: String = Google_Cloud_Language_V1_ClassificationModelOptions.protoMessageName + ".V1Model"
- static let _protobuf_nameMap = SwiftProtobuf._NameMap()
- mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
- while let _ = try decoder.nextFieldNumber() {
- }
- }
- func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
- try unknownFields.traverse(visitor: &visitor)
- }
- static func ==(lhs: Google_Cloud_Language_V1_ClassificationModelOptions.V1Model, rhs: Google_Cloud_Language_V1_ClassificationModelOptions.V1Model) -> Bool {
- if lhs.unknownFields != rhs.unknownFields {return false}
- return true
- }
- }
- extension Google_Cloud_Language_V1_ClassificationModelOptions.V2Model: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
- static let protoMessageName: String = Google_Cloud_Language_V1_ClassificationModelOptions.protoMessageName + ".V2Model"
- static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
- 1: .standard(proto: "content_categories_version"),
- ]
- mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
- while let fieldNumber = try decoder.nextFieldNumber() {
- // The use of inline closures is to circumvent an issue where the compiler
- // allocates stack space for every case branch when no optimizations are
- // enabled. https://github.com/apple/swift-protobuf/issues/1034
- switch fieldNumber {
- case 1: try { try decoder.decodeSingularEnumField(value: &self.contentCategoriesVersion) }()
- default: break
- }
- }
- }
- func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
- if self.contentCategoriesVersion != .unspecified {
- try visitor.visitSingularEnumField(value: self.contentCategoriesVersion, fieldNumber: 1)
- }
- try unknownFields.traverse(visitor: &visitor)
- }
- static func ==(lhs: Google_Cloud_Language_V1_ClassificationModelOptions.V2Model, rhs: Google_Cloud_Language_V1_ClassificationModelOptions.V2Model) -> Bool {
- if lhs.contentCategoriesVersion != rhs.contentCategoriesVersion {return false}
- if lhs.unknownFields != rhs.unknownFields {return false}
- return true
- }
- }
- extension Google_Cloud_Language_V1_ClassificationModelOptions.V2Model.ContentCategoriesVersion: SwiftProtobuf._ProtoNameProviding {
- static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
- 0: .same(proto: "CONTENT_CATEGORIES_VERSION_UNSPECIFIED"),
- 1: .same(proto: "V1"),
- 2: .same(proto: "V2"),
- ]
- }
- 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"),
- ]
- mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
- while let fieldNumber = try decoder.nextFieldNumber() {
- // The use of inline closures is to circumvent an issue where the compiler
- // allocates stack space for every case branch when no optimizations are
- // enabled. https://github.com/apple/swift-protobuf/issues/1034
- switch fieldNumber {
- case 1: try { try decoder.decodeSingularMessageField(value: &self._document) }()
- case 2: try { try decoder.decodeSingularEnumField(value: &self.encodingType) }()
- default: break
- }
- }
- }
- func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
- // The use of inline closures is to circumvent an issue where the compiler
- // allocates stack space for every if/case branch local when no optimizations
- // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
- // https://github.com/apple/swift-protobuf/issues/1182
- try { if let v = self._document {
- try visitor.visitSingularMessageField(value: v, fieldNumber: 1)
- } }()
- if self.encodingType != .none {
- try visitor.visitSingularEnumField(value: self.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._document != rhs._document {return false}
- if lhs.encodingType != rhs.encodingType {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"),
- ]
- mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
- while let fieldNumber = try decoder.nextFieldNumber() {
- // The use of inline closures is to circumvent an issue where the compiler
- // allocates stack space for every case branch when no optimizations are
- // enabled. https://github.com/apple/swift-protobuf/issues/1034
- switch fieldNumber {
- case 1: try { try decoder.decodeSingularMessageField(value: &self._documentSentiment) }()
- case 2: try { try decoder.decodeSingularStringField(value: &self.language) }()
- case 3: try { try decoder.decodeRepeatedMessageField(value: &self.sentences) }()
- default: break
- }
- }
- }
- func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
- // The use of inline closures is to circumvent an issue where the compiler
- // allocates stack space for every if/case branch local when no optimizations
- // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
- // https://github.com/apple/swift-protobuf/issues/1182
- try { if let v = self._documentSentiment {
- try visitor.visitSingularMessageField(value: v, fieldNumber: 1)
- } }()
- if !self.language.isEmpty {
- try visitor.visitSingularStringField(value: self.language, fieldNumber: 2)
- }
- if !self.sentences.isEmpty {
- try visitor.visitRepeatedMessageField(value: self.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._documentSentiment != rhs._documentSentiment {return false}
- if lhs.language != rhs.language {return false}
- if lhs.sentences != rhs.sentences {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"),
- ]
- mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
- while let fieldNumber = try decoder.nextFieldNumber() {
- // The use of inline closures is to circumvent an issue where the compiler
- // allocates stack space for every case branch when no optimizations are
- // enabled. https://github.com/apple/swift-protobuf/issues/1034
- switch fieldNumber {
- case 1: try { try decoder.decodeSingularMessageField(value: &self._document) }()
- case 2: try { try decoder.decodeSingularEnumField(value: &self.encodingType) }()
- default: break
- }
- }
- }
- func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
- // The use of inline closures is to circumvent an issue where the compiler
- // allocates stack space for every if/case branch local when no optimizations
- // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
- // https://github.com/apple/swift-protobuf/issues/1182
- try { if let v = self._document {
- try visitor.visitSingularMessageField(value: v, fieldNumber: 1)
- } }()
- if self.encodingType != .none {
- try visitor.visitSingularEnumField(value: self.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._document != rhs._document {return false}
- if lhs.encodingType != rhs.encodingType {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() {
- // The use of inline closures is to circumvent an issue where the compiler
- // allocates stack space for every case branch when no optimizations are
- // enabled. https://github.com/apple/swift-protobuf/issues/1034
- switch fieldNumber {
- case 1: try { try decoder.decodeRepeatedMessageField(value: &self.entities) }()
- case 2: try { 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"),
- ]
- mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
- while let fieldNumber = try decoder.nextFieldNumber() {
- // The use of inline closures is to circumvent an issue where the compiler
- // allocates stack space for every case branch when no optimizations are
- // enabled. https://github.com/apple/swift-protobuf/issues/1034
- switch fieldNumber {
- case 1: try { try decoder.decodeSingularMessageField(value: &self._document) }()
- case 2: try { try decoder.decodeSingularEnumField(value: &self.encodingType) }()
- default: break
- }
- }
- }
- func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
- // The use of inline closures is to circumvent an issue where the compiler
- // allocates stack space for every if/case branch local when no optimizations
- // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
- // https://github.com/apple/swift-protobuf/issues/1182
- try { if let v = self._document {
- try visitor.visitSingularMessageField(value: v, fieldNumber: 1)
- } }()
- if self.encodingType != .none {
- try visitor.visitSingularEnumField(value: self.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._document != rhs._document {return false}
- if lhs.encodingType != rhs.encodingType {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() {
- // The use of inline closures is to circumvent an issue where the compiler
- // allocates stack space for every case branch when no optimizations are
- // enabled. https://github.com/apple/swift-protobuf/issues/1034
- switch fieldNumber {
- case 1: try { try decoder.decodeRepeatedMessageField(value: &self.entities) }()
- case 2: try { 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"),
- ]
- mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
- while let fieldNumber = try decoder.nextFieldNumber() {
- // The use of inline closures is to circumvent an issue where the compiler
- // allocates stack space for every case branch when no optimizations are
- // enabled. https://github.com/apple/swift-protobuf/issues/1034
- switch fieldNumber {
- case 1: try { try decoder.decodeSingularMessageField(value: &self._document) }()
- case 2: try { try decoder.decodeSingularEnumField(value: &self.encodingType) }()
- default: break
- }
- }
- }
- func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
- // The use of inline closures is to circumvent an issue where the compiler
- // allocates stack space for every if/case branch local when no optimizations
- // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
- // https://github.com/apple/swift-protobuf/issues/1182
- try { if let v = self._document {
- try visitor.visitSingularMessageField(value: v, fieldNumber: 1)
- } }()
- if self.encodingType != .none {
- try visitor.visitSingularEnumField(value: self.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._document != rhs._document {return false}
- if lhs.encodingType != rhs.encodingType {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() {
- // The use of inline closures is to circumvent an issue where the compiler
- // allocates stack space for every case branch when no optimizations are
- // enabled. https://github.com/apple/swift-protobuf/issues/1034
- switch fieldNumber {
- case 1: try { try decoder.decodeRepeatedMessageField(value: &self.sentences) }()
- case 2: try { try decoder.decodeRepeatedMessageField(value: &self.tokens) }()
- case 3: try { 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"),
- 3: .standard(proto: "classification_model_options"),
- ]
- mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
- while let fieldNumber = try decoder.nextFieldNumber() {
- // The use of inline closures is to circumvent an issue where the compiler
- // allocates stack space for every case branch when no optimizations are
- // enabled. https://github.com/apple/swift-protobuf/issues/1034
- switch fieldNumber {
- case 1: try { try decoder.decodeSingularMessageField(value: &self._document) }()
- case 3: try { try decoder.decodeSingularMessageField(value: &self._classificationModelOptions) }()
- default: break
- }
- }
- }
- func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
- // The use of inline closures is to circumvent an issue where the compiler
- // allocates stack space for every if/case branch local when no optimizations
- // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
- // https://github.com/apple/swift-protobuf/issues/1182
- try { if let v = self._document {
- try visitor.visitSingularMessageField(value: v, fieldNumber: 1)
- } }()
- try { if let v = self._classificationModelOptions {
- try visitor.visitSingularMessageField(value: v, fieldNumber: 3)
- } }()
- try unknownFields.traverse(visitor: &visitor)
- }
- static func ==(lhs: Google_Cloud_Language_V1_ClassifyTextRequest, rhs: Google_Cloud_Language_V1_ClassifyTextRequest) -> Bool {
- if lhs._document != rhs._document {return false}
- if lhs._classificationModelOptions != rhs._classificationModelOptions {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() {
- // The use of inline closures is to circumvent an issue where the compiler
- // allocates stack space for every case branch when no optimizations are
- // enabled. https://github.com/apple/swift-protobuf/issues/1034
- switch fieldNumber {
- case 1: try { 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"),
- ]
- mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
- while let fieldNumber = try decoder.nextFieldNumber() {
- // The use of inline closures is to circumvent an issue where the compiler
- // allocates stack space for every case branch when no optimizations are
- // enabled. https://github.com/apple/swift-protobuf/issues/1034
- switch fieldNumber {
- case 1: try { try decoder.decodeSingularMessageField(value: &self._document) }()
- case 2: try { try decoder.decodeSingularMessageField(value: &self._features) }()
- case 3: try { try decoder.decodeSingularEnumField(value: &self.encodingType) }()
- default: break
- }
- }
- }
- func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
- // The use of inline closures is to circumvent an issue where the compiler
- // allocates stack space for every if/case branch local when no optimizations
- // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
- // https://github.com/apple/swift-protobuf/issues/1182
- try { if let v = self._document {
- try visitor.visitSingularMessageField(value: v, fieldNumber: 1)
- } }()
- try { if let v = self._features {
- try visitor.visitSingularMessageField(value: v, fieldNumber: 2)
- } }()
- if self.encodingType != .none {
- try visitor.visitSingularEnumField(value: self.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._document != rhs._document {return false}
- if lhs._features != rhs._features {return false}
- if lhs.encodingType != rhs.encodingType {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"),
- 10: .standard(proto: "classification_model_options"),
- ]
- mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
- while let fieldNumber = try decoder.nextFieldNumber() {
- // The use of inline closures is to circumvent an issue where the compiler
- // allocates stack space for every case branch when no optimizations are
- // enabled. https://github.com/apple/swift-protobuf/issues/1034
- switch fieldNumber {
- case 1: try { try decoder.decodeSingularBoolField(value: &self.extractSyntax) }()
- case 2: try { try decoder.decodeSingularBoolField(value: &self.extractEntities) }()
- case 3: try { try decoder.decodeSingularBoolField(value: &self.extractDocumentSentiment) }()
- case 4: try { try decoder.decodeSingularBoolField(value: &self.extractEntitySentiment) }()
- case 6: try { try decoder.decodeSingularBoolField(value: &self.classifyText) }()
- case 10: try { try decoder.decodeSingularMessageField(value: &self._classificationModelOptions) }()
- default: break
- }
- }
- }
- func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
- // The use of inline closures is to circumvent an issue where the compiler
- // allocates stack space for every if/case branch local when no optimizations
- // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
- // https://github.com/apple/swift-protobuf/issues/1182
- 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 { if let v = self._classificationModelOptions {
- try visitor.visitSingularMessageField(value: v, fieldNumber: 10)
- } }()
- 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._classificationModelOptions != rhs._classificationModelOptions {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"),
- ]
- mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
- while let fieldNumber = try decoder.nextFieldNumber() {
- // The use of inline closures is to circumvent an issue where the compiler
- // allocates stack space for every case branch when no optimizations are
- // enabled. https://github.com/apple/swift-protobuf/issues/1034
- switch fieldNumber {
- case 1: try { try decoder.decodeRepeatedMessageField(value: &self.sentences) }()
- case 2: try { try decoder.decodeRepeatedMessageField(value: &self.tokens) }()
- case 3: try { try decoder.decodeRepeatedMessageField(value: &self.entities) }()
- case 4: try { try decoder.decodeSingularMessageField(value: &self._documentSentiment) }()
- case 5: try { try decoder.decodeSingularStringField(value: &self.language) }()
- case 6: try { try decoder.decodeRepeatedMessageField(value: &self.categories) }()
- default: break
- }
- }
- }
- func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
- // The use of inline closures is to circumvent an issue where the compiler
- // allocates stack space for every if/case branch local when no optimizations
- // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
- // https://github.com/apple/swift-protobuf/issues/1182
- 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.entities.isEmpty {
- try visitor.visitRepeatedMessageField(value: self.entities, fieldNumber: 3)
- }
- try { if let v = self._documentSentiment {
- try visitor.visitSingularMessageField(value: v, fieldNumber: 4)
- } }()
- if !self.language.isEmpty {
- try visitor.visitSingularStringField(value: self.language, fieldNumber: 5)
- }
- if !self.categories.isEmpty {
- try visitor.visitRepeatedMessageField(value: self.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.sentences != rhs.sentences {return false}
- if lhs.tokens != rhs.tokens {return false}
- if lhs.entities != rhs.entities {return false}
- if lhs._documentSentiment != rhs._documentSentiment {return false}
- if lhs.language != rhs.language {return false}
- if lhs.categories != rhs.categories {return false}
- if lhs.unknownFields != rhs.unknownFields {return false}
- return true
- }
- }
|