google-cloud-language-v1 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,1121 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2020 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+
20
+ module Google
21
+ module Cloud
22
+ module Language
23
+ module V1
24
+ # ################################################################ #
25
+ #
26
+ # Represents the input to API methods.
27
+ # @!attribute [rw] type
28
+ # @return [Google::Cloud::Language::V1::Document::Type]
29
+ # Required. If the type is not set or is `TYPE_UNSPECIFIED`,
30
+ # returns an `INVALID_ARGUMENT` error.
31
+ # @!attribute [rw] content
32
+ # @return [String]
33
+ # The content of the input in string format.
34
+ # Cloud audit logging exempt since it is based on user data.
35
+ # @!attribute [rw] gcs_content_uri
36
+ # @return [String]
37
+ # The Google Cloud Storage URI where the file content is located.
38
+ # This URI must be of the form: gs://bucket_name/object_name. For more
39
+ # details, see https://cloud.google.com/storage/docs/reference-uris.
40
+ # NOTE: Cloud Storage object versioning is not supported.
41
+ # @!attribute [rw] language
42
+ # @return [String]
43
+ # The language of the document (if not specified, the language is
44
+ # automatically detected). Both ISO and BCP-47 language codes are
45
+ # accepted.<br>
46
+ # [Language Support](/natural-language/docs/languages)
47
+ # lists currently supported languages for each API method.
48
+ # If the language (either specified by the caller or automatically detected)
49
+ # is not supported by the called API method, an `INVALID_ARGUMENT` error
50
+ # is returned.
51
+ class Document
52
+ include Google::Protobuf::MessageExts
53
+ extend Google::Protobuf::MessageExts::ClassMethods
54
+
55
+ # The document types enum.
56
+ module Type
57
+ # The content type is not specified.
58
+ TYPE_UNSPECIFIED = 0
59
+
60
+ # Plain text
61
+ PLAIN_TEXT = 1
62
+
63
+ # HTML
64
+ HTML = 2
65
+ end
66
+ end
67
+
68
+ # Represents a sentence in the input document.
69
+ # @!attribute [rw] text
70
+ # @return [Google::Cloud::Language::V1::TextSpan]
71
+ # The sentence text.
72
+ # @!attribute [rw] sentiment
73
+ # @return [Google::Cloud::Language::V1::Sentiment]
74
+ # For calls to [AnalyzeSentiment][] or if
75
+ # {Google::Cloud::Language::V1::AnnotateTextRequest::Features#extract_document_sentiment AnnotateTextRequest.Features.extract_document_sentiment} is set to
76
+ # true, this field will contain the sentiment for the sentence.
77
+ class Sentence
78
+ include Google::Protobuf::MessageExts
79
+ extend Google::Protobuf::MessageExts::ClassMethods
80
+ end
81
+
82
+ # Represents a phrase in the text that is a known entity, such as
83
+ # a person, an organization, or location. The API associates information, such
84
+ # as salience and mentions, with entities.
85
+ # @!attribute [rw] name
86
+ # @return [String]
87
+ # The representative name for the entity.
88
+ # @!attribute [rw] type
89
+ # @return [Google::Cloud::Language::V1::Entity::Type]
90
+ # The entity type.
91
+ # @!attribute [rw] metadata
92
+ # @return [Google::Protobuf::Map{String => String}]
93
+ # Metadata associated with the entity.
94
+ #
95
+ # For most entity types, the metadata is a Wikipedia URL (`wikipedia_url`)
96
+ # and Knowledge Graph MID (`mid`), if they are available. For the metadata
97
+ # associated with other entity types, see the Type table below.
98
+ # @!attribute [rw] salience
99
+ # @return [Float]
100
+ # The salience score associated with the entity in the [0, 1.0] range.
101
+ #
102
+ # The salience score for an entity provides information about the
103
+ # importance or centrality of that entity to the entire document text.
104
+ # Scores closer to 0 are less salient, while scores closer to 1.0 are highly
105
+ # salient.
106
+ # @!attribute [rw] mentions
107
+ # @return [Array<Google::Cloud::Language::V1::EntityMention>]
108
+ # The mentions of this entity in the input document. The API currently
109
+ # supports proper noun mentions.
110
+ # @!attribute [rw] sentiment
111
+ # @return [Google::Cloud::Language::V1::Sentiment]
112
+ # For calls to [AnalyzeEntitySentiment][] or if
113
+ # {Google::Cloud::Language::V1::AnnotateTextRequest::Features#extract_entity_sentiment AnnotateTextRequest.Features.extract_entity_sentiment} is set to
114
+ # true, this field will contain the aggregate sentiment expressed for this
115
+ # entity in the provided document.
116
+ class Entity
117
+ include Google::Protobuf::MessageExts
118
+ extend Google::Protobuf::MessageExts::ClassMethods
119
+
120
+ # @!attribute [rw] key
121
+ # @return [String]
122
+ # @!attribute [rw] value
123
+ # @return [String]
124
+ class MetadataEntry
125
+ include Google::Protobuf::MessageExts
126
+ extend Google::Protobuf::MessageExts::ClassMethods
127
+ end
128
+
129
+ # The type of the entity. For most entity types, the associated metadata is a
130
+ # Wikipedia URL (`wikipedia_url`) and Knowledge Graph MID (`mid`). The table
131
+ # below lists the associated fields for entities that have different
132
+ # metadata.
133
+ module Type
134
+ # Unknown
135
+ UNKNOWN = 0
136
+
137
+ # Person
138
+ PERSON = 1
139
+
140
+ # Location
141
+ LOCATION = 2
142
+
143
+ # Organization
144
+ ORGANIZATION = 3
145
+
146
+ # Event
147
+ EVENT = 4
148
+
149
+ # Artwork
150
+ WORK_OF_ART = 5
151
+
152
+ # Consumer product
153
+ CONSUMER_GOOD = 6
154
+
155
+ # Other types of entities
156
+ OTHER = 7
157
+
158
+ # Phone number<br><br>
159
+ # The metadata lists the phone number, formatted according to local
160
+ # convention, plus whichever additional elements appear in the text:<ul>
161
+ # <li><code>number</code> &ndash; the actual number, broken down into
162
+ # sections as per local convention</li> <li><code>national_prefix</code>
163
+ # &ndash; country code, if detected</li> <li><code>area_code</code> &ndash;
164
+ # region or area code, if detected</li> <li><code>extension</code> &ndash;
165
+ # phone extension (to be dialed after connection), if detected</li></ul>
166
+ PHONE_NUMBER = 9
167
+
168
+ # Address<br><br>
169
+ # The metadata identifies the street number and locality plus whichever
170
+ # additional elements appear in the text:<ul>
171
+ # <li><code>street_number</code> &ndash; street number</li>
172
+ # <li><code>locality</code> &ndash; city or town</li>
173
+ # <li><code>street_name</code> &ndash; street/route name, if detected</li>
174
+ # <li><code>postal_code</code> &ndash; postal code, if detected</li>
175
+ # <li><code>country</code> &ndash; country, if detected</li>
176
+ # <li><code>broad_region</code> &ndash; administrative area, such as the
177
+ # state, if detected</li> <li><code>narrow_region</code> &ndash; smaller
178
+ # administrative area, such as county, if detected</li>
179
+ # <li><code>sublocality</code> &ndash; used in Asian addresses to demark a
180
+ # district within a city, if detected</li></ul>
181
+ ADDRESS = 10
182
+
183
+ # Date<br><br>
184
+ # The metadata identifies the components of the date:<ul>
185
+ # <li><code>year</code> &ndash; four digit year, if detected</li>
186
+ # <li><code>month</code> &ndash; two digit month number, if detected</li>
187
+ # <li><code>day</code> &ndash; two digit day number, if detected</li></ul>
188
+ DATE = 11
189
+
190
+ # Number<br><br>
191
+ # The metadata is the number itself.
192
+ NUMBER = 12
193
+
194
+ # Price<br><br>
195
+ # The metadata identifies the <code>value</code> and <code>currency</code>.
196
+ PRICE = 13
197
+ end
198
+ end
199
+
200
+ # Represents the smallest syntactic building block of the text.
201
+ # @!attribute [rw] text
202
+ # @return [Google::Cloud::Language::V1::TextSpan]
203
+ # The token text.
204
+ # @!attribute [rw] part_of_speech
205
+ # @return [Google::Cloud::Language::V1::PartOfSpeech]
206
+ # Parts of speech tag for this token.
207
+ # @!attribute [rw] dependency_edge
208
+ # @return [Google::Cloud::Language::V1::DependencyEdge]
209
+ # Dependency tree parse for this token.
210
+ # @!attribute [rw] lemma
211
+ # @return [String]
212
+ # [Lemma](https://en.wikipedia.org/wiki/Lemma_%28morphology%29) of the token.
213
+ class Token
214
+ include Google::Protobuf::MessageExts
215
+ extend Google::Protobuf::MessageExts::ClassMethods
216
+ end
217
+
218
+ # Represents the feeling associated with the entire text or entities in
219
+ # the text.
220
+ # @!attribute [rw] magnitude
221
+ # @return [Float]
222
+ # A non-negative number in the [0, +inf) range, which represents
223
+ # the absolute magnitude of sentiment regardless of score (positive or
224
+ # negative).
225
+ # @!attribute [rw] score
226
+ # @return [Float]
227
+ # Sentiment score between -1.0 (negative sentiment) and 1.0
228
+ # (positive sentiment).
229
+ class Sentiment
230
+ include Google::Protobuf::MessageExts
231
+ extend Google::Protobuf::MessageExts::ClassMethods
232
+ end
233
+
234
+ # Represents part of speech information for a token. Parts of speech
235
+ # are as defined in
236
+ # http://www.lrec-conf.org/proceedings/lrec2012/pdf/274_Paper.pdf
237
+ # @!attribute [rw] tag
238
+ # @return [Google::Cloud::Language::V1::PartOfSpeech::Tag]
239
+ # The part of speech tag.
240
+ # @!attribute [rw] aspect
241
+ # @return [Google::Cloud::Language::V1::PartOfSpeech::Aspect]
242
+ # The grammatical aspect.
243
+ # @!attribute [rw] case
244
+ # @return [Google::Cloud::Language::V1::PartOfSpeech::Case]
245
+ # The grammatical case.
246
+ # @!attribute [rw] form
247
+ # @return [Google::Cloud::Language::V1::PartOfSpeech::Form]
248
+ # The grammatical form.
249
+ # @!attribute [rw] gender
250
+ # @return [Google::Cloud::Language::V1::PartOfSpeech::Gender]
251
+ # The grammatical gender.
252
+ # @!attribute [rw] mood
253
+ # @return [Google::Cloud::Language::V1::PartOfSpeech::Mood]
254
+ # The grammatical mood.
255
+ # @!attribute [rw] number
256
+ # @return [Google::Cloud::Language::V1::PartOfSpeech::Number]
257
+ # The grammatical number.
258
+ # @!attribute [rw] person
259
+ # @return [Google::Cloud::Language::V1::PartOfSpeech::Person]
260
+ # The grammatical person.
261
+ # @!attribute [rw] proper
262
+ # @return [Google::Cloud::Language::V1::PartOfSpeech::Proper]
263
+ # The grammatical properness.
264
+ # @!attribute [rw] reciprocity
265
+ # @return [Google::Cloud::Language::V1::PartOfSpeech::Reciprocity]
266
+ # The grammatical reciprocity.
267
+ # @!attribute [rw] tense
268
+ # @return [Google::Cloud::Language::V1::PartOfSpeech::Tense]
269
+ # The grammatical tense.
270
+ # @!attribute [rw] voice
271
+ # @return [Google::Cloud::Language::V1::PartOfSpeech::Voice]
272
+ # The grammatical voice.
273
+ class PartOfSpeech
274
+ include Google::Protobuf::MessageExts
275
+ extend Google::Protobuf::MessageExts::ClassMethods
276
+
277
+ # The part of speech tags enum.
278
+ module Tag
279
+ # Unknown
280
+ UNKNOWN = 0
281
+
282
+ # Adjective
283
+ ADJ = 1
284
+
285
+ # Adposition (preposition and postposition)
286
+ ADP = 2
287
+
288
+ # Adverb
289
+ ADV = 3
290
+
291
+ # Conjunction
292
+ CONJ = 4
293
+
294
+ # Determiner
295
+ DET = 5
296
+
297
+ # Noun (common and proper)
298
+ NOUN = 6
299
+
300
+ # Cardinal number
301
+ NUM = 7
302
+
303
+ # Pronoun
304
+ PRON = 8
305
+
306
+ # Particle or other function word
307
+ PRT = 9
308
+
309
+ # Punctuation
310
+ PUNCT = 10
311
+
312
+ # Verb (all tenses and modes)
313
+ VERB = 11
314
+
315
+ # Other: foreign words, typos, abbreviations
316
+ X = 12
317
+
318
+ # Affix
319
+ AFFIX = 13
320
+ end
321
+
322
+ # The characteristic of a verb that expresses time flow during an event.
323
+ module Aspect
324
+ # Aspect is not applicable in the analyzed language or is not predicted.
325
+ ASPECT_UNKNOWN = 0
326
+
327
+ # Perfective
328
+ PERFECTIVE = 1
329
+
330
+ # Imperfective
331
+ IMPERFECTIVE = 2
332
+
333
+ # Progressive
334
+ PROGRESSIVE = 3
335
+ end
336
+
337
+ # The grammatical function performed by a noun or pronoun in a phrase,
338
+ # clause, or sentence. In some languages, other parts of speech, such as
339
+ # adjective and determiner, take case inflection in agreement with the noun.
340
+ module Case
341
+ # Case is not applicable in the analyzed language or is not predicted.
342
+ CASE_UNKNOWN = 0
343
+
344
+ # Accusative
345
+ ACCUSATIVE = 1
346
+
347
+ # Adverbial
348
+ ADVERBIAL = 2
349
+
350
+ # Complementive
351
+ COMPLEMENTIVE = 3
352
+
353
+ # Dative
354
+ DATIVE = 4
355
+
356
+ # Genitive
357
+ GENITIVE = 5
358
+
359
+ # Instrumental
360
+ INSTRUMENTAL = 6
361
+
362
+ # Locative
363
+ LOCATIVE = 7
364
+
365
+ # Nominative
366
+ NOMINATIVE = 8
367
+
368
+ # Oblique
369
+ OBLIQUE = 9
370
+
371
+ # Partitive
372
+ PARTITIVE = 10
373
+
374
+ # Prepositional
375
+ PREPOSITIONAL = 11
376
+
377
+ # Reflexive
378
+ REFLEXIVE_CASE = 12
379
+
380
+ # Relative
381
+ RELATIVE_CASE = 13
382
+
383
+ # Vocative
384
+ VOCATIVE = 14
385
+ end
386
+
387
+ # Depending on the language, Form can be categorizing different forms of
388
+ # verbs, adjectives, adverbs, etc. For example, categorizing inflected
389
+ # endings of verbs and adjectives or distinguishing between short and long
390
+ # forms of adjectives and participles
391
+ module Form
392
+ # Form is not applicable in the analyzed language or is not predicted.
393
+ FORM_UNKNOWN = 0
394
+
395
+ # Adnomial
396
+ ADNOMIAL = 1
397
+
398
+ # Auxiliary
399
+ AUXILIARY = 2
400
+
401
+ # Complementizer
402
+ COMPLEMENTIZER = 3
403
+
404
+ # Final ending
405
+ FINAL_ENDING = 4
406
+
407
+ # Gerund
408
+ GERUND = 5
409
+
410
+ # Realis
411
+ REALIS = 6
412
+
413
+ # Irrealis
414
+ IRREALIS = 7
415
+
416
+ # Short form
417
+ SHORT = 8
418
+
419
+ # Long form
420
+ LONG = 9
421
+
422
+ # Order form
423
+ ORDER = 10
424
+
425
+ # Specific form
426
+ SPECIFIC = 11
427
+ end
428
+
429
+ # Gender classes of nouns reflected in the behaviour of associated words.
430
+ module Gender
431
+ # Gender is not applicable in the analyzed language or is not predicted.
432
+ GENDER_UNKNOWN = 0
433
+
434
+ # Feminine
435
+ FEMININE = 1
436
+
437
+ # Masculine
438
+ MASCULINE = 2
439
+
440
+ # Neuter
441
+ NEUTER = 3
442
+ end
443
+
444
+ # The grammatical feature of verbs, used for showing modality and attitude.
445
+ module Mood
446
+ # Mood is not applicable in the analyzed language or is not predicted.
447
+ MOOD_UNKNOWN = 0
448
+
449
+ # Conditional
450
+ CONDITIONAL_MOOD = 1
451
+
452
+ # Imperative
453
+ IMPERATIVE = 2
454
+
455
+ # Indicative
456
+ INDICATIVE = 3
457
+
458
+ # Interrogative
459
+ INTERROGATIVE = 4
460
+
461
+ # Jussive
462
+ JUSSIVE = 5
463
+
464
+ # Subjunctive
465
+ SUBJUNCTIVE = 6
466
+ end
467
+
468
+ # Count distinctions.
469
+ module Number
470
+ # Number is not applicable in the analyzed language or is not predicted.
471
+ NUMBER_UNKNOWN = 0
472
+
473
+ # Singular
474
+ SINGULAR = 1
475
+
476
+ # Plural
477
+ PLURAL = 2
478
+
479
+ # Dual
480
+ DUAL = 3
481
+ end
482
+
483
+ # The distinction between the speaker, second person, third person, etc.
484
+ module Person
485
+ # Person is not applicable in the analyzed language or is not predicted.
486
+ PERSON_UNKNOWN = 0
487
+
488
+ # First
489
+ FIRST = 1
490
+
491
+ # Second
492
+ SECOND = 2
493
+
494
+ # Third
495
+ THIRD = 3
496
+
497
+ # Reflexive
498
+ REFLEXIVE_PERSON = 4
499
+ end
500
+
501
+ # This category shows if the token is part of a proper name.
502
+ module Proper
503
+ # Proper is not applicable in the analyzed language or is not predicted.
504
+ PROPER_UNKNOWN = 0
505
+
506
+ # Proper
507
+ PROPER = 1
508
+
509
+ # Not proper
510
+ NOT_PROPER = 2
511
+ end
512
+
513
+ # Reciprocal features of a pronoun.
514
+ module Reciprocity
515
+ # Reciprocity is not applicable in the analyzed language or is not
516
+ # predicted.
517
+ RECIPROCITY_UNKNOWN = 0
518
+
519
+ # Reciprocal
520
+ RECIPROCAL = 1
521
+
522
+ # Non-reciprocal
523
+ NON_RECIPROCAL = 2
524
+ end
525
+
526
+ # Time reference.
527
+ module Tense
528
+ # Tense is not applicable in the analyzed language or is not predicted.
529
+ TENSE_UNKNOWN = 0
530
+
531
+ # Conditional
532
+ CONDITIONAL_TENSE = 1
533
+
534
+ # Future
535
+ FUTURE = 2
536
+
537
+ # Past
538
+ PAST = 3
539
+
540
+ # Present
541
+ PRESENT = 4
542
+
543
+ # Imperfect
544
+ IMPERFECT = 5
545
+
546
+ # Pluperfect
547
+ PLUPERFECT = 6
548
+ end
549
+
550
+ # The relationship between the action that a verb expresses and the
551
+ # participants identified by its arguments.
552
+ module Voice
553
+ # Voice is not applicable in the analyzed language or is not predicted.
554
+ VOICE_UNKNOWN = 0
555
+
556
+ # Active
557
+ ACTIVE = 1
558
+
559
+ # Causative
560
+ CAUSATIVE = 2
561
+
562
+ # Passive
563
+ PASSIVE = 3
564
+ end
565
+ end
566
+
567
+ # Represents dependency parse tree information for a token. (For more
568
+ # information on dependency labels, see
569
+ # http://www.aclweb.org/anthology/P13-2017
570
+ # @!attribute [rw] head_token_index
571
+ # @return [Integer]
572
+ # Represents the head of this token in the dependency tree.
573
+ # This is the index of the token which has an arc going to this token.
574
+ # The index is the position of the token in the array of tokens returned
575
+ # by the API method. If this token is a root token, then the
576
+ # `head_token_index` is its own index.
577
+ # @!attribute [rw] label
578
+ # @return [Google::Cloud::Language::V1::DependencyEdge::Label]
579
+ # The parse label for the token.
580
+ class DependencyEdge
581
+ include Google::Protobuf::MessageExts
582
+ extend Google::Protobuf::MessageExts::ClassMethods
583
+
584
+ # The parse label enum for the token.
585
+ module Label
586
+ # Unknown
587
+ UNKNOWN = 0
588
+
589
+ # Abbreviation modifier
590
+ ABBREV = 1
591
+
592
+ # Adjectival complement
593
+ ACOMP = 2
594
+
595
+ # Adverbial clause modifier
596
+ ADVCL = 3
597
+
598
+ # Adverbial modifier
599
+ ADVMOD = 4
600
+
601
+ # Adjectival modifier of an NP
602
+ AMOD = 5
603
+
604
+ # Appositional modifier of an NP
605
+ APPOS = 6
606
+
607
+ # Attribute dependent of a copular verb
608
+ ATTR = 7
609
+
610
+ # Auxiliary (non-main) verb
611
+ AUX = 8
612
+
613
+ # Passive auxiliary
614
+ AUXPASS = 9
615
+
616
+ # Coordinating conjunction
617
+ CC = 10
618
+
619
+ # Clausal complement of a verb or adjective
620
+ CCOMP = 11
621
+
622
+ # Conjunct
623
+ CONJ = 12
624
+
625
+ # Clausal subject
626
+ CSUBJ = 13
627
+
628
+ # Clausal passive subject
629
+ CSUBJPASS = 14
630
+
631
+ # Dependency (unable to determine)
632
+ DEP = 15
633
+
634
+ # Determiner
635
+ DET = 16
636
+
637
+ # Discourse
638
+ DISCOURSE = 17
639
+
640
+ # Direct object
641
+ DOBJ = 18
642
+
643
+ # Expletive
644
+ EXPL = 19
645
+
646
+ # Goes with (part of a word in a text not well edited)
647
+ GOESWITH = 20
648
+
649
+ # Indirect object
650
+ IOBJ = 21
651
+
652
+ # Marker (word introducing a subordinate clause)
653
+ MARK = 22
654
+
655
+ # Multi-word expression
656
+ MWE = 23
657
+
658
+ # Multi-word verbal expression
659
+ MWV = 24
660
+
661
+ # Negation modifier
662
+ NEG = 25
663
+
664
+ # Noun compound modifier
665
+ NN = 26
666
+
667
+ # Noun phrase used as an adverbial modifier
668
+ NPADVMOD = 27
669
+
670
+ # Nominal subject
671
+ NSUBJ = 28
672
+
673
+ # Passive nominal subject
674
+ NSUBJPASS = 29
675
+
676
+ # Numeric modifier of a noun
677
+ NUM = 30
678
+
679
+ # Element of compound number
680
+ NUMBER = 31
681
+
682
+ # Punctuation mark
683
+ P = 32
684
+
685
+ # Parataxis relation
686
+ PARATAXIS = 33
687
+
688
+ # Participial modifier
689
+ PARTMOD = 34
690
+
691
+ # The complement of a preposition is a clause
692
+ PCOMP = 35
693
+
694
+ # Object of a preposition
695
+ POBJ = 36
696
+
697
+ # Possession modifier
698
+ POSS = 37
699
+
700
+ # Postverbal negative particle
701
+ POSTNEG = 38
702
+
703
+ # Predicate complement
704
+ PRECOMP = 39
705
+
706
+ # Preconjunt
707
+ PRECONJ = 40
708
+
709
+ # Predeterminer
710
+ PREDET = 41
711
+
712
+ # Prefix
713
+ PREF = 42
714
+
715
+ # Prepositional modifier
716
+ PREP = 43
717
+
718
+ # The relationship between a verb and verbal morpheme
719
+ PRONL = 44
720
+
721
+ # Particle
722
+ PRT = 45
723
+
724
+ # Associative or possessive marker
725
+ PS = 46
726
+
727
+ # Quantifier phrase modifier
728
+ QUANTMOD = 47
729
+
730
+ # Relative clause modifier
731
+ RCMOD = 48
732
+
733
+ # Complementizer in relative clause
734
+ RCMODREL = 49
735
+
736
+ # Ellipsis without a preceding predicate
737
+ RDROP = 50
738
+
739
+ # Referent
740
+ REF = 51
741
+
742
+ # Remnant
743
+ REMNANT = 52
744
+
745
+ # Reparandum
746
+ REPARANDUM = 53
747
+
748
+ # Root
749
+ ROOT = 54
750
+
751
+ # Suffix specifying a unit of number
752
+ SNUM = 55
753
+
754
+ # Suffix
755
+ SUFF = 56
756
+
757
+ # Temporal modifier
758
+ TMOD = 57
759
+
760
+ # Topic marker
761
+ TOPIC = 58
762
+
763
+ # Clause headed by an infinite form of the verb that modifies a noun
764
+ VMOD = 59
765
+
766
+ # Vocative
767
+ VOCATIVE = 60
768
+
769
+ # Open clausal complement
770
+ XCOMP = 61
771
+
772
+ # Name suffix
773
+ SUFFIX = 62
774
+
775
+ # Name title
776
+ TITLE = 63
777
+
778
+ # Adverbial phrase modifier
779
+ ADVPHMOD = 64
780
+
781
+ # Causative auxiliary
782
+ AUXCAUS = 65
783
+
784
+ # Helper auxiliary
785
+ AUXVV = 66
786
+
787
+ # Rentaishi (Prenominal modifier)
788
+ DTMOD = 67
789
+
790
+ # Foreign words
791
+ FOREIGN = 68
792
+
793
+ # Keyword
794
+ KW = 69
795
+
796
+ # List for chains of comparable items
797
+ LIST = 70
798
+
799
+ # Nominalized clause
800
+ NOMC = 71
801
+
802
+ # Nominalized clausal subject
803
+ NOMCSUBJ = 72
804
+
805
+ # Nominalized clausal passive
806
+ NOMCSUBJPASS = 73
807
+
808
+ # Compound of numeric modifier
809
+ NUMC = 74
810
+
811
+ # Copula
812
+ COP = 75
813
+
814
+ # Dislocated relation (for fronted/topicalized elements)
815
+ DISLOCATED = 76
816
+
817
+ # Aspect marker
818
+ ASP = 77
819
+
820
+ # Genitive modifier
821
+ GMOD = 78
822
+
823
+ # Genitive object
824
+ GOBJ = 79
825
+
826
+ # Infinitival modifier
827
+ INFMOD = 80
828
+
829
+ # Measure
830
+ MES = 81
831
+
832
+ # Nominal complement of a noun
833
+ NCOMP = 82
834
+ end
835
+ end
836
+
837
+ # Represents a mention for an entity in the text. Currently, proper noun
838
+ # mentions are supported.
839
+ # @!attribute [rw] text
840
+ # @return [Google::Cloud::Language::V1::TextSpan]
841
+ # The mention text.
842
+ # @!attribute [rw] type
843
+ # @return [Google::Cloud::Language::V1::EntityMention::Type]
844
+ # The type of the entity mention.
845
+ # @!attribute [rw] sentiment
846
+ # @return [Google::Cloud::Language::V1::Sentiment]
847
+ # For calls to [AnalyzeEntitySentiment][] or if
848
+ # {Google::Cloud::Language::V1::AnnotateTextRequest::Features#extract_entity_sentiment AnnotateTextRequest.Features.extract_entity_sentiment} is set to
849
+ # true, this field will contain the sentiment expressed for this mention of
850
+ # the entity in the provided document.
851
+ class EntityMention
852
+ include Google::Protobuf::MessageExts
853
+ extend Google::Protobuf::MessageExts::ClassMethods
854
+
855
+ # The supported types of mentions.
856
+ module Type
857
+ # Unknown
858
+ TYPE_UNKNOWN = 0
859
+
860
+ # Proper name
861
+ PROPER = 1
862
+
863
+ # Common noun (or noun compound)
864
+ COMMON = 2
865
+ end
866
+ end
867
+
868
+ # Represents an output piece of text.
869
+ # @!attribute [rw] content
870
+ # @return [String]
871
+ # The content of the output text.
872
+ # @!attribute [rw] begin_offset
873
+ # @return [Integer]
874
+ # The API calculates the beginning offset of the content in the original
875
+ # document according to the {Google::Cloud::Language::V1::EncodingType EncodingType} specified in the API request.
876
+ class TextSpan
877
+ include Google::Protobuf::MessageExts
878
+ extend Google::Protobuf::MessageExts::ClassMethods
879
+ end
880
+
881
+ # Represents a category returned from the text classifier.
882
+ # @!attribute [rw] name
883
+ # @return [String]
884
+ # The name of the category representing the document, from the [predefined
885
+ # taxonomy](/natural-language/docs/categories).
886
+ # @!attribute [rw] confidence
887
+ # @return [Float]
888
+ # The classifier's confidence of the category. Number represents how certain
889
+ # the classifier is that this category represents the given text.
890
+ class ClassificationCategory
891
+ include Google::Protobuf::MessageExts
892
+ extend Google::Protobuf::MessageExts::ClassMethods
893
+ end
894
+
895
+ # The sentiment analysis request message.
896
+ # @!attribute [rw] document
897
+ # @return [Google::Cloud::Language::V1::Document]
898
+ # Input document.
899
+ # @!attribute [rw] encoding_type
900
+ # @return [Google::Cloud::Language::V1::EncodingType]
901
+ # The encoding type used by the API to calculate sentence offsets.
902
+ class AnalyzeSentimentRequest
903
+ include Google::Protobuf::MessageExts
904
+ extend Google::Protobuf::MessageExts::ClassMethods
905
+ end
906
+
907
+ # The sentiment analysis response message.
908
+ # @!attribute [rw] document_sentiment
909
+ # @return [Google::Cloud::Language::V1::Sentiment]
910
+ # The overall sentiment of the input document.
911
+ # @!attribute [rw] language
912
+ # @return [String]
913
+ # The language of the text, which will be the same as the language specified
914
+ # in the request or, if not specified, the automatically-detected language.
915
+ # See {Google::Cloud::Language::V1::Document#language Document.language} field for more details.
916
+ # @!attribute [rw] sentences
917
+ # @return [Array<Google::Cloud::Language::V1::Sentence>]
918
+ # The sentiment for all the sentences in the document.
919
+ class AnalyzeSentimentResponse
920
+ include Google::Protobuf::MessageExts
921
+ extend Google::Protobuf::MessageExts::ClassMethods
922
+ end
923
+
924
+ # The entity-level sentiment analysis request message.
925
+ # @!attribute [rw] document
926
+ # @return [Google::Cloud::Language::V1::Document]
927
+ # Input document.
928
+ # @!attribute [rw] encoding_type
929
+ # @return [Google::Cloud::Language::V1::EncodingType]
930
+ # The encoding type used by the API to calculate offsets.
931
+ class AnalyzeEntitySentimentRequest
932
+ include Google::Protobuf::MessageExts
933
+ extend Google::Protobuf::MessageExts::ClassMethods
934
+ end
935
+
936
+ # The entity-level sentiment analysis response message.
937
+ # @!attribute [rw] entities
938
+ # @return [Array<Google::Cloud::Language::V1::Entity>]
939
+ # The recognized entities in the input document with associated sentiments.
940
+ # @!attribute [rw] language
941
+ # @return [String]
942
+ # The language of the text, which will be the same as the language specified
943
+ # in the request or, if not specified, the automatically-detected language.
944
+ # See {Google::Cloud::Language::V1::Document#language Document.language} field for more details.
945
+ class AnalyzeEntitySentimentResponse
946
+ include Google::Protobuf::MessageExts
947
+ extend Google::Protobuf::MessageExts::ClassMethods
948
+ end
949
+
950
+ # The entity analysis request message.
951
+ # @!attribute [rw] document
952
+ # @return [Google::Cloud::Language::V1::Document]
953
+ # Input document.
954
+ # @!attribute [rw] encoding_type
955
+ # @return [Google::Cloud::Language::V1::EncodingType]
956
+ # The encoding type used by the API to calculate offsets.
957
+ class AnalyzeEntitiesRequest
958
+ include Google::Protobuf::MessageExts
959
+ extend Google::Protobuf::MessageExts::ClassMethods
960
+ end
961
+
962
+ # The entity analysis response message.
963
+ # @!attribute [rw] entities
964
+ # @return [Array<Google::Cloud::Language::V1::Entity>]
965
+ # The recognized entities in the input document.
966
+ # @!attribute [rw] language
967
+ # @return [String]
968
+ # The language of the text, which will be the same as the language specified
969
+ # in the request or, if not specified, the automatically-detected language.
970
+ # See {Google::Cloud::Language::V1::Document#language Document.language} field for more details.
971
+ class AnalyzeEntitiesResponse
972
+ include Google::Protobuf::MessageExts
973
+ extend Google::Protobuf::MessageExts::ClassMethods
974
+ end
975
+
976
+ # The syntax analysis request message.
977
+ # @!attribute [rw] document
978
+ # @return [Google::Cloud::Language::V1::Document]
979
+ # Input document.
980
+ # @!attribute [rw] encoding_type
981
+ # @return [Google::Cloud::Language::V1::EncodingType]
982
+ # The encoding type used by the API to calculate offsets.
983
+ class AnalyzeSyntaxRequest
984
+ include Google::Protobuf::MessageExts
985
+ extend Google::Protobuf::MessageExts::ClassMethods
986
+ end
987
+
988
+ # The syntax analysis response message.
989
+ # @!attribute [rw] sentences
990
+ # @return [Array<Google::Cloud::Language::V1::Sentence>]
991
+ # Sentences in the input document.
992
+ # @!attribute [rw] tokens
993
+ # @return [Array<Google::Cloud::Language::V1::Token>]
994
+ # Tokens, along with their syntactic information, in the input document.
995
+ # @!attribute [rw] language
996
+ # @return [String]
997
+ # The language of the text, which will be the same as the language specified
998
+ # in the request or, if not specified, the automatically-detected language.
999
+ # See {Google::Cloud::Language::V1::Document#language Document.language} field for more details.
1000
+ class AnalyzeSyntaxResponse
1001
+ include Google::Protobuf::MessageExts
1002
+ extend Google::Protobuf::MessageExts::ClassMethods
1003
+ end
1004
+
1005
+ # The document classification request message.
1006
+ # @!attribute [rw] document
1007
+ # @return [Google::Cloud::Language::V1::Document]
1008
+ # Input document.
1009
+ class ClassifyTextRequest
1010
+ include Google::Protobuf::MessageExts
1011
+ extend Google::Protobuf::MessageExts::ClassMethods
1012
+ end
1013
+
1014
+ # The document classification response message.
1015
+ # @!attribute [rw] categories
1016
+ # @return [Array<Google::Cloud::Language::V1::ClassificationCategory>]
1017
+ # Categories representing the input document.
1018
+ class ClassifyTextResponse
1019
+ include Google::Protobuf::MessageExts
1020
+ extend Google::Protobuf::MessageExts::ClassMethods
1021
+ end
1022
+
1023
+ # The request message for the text annotation API, which can perform multiple
1024
+ # analysis types (sentiment, entities, and syntax) in one call.
1025
+ # @!attribute [rw] document
1026
+ # @return [Google::Cloud::Language::V1::Document]
1027
+ # Input document.
1028
+ # @!attribute [rw] features
1029
+ # @return [Google::Cloud::Language::V1::AnnotateTextRequest::Features]
1030
+ # The enabled features.
1031
+ # @!attribute [rw] encoding_type
1032
+ # @return [Google::Cloud::Language::V1::EncodingType]
1033
+ # The encoding type used by the API to calculate offsets.
1034
+ class AnnotateTextRequest
1035
+ include Google::Protobuf::MessageExts
1036
+ extend Google::Protobuf::MessageExts::ClassMethods
1037
+
1038
+ # All available features for sentiment, syntax, and semantic analysis.
1039
+ # Setting each one to true will enable that specific analysis for the input.
1040
+ # @!attribute [rw] extract_syntax
1041
+ # @return [Boolean]
1042
+ # Extract syntax information.
1043
+ # @!attribute [rw] extract_entities
1044
+ # @return [Boolean]
1045
+ # Extract entities.
1046
+ # @!attribute [rw] extract_document_sentiment
1047
+ # @return [Boolean]
1048
+ # Extract document-level sentiment.
1049
+ # @!attribute [rw] extract_entity_sentiment
1050
+ # @return [Boolean]
1051
+ # Extract entities and their associated sentiment.
1052
+ # @!attribute [rw] classify_text
1053
+ # @return [Boolean]
1054
+ # Classify the full document into categories.
1055
+ class Features
1056
+ include Google::Protobuf::MessageExts
1057
+ extend Google::Protobuf::MessageExts::ClassMethods
1058
+ end
1059
+ end
1060
+
1061
+ # The text annotations response message.
1062
+ # @!attribute [rw] sentences
1063
+ # @return [Array<Google::Cloud::Language::V1::Sentence>]
1064
+ # Sentences in the input document. Populated if the user enables
1065
+ # {Google::Cloud::Language::V1::AnnotateTextRequest::Features#extract_syntax AnnotateTextRequest.Features.extract_syntax}.
1066
+ # @!attribute [rw] tokens
1067
+ # @return [Array<Google::Cloud::Language::V1::Token>]
1068
+ # Tokens, along with their syntactic information, in the input document.
1069
+ # Populated if the user enables
1070
+ # {Google::Cloud::Language::V1::AnnotateTextRequest::Features#extract_syntax AnnotateTextRequest.Features.extract_syntax}.
1071
+ # @!attribute [rw] entities
1072
+ # @return [Array<Google::Cloud::Language::V1::Entity>]
1073
+ # Entities, along with their semantic information, in the input document.
1074
+ # Populated if the user enables
1075
+ # {Google::Cloud::Language::V1::AnnotateTextRequest::Features#extract_entities AnnotateTextRequest.Features.extract_entities}.
1076
+ # @!attribute [rw] document_sentiment
1077
+ # @return [Google::Cloud::Language::V1::Sentiment]
1078
+ # The overall sentiment for the document. Populated if the user enables
1079
+ # {Google::Cloud::Language::V1::AnnotateTextRequest::Features#extract_document_sentiment AnnotateTextRequest.Features.extract_document_sentiment}.
1080
+ # @!attribute [rw] language
1081
+ # @return [String]
1082
+ # The language of the text, which will be the same as the language specified
1083
+ # in the request or, if not specified, the automatically-detected language.
1084
+ # See {Google::Cloud::Language::V1::Document#language Document.language} field for more details.
1085
+ # @!attribute [rw] categories
1086
+ # @return [Array<Google::Cloud::Language::V1::ClassificationCategory>]
1087
+ # Categories identified in the input document.
1088
+ class AnnotateTextResponse
1089
+ include Google::Protobuf::MessageExts
1090
+ extend Google::Protobuf::MessageExts::ClassMethods
1091
+ end
1092
+
1093
+ # Represents the text encoding that the caller uses to process the output.
1094
+ # Providing an `EncodingType` is recommended because the API provides the
1095
+ # beginning offsets for various outputs, such as tokens and mentions, and
1096
+ # languages that natively use different text encodings may access offsets
1097
+ # differently.
1098
+ module EncodingType
1099
+ # If `EncodingType` is not specified, encoding-dependent information (such as
1100
+ # `begin_offset`) will be set at `-1`.
1101
+ NONE = 0
1102
+
1103
+ # Encoding-dependent information (such as `begin_offset`) is calculated based
1104
+ # on the UTF-8 encoding of the input. C++ and Go are examples of languages
1105
+ # that use this encoding natively.
1106
+ UTF8 = 1
1107
+
1108
+ # Encoding-dependent information (such as `begin_offset`) is calculated based
1109
+ # on the UTF-16 encoding of the input. Java and JavaScript are examples of
1110
+ # languages that use this encoding natively.
1111
+ UTF16 = 2
1112
+
1113
+ # Encoding-dependent information (such as `begin_offset`) is calculated based
1114
+ # on the UTF-32 encoding of the input. Python is an example of a language
1115
+ # that uses this encoding natively.
1116
+ UTF32 = 3
1117
+ end
1118
+ end
1119
+ end
1120
+ end
1121
+ end