google-cloud-language 0.26.0 → 0.26.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4830cbe5b93103ce33cca8c454b75b20d44e56e4
4
- data.tar.gz: 2abde3909e2c55adb142d8ed5ebec1bddd4b8366
3
+ metadata.gz: 9351f9a2d3d3b60e379d95385e927d672b849fa9
4
+ data.tar.gz: 09bcac3bbda5c14dc8b3f89698ec4eefc0268c61
5
5
  SHA512:
6
- metadata.gz: 7fe8326ce9ff6ff79b5a4722b205d33d9b0a2adc885d208173b2e3bca78d240ef08a100a01681cae7a9e9f3b0eed908802bf6f89c83ecdbb691eca828c1b27e5
7
- data.tar.gz: 27c3339fd3fcae0dd33c6f3ace0ebeccfab2876e967ca50fc8484dc0019a1dc93129e3d1436dd466fa8ea40a7f173f7dd44f117ae2024e196d532d23f186204e
6
+ metadata.gz: 4fd665851dd76495b771a1b7642fb1af9549e0f40d1a8154843189b929b375913f45518b5859392962b99e63ed51ad463bd516c5ea1047b6efce33722b3f523e
7
+ data.tar.gz: 280700fb11e0d68fb1bd6a7f0ea5cba2b465d4879632719efb6f78b6692dab66bbd311e57f107492c53084c598490f2c1a823598779194faffbc5db313f3eedc
@@ -13,6 +13,7 @@
13
13
  # limitations under the License.
14
14
 
15
15
 
16
+ require "delegate"
16
17
  require "google/cloud/language/convert"
17
18
 
18
19
  module Google
@@ -1,5 +1,4 @@
1
- # Copyright 2016 Google Inc. All rights reserved.
2
- #
1
+ # Copyright 2017, Google Inc. All rights reserved.
3
2
  # Licensed under the Apache License, Version 2.0 (the "License");
4
3
  # you may not use this file except in compliance with the License.
5
4
  # You may obtain a copy of the License at
@@ -39,9 +39,7 @@ module Google
39
39
  # accepted.<br>
40
40
  # **Current Language Restrictions:**
41
41
  #
42
- # * Only English, Spanish, and Japanese textual content
43
- # are supported, with the following additional restriction:
44
- # * +analyzeSentiment+ only supports English text.
42
+ # * Only English, Spanish, and Japanese textual content are supported.
45
43
  # If the language (either specified by the caller or automatically detected)
46
44
  # is not supported by the called API method, an +INVALID_ARGUMENT+ error
47
45
  # is returned.
@@ -151,7 +149,7 @@ module Google
151
149
  # @!attribute [rw] score
152
150
  # @return [Float]
153
151
  # Sentiment score between -1.0 (negative sentiment) and 1.0
154
- # (positive sentiment.)
152
+ # (positive sentiment).
155
153
  class Sentiment; end
156
154
 
157
155
  # Represents part of speech information for a token. Parts of speech
@@ -63,6 +63,12 @@ module Google
63
63
  # A Channel object through which to make calls.
64
64
  # @param chan_creds [Grpc::ChannelCredentials]
65
65
  # A ChannelCredentials for the setting up the RPC client.
66
+ # @param updater_proc [Proc]
67
+ # A function that transforms the metadata for requests, e.g., to give
68
+ # OAuth credentials.
69
+ # @param scopes [Array<String>]
70
+ # The OAuth scopes for this service. This parameter is ignored if
71
+ # an updater_proc is supplied.
66
72
  # @param client_config[Hash]
67
73
  # A Hash for call options for each method. See
68
74
  # Google::Gax#construct_settings for the structure of
@@ -75,6 +81,7 @@ module Google
75
81
  port: DEFAULT_SERVICE_PORT,
76
82
  channel: nil,
77
83
  chan_creds: nil,
84
+ updater_proc: nil,
78
85
  scopes: ALL_SCOPES,
79
86
  client_config: {},
80
87
  timeout: DEFAULT_TIMEOUT,
@@ -119,6 +126,7 @@ module Google
119
126
  port,
120
127
  chan_creds: chan_creds,
121
128
  channel: channel,
129
+ updater_proc: updater_proc,
122
130
  scopes: scopes,
123
131
  &Google::Cloud::Language::V1::LanguageService::Stub.method(:new)
124
132
  )
@@ -156,7 +164,7 @@ module Google
156
164
  # @return [Google::Cloud::Language::V1::AnalyzeSentimentResponse]
157
165
  # @raise [Google::Gax::GaxError] if the RPC is aborted.
158
166
  # @example
159
- # require "google/cloud/language/v1/language_service_client"
167
+ # require "google/cloud/language/v1"
160
168
  #
161
169
  # Document = Google::Cloud::Language::V1::Document
162
170
  # LanguageServiceClient = Google::Cloud::Language::V1::LanguageServiceClient
@@ -176,8 +184,9 @@ module Google
176
184
  @analyze_sentiment.call(req, options)
177
185
  end
178
186
 
179
- # Finds named entities (currently finds proper names) in the text,
180
- # entity types, salience, mentions for each entity, and other properties.
187
+ # Finds named entities (currently proper names and common nouns) in the text
188
+ # along with entity types, salience, mentions for each entity, and
189
+ # other properties.
181
190
  #
182
191
  # @param document [Google::Cloud::Language::V1::Document]
183
192
  # Input document.
@@ -189,7 +198,7 @@ module Google
189
198
  # @return [Google::Cloud::Language::V1::AnalyzeEntitiesResponse]
190
199
  # @raise [Google::Gax::GaxError] if the RPC is aborted.
191
200
  # @example
192
- # require "google/cloud/language/v1/language_service_client"
201
+ # require "google/cloud/language/v1"
193
202
  #
194
203
  # Document = Google::Cloud::Language::V1::Document
195
204
  # EncodingType = Google::Cloud::Language::V1::EncodingType
@@ -225,7 +234,7 @@ module Google
225
234
  # @return [Google::Cloud::Language::V1::AnalyzeSyntaxResponse]
226
235
  # @raise [Google::Gax::GaxError] if the RPC is aborted.
227
236
  # @example
228
- # require "google/cloud/language/v1/language_service_client"
237
+ # require "google/cloud/language/v1"
229
238
  #
230
239
  # Document = Google::Cloud::Language::V1::Document
231
240
  # EncodingType = Google::Cloud::Language::V1::EncodingType
@@ -262,7 +271,7 @@ module Google
262
271
  # @return [Google::Cloud::Language::V1::AnnotateTextResponse]
263
272
  # @raise [Google::Gax::GaxError] if the RPC is aborted.
264
273
  # @example
265
- # require "google/cloud/language/v1/language_service_client"
274
+ # require "google/cloud/language/v1"
266
275
  #
267
276
  # Document = Google::Cloud::Language::V1::Document
268
277
  # EncodingType = Google::Cloud::Language::V1::EncodingType
@@ -1,7 +1,7 @@
1
1
  # Generated by the protocol buffer compiler. DO NOT EDIT!
2
2
  # Source: google/cloud/language/v1/language_service.proto for package 'google.cloud.language.v1'
3
3
  # Original file comments:
4
- # Copyright 2016 Google Inc.
4
+ # Copyright 2017 Google Inc.
5
5
  #
6
6
  # Licensed under the Apache License, Version 2.0 (the "License");
7
7
  # you may not use this file except in compliance with the License.
@@ -36,8 +36,9 @@ module Google
36
36
 
37
37
  # Analyzes the sentiment of the provided text.
38
38
  rpc :AnalyzeSentiment, AnalyzeSentimentRequest, AnalyzeSentimentResponse
39
- # Finds named entities (currently finds proper names) in the text,
40
- # entity types, salience, mentions for each entity, and other properties.
39
+ # Finds named entities (currently proper names and common nouns) in the text
40
+ # along with entity types, salience, mentions for each entity, and
41
+ # other properties.
41
42
  rpc :AnalyzeEntities, AnalyzeEntitiesRequest, AnalyzeEntitiesResponse
42
43
  # Analyzes the syntax of the text and provides sentence boundaries and
43
44
  # tokenization along with part of speech tags, dependency trees, and other
@@ -0,0 +1,14 @@
1
+ # Copyright 2017, Google Inc. All rights reserved.
2
+ # Licensed under the Apache License, Version 2.0 (the "License");
3
+ # you may not use this file except in compliance with the License.
4
+ # You may obtain a copy of the License at
5
+ #
6
+ # http://www.apache.org/licenses/LICENSE-2.0
7
+ #
8
+ # Unless required by applicable law or agreed to in writing, software
9
+ # distributed under the License is distributed on an "AS IS" BASIS,
10
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
+ # See the License for the specific language governing permissions and
12
+ # limitations under the License.
13
+
14
+ require "google/cloud/language/v1beta2/language_service_client"
@@ -0,0 +1,944 @@
1
+ # Copyright 2017, Google Inc. All rights reserved.
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ module Google
16
+ module Cloud
17
+ module Language
18
+ module V1beta2
19
+ # ================================================================ #
20
+ #
21
+ # Represents the input to API methods.
22
+ # @!attribute [rw] type
23
+ # @return [Google::Cloud::Language::V1beta2::Document::Type]
24
+ # Required. If the type is not set or is +TYPE_UNSPECIFIED+,
25
+ # returns an +INVALID_ARGUMENT+ error.
26
+ # @!attribute [rw] content
27
+ # @return [String]
28
+ # The content of the input in string format.
29
+ # @!attribute [rw] gcs_content_uri
30
+ # @return [String]
31
+ # The Google Cloud Storage URI where the file content is located.
32
+ # This URI must be of the form: gs://bucket_name/object_name. For more
33
+ # details, see https://cloud.google.com/storage/docs/reference-uris.
34
+ # NOTE: Cloud Storage object versioning is not supported.
35
+ # @!attribute [rw] language
36
+ # @return [String]
37
+ # The language of the document (if not specified, the language is
38
+ # automatically detected). Both ISO and BCP-47 language codes are
39
+ # accepted.<br>
40
+ # **Current Language Restrictions:**
41
+ #
42
+ # * Only English, Spanish, and Japanese textual content are supported.
43
+ # If the language (either specified by the caller or automatically detected)
44
+ # is not supported by the called API method, an +INVALID_ARGUMENT+ error
45
+ # is returned.
46
+ class Document
47
+ # The document types enum.
48
+ module Type
49
+ # The content type is not specified.
50
+ TYPE_UNSPECIFIED = 0
51
+
52
+ # Plain text
53
+ PLAIN_TEXT = 1
54
+
55
+ # HTML
56
+ HTML = 2
57
+ end
58
+ end
59
+
60
+ # Represents a sentence in the input document.
61
+ # @!attribute [rw] text
62
+ # @return [Google::Cloud::Language::V1beta2::TextSpan]
63
+ # The sentence text.
64
+ # @!attribute [rw] sentiment
65
+ # @return [Google::Cloud::Language::V1beta2::Sentiment]
66
+ # For calls to AnalyzeSentiment or if
67
+ # AnnotateTextRequest::Features#extract_document_sentiment is set to
68
+ # true, this field will contain the sentiment for the sentence.
69
+ class Sentence; end
70
+
71
+ # Represents a phrase in the text that is a known entity, such as
72
+ # a person, an organization, or location. The API associates information, such
73
+ # as salience and mentions, with entities.
74
+ # @!attribute [rw] name
75
+ # @return [String]
76
+ # The representative name for the entity.
77
+ # @!attribute [rw] type
78
+ # @return [Google::Cloud::Language::V1beta2::Entity::Type]
79
+ # The entity type.
80
+ # @!attribute [rw] metadata
81
+ # @return [Hash{String => String}]
82
+ # Metadata associated with the entity.
83
+ #
84
+ # Currently, Wikipedia URLs and Knowledge Graph MIDs are provided, if
85
+ # available. The associated keys are "wikipedia_url" and "mid", respectively.
86
+ # @!attribute [rw] salience
87
+ # @return [Float]
88
+ # The salience score associated with the entity in the [0, 1.0] range.
89
+ #
90
+ # The salience score for an entity provides information about the
91
+ # importance or centrality of that entity to the entire document text.
92
+ # Scores closer to 0 are less salient, while scores closer to 1.0 are highly
93
+ # salient.
94
+ # @!attribute [rw] mentions
95
+ # @return [Array<Google::Cloud::Language::V1beta2::EntityMention>]
96
+ # The mentions of this entity in the input document. The API currently
97
+ # supports proper noun mentions.
98
+ # @!attribute [rw] sentiment
99
+ # @return [Google::Cloud::Language::V1beta2::Sentiment]
100
+ # For calls to AnalyzeEntitySentiment or if
101
+ # AnnotateTextRequest::Features#extract_entity_sentiment is set to
102
+ # true, this field will contain the aggregate sentiment expressed for this
103
+ # entity in the provided document.
104
+ class Entity
105
+ # The type of the entity.
106
+ module Type
107
+ # Unknown
108
+ UNKNOWN = 0
109
+
110
+ # Person
111
+ PERSON = 1
112
+
113
+ # Location
114
+ LOCATION = 2
115
+
116
+ # Organization
117
+ ORGANIZATION = 3
118
+
119
+ # Event
120
+ EVENT = 4
121
+
122
+ # Work of art
123
+ WORK_OF_ART = 5
124
+
125
+ # Consumer goods
126
+ CONSUMER_GOOD = 6
127
+
128
+ # Other types
129
+ OTHER = 7
130
+ end
131
+ end
132
+
133
+ # Represents the smallest syntactic building block of the text.
134
+ # @!attribute [rw] text
135
+ # @return [Google::Cloud::Language::V1beta2::TextSpan]
136
+ # The token text.
137
+ # @!attribute [rw] part_of_speech
138
+ # @return [Google::Cloud::Language::V1beta2::PartOfSpeech]
139
+ # Parts of speech tag for this token.
140
+ # @!attribute [rw] dependency_edge
141
+ # @return [Google::Cloud::Language::V1beta2::DependencyEdge]
142
+ # Dependency tree parse for this token.
143
+ # @!attribute [rw] lemma
144
+ # @return [String]
145
+ # {Lemma}[https://en.wikipedia.org/wiki/Lemma_%28morphology%29] of the token.
146
+ class Token; end
147
+
148
+ # Represents the feeling associated with the entire text or entities in
149
+ # the text.
150
+ # @!attribute [rw] magnitude
151
+ # @return [Float]
152
+ # A non-negative number in the [0, +inf) range, which represents
153
+ # the absolute magnitude of sentiment regardless of score (positive or
154
+ # negative).
155
+ # @!attribute [rw] score
156
+ # @return [Float]
157
+ # Sentiment score between -1.0 (negative sentiment) and 1.0
158
+ # (positive sentiment).
159
+ class Sentiment; end
160
+
161
+ # Represents part of speech information for a token.
162
+ # @!attribute [rw] tag
163
+ # @return [Google::Cloud::Language::V1beta2::PartOfSpeech::Tag]
164
+ # The part of speech tag.
165
+ # @!attribute [rw] aspect
166
+ # @return [Google::Cloud::Language::V1beta2::PartOfSpeech::Aspect]
167
+ # The grammatical aspect.
168
+ # @!attribute [rw] case
169
+ # @return [Google::Cloud::Language::V1beta2::PartOfSpeech::Case]
170
+ # The grammatical case.
171
+ # @!attribute [rw] form
172
+ # @return [Google::Cloud::Language::V1beta2::PartOfSpeech::Form]
173
+ # The grammatical form.
174
+ # @!attribute [rw] gender
175
+ # @return [Google::Cloud::Language::V1beta2::PartOfSpeech::Gender]
176
+ # The grammatical gender.
177
+ # @!attribute [rw] mood
178
+ # @return [Google::Cloud::Language::V1beta2::PartOfSpeech::Mood]
179
+ # The grammatical mood.
180
+ # @!attribute [rw] number
181
+ # @return [Google::Cloud::Language::V1beta2::PartOfSpeech::Number]
182
+ # The grammatical number.
183
+ # @!attribute [rw] person
184
+ # @return [Google::Cloud::Language::V1beta2::PartOfSpeech::Person]
185
+ # The grammatical person.
186
+ # @!attribute [rw] proper
187
+ # @return [Google::Cloud::Language::V1beta2::PartOfSpeech::Proper]
188
+ # The grammatical properness.
189
+ # @!attribute [rw] reciprocity
190
+ # @return [Google::Cloud::Language::V1beta2::PartOfSpeech::Reciprocity]
191
+ # The grammatical reciprocity.
192
+ # @!attribute [rw] tense
193
+ # @return [Google::Cloud::Language::V1beta2::PartOfSpeech::Tense]
194
+ # The grammatical tense.
195
+ # @!attribute [rw] voice
196
+ # @return [Google::Cloud::Language::V1beta2::PartOfSpeech::Voice]
197
+ # The grammatical voice.
198
+ class PartOfSpeech
199
+ # The part of speech tags enum.
200
+ module Tag
201
+ # Unknown
202
+ UNKNOWN = 0
203
+
204
+ # Adjective
205
+ ADJ = 1
206
+
207
+ # Adposition (preposition and postposition)
208
+ ADP = 2
209
+
210
+ # Adverb
211
+ ADV = 3
212
+
213
+ # Conjunction
214
+ CONJ = 4
215
+
216
+ # Determiner
217
+ DET = 5
218
+
219
+ # Noun (common and proper)
220
+ NOUN = 6
221
+
222
+ # Cardinal number
223
+ NUM = 7
224
+
225
+ # Pronoun
226
+ PRON = 8
227
+
228
+ # Particle or other function word
229
+ PRT = 9
230
+
231
+ # Punctuation
232
+ PUNCT = 10
233
+
234
+ # Verb (all tenses and modes)
235
+ VERB = 11
236
+
237
+ # Other: foreign words, typos, abbreviations
238
+ X = 12
239
+
240
+ # Affix
241
+ AFFIX = 13
242
+ end
243
+
244
+ # The characteristic of a verb that expresses time flow during an event.
245
+ module Aspect
246
+ # Aspect is not applicable in the analyzed language or is not predicted.
247
+ ASPECT_UNKNOWN = 0
248
+
249
+ # Perfective
250
+ PERFECTIVE = 1
251
+
252
+ # Imperfective
253
+ IMPERFECTIVE = 2
254
+
255
+ # Progressive
256
+ PROGRESSIVE = 3
257
+ end
258
+
259
+ # The grammatical function performed by a noun or pronoun in a phrase,
260
+ # clause, or sentence. In some languages, other parts of speech, such as
261
+ # adjective and determiner, take case inflection in agreement with the noun.
262
+ module Case
263
+ # Case is not applicable in the analyzed language or is not predicted.
264
+ CASE_UNKNOWN = 0
265
+
266
+ # Accusative
267
+ ACCUSATIVE = 1
268
+
269
+ # Adverbial
270
+ ADVERBIAL = 2
271
+
272
+ # Complementive
273
+ COMPLEMENTIVE = 3
274
+
275
+ # Dative
276
+ DATIVE = 4
277
+
278
+ # Genitive
279
+ GENITIVE = 5
280
+
281
+ # Instrumental
282
+ INSTRUMENTAL = 6
283
+
284
+ # Locative
285
+ LOCATIVE = 7
286
+
287
+ # Nominative
288
+ NOMINATIVE = 8
289
+
290
+ # Oblique
291
+ OBLIQUE = 9
292
+
293
+ # Partitive
294
+ PARTITIVE = 10
295
+
296
+ # Prepositional
297
+ PREPOSITIONAL = 11
298
+
299
+ # Reflexive
300
+ REFLEXIVE_CASE = 12
301
+
302
+ # Relative
303
+ RELATIVE_CASE = 13
304
+
305
+ # Vocative
306
+ VOCATIVE = 14
307
+ end
308
+
309
+ # Depending on the language, Form can be categorizing different forms of
310
+ # verbs, adjectives, adverbs, etc. For example, categorizing inflected
311
+ # endings of verbs and adjectives or distinguishing between short and long
312
+ # forms of adjectives and participles
313
+ module Form
314
+ # Form is not applicable in the analyzed language or is not predicted.
315
+ FORM_UNKNOWN = 0
316
+
317
+ # Adnomial
318
+ ADNOMIAL = 1
319
+
320
+ # Auxiliary
321
+ AUXILIARY = 2
322
+
323
+ # Complementizer
324
+ COMPLEMENTIZER = 3
325
+
326
+ # Final ending
327
+ FINAL_ENDING = 4
328
+
329
+ # Gerund
330
+ GERUND = 5
331
+
332
+ # Realis
333
+ REALIS = 6
334
+
335
+ # Irrealis
336
+ IRREALIS = 7
337
+
338
+ # Short form
339
+ SHORT = 8
340
+
341
+ # Long form
342
+ LONG = 9
343
+
344
+ # Order form
345
+ ORDER = 10
346
+
347
+ # Specific form
348
+ SPECIFIC = 11
349
+ end
350
+
351
+ # Gender classes of nouns reflected in the behaviour of associated words.
352
+ module Gender
353
+ # Gender is not applicable in the analyzed language or is not predicted.
354
+ GENDER_UNKNOWN = 0
355
+
356
+ # Feminine
357
+ FEMININE = 1
358
+
359
+ # Masculine
360
+ MASCULINE = 2
361
+
362
+ # Neuter
363
+ NEUTER = 3
364
+ end
365
+
366
+ # The grammatical feature of verbs, used for showing modality and attitude.
367
+ module Mood
368
+ # Mood is not applicable in the analyzed language or is not predicted.
369
+ MOOD_UNKNOWN = 0
370
+
371
+ # Conditional
372
+ CONDITIONAL_MOOD = 1
373
+
374
+ # Imperative
375
+ IMPERATIVE = 2
376
+
377
+ # Indicative
378
+ INDICATIVE = 3
379
+
380
+ # Interrogative
381
+ INTERROGATIVE = 4
382
+
383
+ # Jussive
384
+ JUSSIVE = 5
385
+
386
+ # Subjunctive
387
+ SUBJUNCTIVE = 6
388
+ end
389
+
390
+ # Count distinctions.
391
+ module Number
392
+ # Number is not applicable in the analyzed language or is not predicted.
393
+ NUMBER_UNKNOWN = 0
394
+
395
+ # Singular
396
+ SINGULAR = 1
397
+
398
+ # Plural
399
+ PLURAL = 2
400
+
401
+ # Dual
402
+ DUAL = 3
403
+ end
404
+
405
+ # The distinction between the speaker, second person, third person, etc.
406
+ module Person
407
+ # Person is not applicable in the analyzed language or is not predicted.
408
+ PERSON_UNKNOWN = 0
409
+
410
+ # First
411
+ FIRST = 1
412
+
413
+ # Second
414
+ SECOND = 2
415
+
416
+ # Third
417
+ THIRD = 3
418
+
419
+ # Reflexive
420
+ REFLEXIVE_PERSON = 4
421
+ end
422
+
423
+ # This category shows if the token is part of a proper name.
424
+ module Proper
425
+ # Proper is not applicable in the analyzed language or is not predicted.
426
+ PROPER_UNKNOWN = 0
427
+
428
+ # Proper
429
+ PROPER = 1
430
+
431
+ # Not proper
432
+ NOT_PROPER = 2
433
+ end
434
+
435
+ # Reciprocal features of a pronoun.
436
+ module Reciprocity
437
+ # Reciprocity is not applicable in the analyzed language or is not
438
+ # predicted.
439
+ RECIPROCITY_UNKNOWN = 0
440
+
441
+ # Reciprocal
442
+ RECIPROCAL = 1
443
+
444
+ # Non-reciprocal
445
+ NON_RECIPROCAL = 2
446
+ end
447
+
448
+ # Time reference.
449
+ module Tense
450
+ # Tense is not applicable in the analyzed language or is not predicted.
451
+ TENSE_UNKNOWN = 0
452
+
453
+ # Conditional
454
+ CONDITIONAL_TENSE = 1
455
+
456
+ # Future
457
+ FUTURE = 2
458
+
459
+ # Past
460
+ PAST = 3
461
+
462
+ # Present
463
+ PRESENT = 4
464
+
465
+ # Imperfect
466
+ IMPERFECT = 5
467
+
468
+ # Pluperfect
469
+ PLUPERFECT = 6
470
+ end
471
+
472
+ # The relationship between the action that a verb expresses and the
473
+ # participants identified by its arguments.
474
+ module Voice
475
+ # Voice is not applicable in the analyzed language or is not predicted.
476
+ VOICE_UNKNOWN = 0
477
+
478
+ # Active
479
+ ACTIVE = 1
480
+
481
+ # Causative
482
+ CAUSATIVE = 2
483
+
484
+ # Passive
485
+ PASSIVE = 3
486
+ end
487
+ end
488
+
489
+ # Represents dependency parse tree information for a token.
490
+ # @!attribute [rw] head_token_index
491
+ # @return [Integer]
492
+ # Represents the head of this token in the dependency tree.
493
+ # This is the index of the token which has an arc going to this token.
494
+ # The index is the position of the token in the array of tokens returned
495
+ # by the API method. If this token is a root token, then the
496
+ # +head_token_index+ is its own index.
497
+ # @!attribute [rw] label
498
+ # @return [Google::Cloud::Language::V1beta2::DependencyEdge::Label]
499
+ # The parse label for the token.
500
+ class DependencyEdge
501
+ # The parse label enum for the token.
502
+ module Label
503
+ # Unknown
504
+ UNKNOWN = 0
505
+
506
+ # Abbreviation modifier
507
+ ABBREV = 1
508
+
509
+ # Adjectival complement
510
+ ACOMP = 2
511
+
512
+ # Adverbial clause modifier
513
+ ADVCL = 3
514
+
515
+ # Adverbial modifier
516
+ ADVMOD = 4
517
+
518
+ # Adjectival modifier of an NP
519
+ AMOD = 5
520
+
521
+ # Appositional modifier of an NP
522
+ APPOS = 6
523
+
524
+ # Attribute dependent of a copular verb
525
+ ATTR = 7
526
+
527
+ # Auxiliary (non-main) verb
528
+ AUX = 8
529
+
530
+ # Passive auxiliary
531
+ AUXPASS = 9
532
+
533
+ # Coordinating conjunction
534
+ CC = 10
535
+
536
+ # Clausal complement of a verb or adjective
537
+ CCOMP = 11
538
+
539
+ # Conjunct
540
+ CONJ = 12
541
+
542
+ # Clausal subject
543
+ CSUBJ = 13
544
+
545
+ # Clausal passive subject
546
+ CSUBJPASS = 14
547
+
548
+ # Dependency (unable to determine)
549
+ DEP = 15
550
+
551
+ # Determiner
552
+ DET = 16
553
+
554
+ # Discourse
555
+ DISCOURSE = 17
556
+
557
+ # Direct object
558
+ DOBJ = 18
559
+
560
+ # Expletive
561
+ EXPL = 19
562
+
563
+ # Goes with (part of a word in a text not well edited)
564
+ GOESWITH = 20
565
+
566
+ # Indirect object
567
+ IOBJ = 21
568
+
569
+ # Marker (word introducing a subordinate clause)
570
+ MARK = 22
571
+
572
+ # Multi-word expression
573
+ MWE = 23
574
+
575
+ # Multi-word verbal expression
576
+ MWV = 24
577
+
578
+ # Negation modifier
579
+ NEG = 25
580
+
581
+ # Noun compound modifier
582
+ NN = 26
583
+
584
+ # Noun phrase used as an adverbial modifier
585
+ NPADVMOD = 27
586
+
587
+ # Nominal subject
588
+ NSUBJ = 28
589
+
590
+ # Passive nominal subject
591
+ NSUBJPASS = 29
592
+
593
+ # Numeric modifier of a noun
594
+ NUM = 30
595
+
596
+ # Element of compound number
597
+ NUMBER = 31
598
+
599
+ # Punctuation mark
600
+ P = 32
601
+
602
+ # Parataxis relation
603
+ PARATAXIS = 33
604
+
605
+ # Participial modifier
606
+ PARTMOD = 34
607
+
608
+ # The complement of a preposition is a clause
609
+ PCOMP = 35
610
+
611
+ # Object of a preposition
612
+ POBJ = 36
613
+
614
+ # Possession modifier
615
+ POSS = 37
616
+
617
+ # Postverbal negative particle
618
+ POSTNEG = 38
619
+
620
+ # Predicate complement
621
+ PRECOMP = 39
622
+
623
+ # Preconjunt
624
+ PRECONJ = 40
625
+
626
+ # Predeterminer
627
+ PREDET = 41
628
+
629
+ # Prefix
630
+ PREF = 42
631
+
632
+ # Prepositional modifier
633
+ PREP = 43
634
+
635
+ # The relationship between a verb and verbal morpheme
636
+ PRONL = 44
637
+
638
+ # Particle
639
+ PRT = 45
640
+
641
+ # Associative or possessive marker
642
+ PS = 46
643
+
644
+ # Quantifier phrase modifier
645
+ QUANTMOD = 47
646
+
647
+ # Relative clause modifier
648
+ RCMOD = 48
649
+
650
+ # Complementizer in relative clause
651
+ RCMODREL = 49
652
+
653
+ # Ellipsis without a preceding predicate
654
+ RDROP = 50
655
+
656
+ # Referent
657
+ REF = 51
658
+
659
+ # Remnant
660
+ REMNANT = 52
661
+
662
+ # Reparandum
663
+ REPARANDUM = 53
664
+
665
+ # Root
666
+ ROOT = 54
667
+
668
+ # Suffix specifying a unit of number
669
+ SNUM = 55
670
+
671
+ # Suffix
672
+ SUFF = 56
673
+
674
+ # Temporal modifier
675
+ TMOD = 57
676
+
677
+ # Topic marker
678
+ TOPIC = 58
679
+
680
+ # Clause headed by an infinite form of the verb that modifies a noun
681
+ VMOD = 59
682
+
683
+ # Vocative
684
+ VOCATIVE = 60
685
+
686
+ # Open clausal complement
687
+ XCOMP = 61
688
+
689
+ # Name suffix
690
+ SUFFIX = 62
691
+
692
+ # Name title
693
+ TITLE = 63
694
+
695
+ # Adverbial phrase modifier
696
+ ADVPHMOD = 64
697
+
698
+ # Causative auxiliary
699
+ AUXCAUS = 65
700
+
701
+ # Helper auxiliary
702
+ AUXVV = 66
703
+
704
+ # Rentaishi (Prenominal modifier)
705
+ DTMOD = 67
706
+
707
+ # Foreign words
708
+ FOREIGN = 68
709
+
710
+ # Keyword
711
+ KW = 69
712
+
713
+ # List for chains of comparable items
714
+ LIST = 70
715
+
716
+ # Nominalized clause
717
+ NOMC = 71
718
+
719
+ # Nominalized clausal subject
720
+ NOMCSUBJ = 72
721
+
722
+ # Nominalized clausal passive
723
+ NOMCSUBJPASS = 73
724
+
725
+ # Compound of numeric modifier
726
+ NUMC = 74
727
+
728
+ # Copula
729
+ COP = 75
730
+
731
+ # Dislocated relation (for fronted/topicalized elements)
732
+ DISLOCATED = 76
733
+ end
734
+ end
735
+
736
+ # Represents a mention for an entity in the text. Currently, proper noun
737
+ # mentions are supported.
738
+ # @!attribute [rw] text
739
+ # @return [Google::Cloud::Language::V1beta2::TextSpan]
740
+ # The mention text.
741
+ # @!attribute [rw] type
742
+ # @return [Google::Cloud::Language::V1beta2::EntityMention::Type]
743
+ # The type of the entity mention.
744
+ # @!attribute [rw] sentiment
745
+ # @return [Google::Cloud::Language::V1beta2::Sentiment]
746
+ # For calls to AnalyzeEntitySentiment or if
747
+ # AnnotateTextRequest::Features#extract_entity_sentiment is set to
748
+ # true, this field will contain the sentiment expressed for this mention of
749
+ # the entity in the provided document.
750
+ class EntityMention
751
+ # The supported types of mentions.
752
+ module Type
753
+ # Unknown
754
+ TYPE_UNKNOWN = 0
755
+
756
+ # Proper name
757
+ PROPER = 1
758
+
759
+ # Common noun (or noun compound)
760
+ COMMON = 2
761
+ end
762
+ end
763
+
764
+ # Represents an output piece of text.
765
+ # @!attribute [rw] content
766
+ # @return [String]
767
+ # The content of the output text.
768
+ # @!attribute [rw] begin_offset
769
+ # @return [Integer]
770
+ # The API calculates the beginning offset of the content in the original
771
+ # document according to the EncodingType specified in the API request.
772
+ class TextSpan; end
773
+
774
+ # The sentiment analysis request message.
775
+ # @!attribute [rw] document
776
+ # @return [Google::Cloud::Language::V1beta2::Document]
777
+ # Input document. Currently, +analyzeSentiment+ only supports English text
778
+ # (Document#language="EN").
779
+ # @!attribute [rw] encoding_type
780
+ # @return [Google::Cloud::Language::V1beta2::EncodingType]
781
+ # The encoding type used by the API to calculate sentence offsets for the
782
+ # sentence sentiment.
783
+ class AnalyzeSentimentRequest; end
784
+
785
+ # The sentiment analysis response message.
786
+ # @!attribute [rw] document_sentiment
787
+ # @return [Google::Cloud::Language::V1beta2::Sentiment]
788
+ # The overall sentiment of the input document.
789
+ # @!attribute [rw] language
790
+ # @return [String]
791
+ # The language of the text, which will be the same as the language specified
792
+ # in the request or, if not specified, the automatically-detected language.
793
+ # @!attribute [rw] sentences
794
+ # @return [Array<Google::Cloud::Language::V1beta2::Sentence>]
795
+ # The sentiment for all the sentences in the document.
796
+ class AnalyzeSentimentResponse; end
797
+
798
+ # The entity-level sentiment analysis request message.
799
+ # @!attribute [rw] document
800
+ # @return [Google::Cloud::Language::V1beta2::Document]
801
+ # Input document.
802
+ # @!attribute [rw] encoding_type
803
+ # @return [Google::Cloud::Language::V1beta2::EncodingType]
804
+ # The encoding type used by the API to calculate offsets.
805
+ class AnalyzeEntitySentimentRequest; end
806
+
807
+ # The entity-level sentiment analysis response message.
808
+ # @!attribute [rw] entities
809
+ # @return [Array<Google::Cloud::Language::V1beta2::Entity>]
810
+ # The recognized entities in the input document with associated sentiments.
811
+ # @!attribute [rw] language
812
+ # @return [String]
813
+ # The language of the text, which will be the same as the language specified
814
+ # in the request or, if not specified, the automatically-detected language.
815
+ # See Document#language field for more details.
816
+ class AnalyzeEntitySentimentResponse; end
817
+
818
+ # The entity analysis request message.
819
+ # @!attribute [rw] document
820
+ # @return [Google::Cloud::Language::V1beta2::Document]
821
+ # Input document.
822
+ # @!attribute [rw] encoding_type
823
+ # @return [Google::Cloud::Language::V1beta2::EncodingType]
824
+ # The encoding type used by the API to calculate offsets.
825
+ class AnalyzeEntitiesRequest; end
826
+
827
+ # The entity analysis response message.
828
+ # @!attribute [rw] entities
829
+ # @return [Array<Google::Cloud::Language::V1beta2::Entity>]
830
+ # The recognized entities in the input document.
831
+ # @!attribute [rw] language
832
+ # @return [String]
833
+ # The language of the text, which will be the same as the language specified
834
+ # in the request or, if not specified, the automatically-detected language.
835
+ # See Document#language field for more details.
836
+ class AnalyzeEntitiesResponse; end
837
+
838
+ # The syntax analysis request message.
839
+ # @!attribute [rw] document
840
+ # @return [Google::Cloud::Language::V1beta2::Document]
841
+ # Input document.
842
+ # @!attribute [rw] encoding_type
843
+ # @return [Google::Cloud::Language::V1beta2::EncodingType]
844
+ # The encoding type used by the API to calculate offsets.
845
+ class AnalyzeSyntaxRequest; end
846
+
847
+ # The syntax analysis response message.
848
+ # @!attribute [rw] sentences
849
+ # @return [Array<Google::Cloud::Language::V1beta2::Sentence>]
850
+ # Sentences in the input document.
851
+ # @!attribute [rw] tokens
852
+ # @return [Array<Google::Cloud::Language::V1beta2::Token>]
853
+ # Tokens, along with their syntactic information, in the input document.
854
+ # @!attribute [rw] language
855
+ # @return [String]
856
+ # The language of the text, which will be the same as the language specified
857
+ # in the request or, if not specified, the automatically-detected language.
858
+ # See Document#language field for more details.
859
+ class AnalyzeSyntaxResponse; end
860
+
861
+ # The request message for the text annotation API, which can perform multiple
862
+ # analysis types (sentiment, entities, and syntax) in one call.
863
+ # @!attribute [rw] document
864
+ # @return [Google::Cloud::Language::V1beta2::Document]
865
+ # Input document.
866
+ # @!attribute [rw] features
867
+ # @return [Google::Cloud::Language::V1beta2::AnnotateTextRequest::Features]
868
+ # The enabled features.
869
+ # @!attribute [rw] encoding_type
870
+ # @return [Google::Cloud::Language::V1beta2::EncodingType]
871
+ # The encoding type used by the API to calculate offsets.
872
+ class AnnotateTextRequest
873
+ # All available features for sentiment, syntax, and semantic analysis.
874
+ # Setting each one to true will enable that specific analysis for the input.
875
+ # @!attribute [rw] extract_syntax
876
+ # @return [true, false]
877
+ # Extract syntax information.
878
+ # @!attribute [rw] extract_entities
879
+ # @return [true, false]
880
+ # Extract entities.
881
+ # @!attribute [rw] extract_document_sentiment
882
+ # @return [true, false]
883
+ # Extract document-level sentiment.
884
+ # @!attribute [rw] extract_entity_sentiment
885
+ # @return [true, false]
886
+ # Extract entities and their associated sentiment.
887
+ class Features; end
888
+ end
889
+
890
+ # The text annotations response message.
891
+ # @!attribute [rw] sentences
892
+ # @return [Array<Google::Cloud::Language::V1beta2::Sentence>]
893
+ # Sentences in the input document. Populated if the user enables
894
+ # AnnotateTextRequest::Features#extract_syntax.
895
+ # @!attribute [rw] tokens
896
+ # @return [Array<Google::Cloud::Language::V1beta2::Token>]
897
+ # Tokens, along with their syntactic information, in the input document.
898
+ # Populated if the user enables
899
+ # AnnotateTextRequest::Features#extract_syntax.
900
+ # @!attribute [rw] entities
901
+ # @return [Array<Google::Cloud::Language::V1beta2::Entity>]
902
+ # Entities, along with their semantic information, in the input document.
903
+ # Populated if the user enables
904
+ # AnnotateTextRequest::Features#extract_entities.
905
+ # @!attribute [rw] document_sentiment
906
+ # @return [Google::Cloud::Language::V1beta2::Sentiment]
907
+ # The overall sentiment for the document. Populated if the user enables
908
+ # AnnotateTextRequest::Features#extract_document_sentiment.
909
+ # @!attribute [rw] language
910
+ # @return [String]
911
+ # The language of the text, which will be the same as the language specified
912
+ # in the request or, if not specified, the automatically-detected language.
913
+ # See Document#language field for more details.
914
+ class AnnotateTextResponse; end
915
+
916
+ # Represents the text encoding that the caller uses to process the output.
917
+ # Providing an +EncodingType+ is recommended because the API provides the
918
+ # beginning offsets for various outputs, such as tokens and mentions, and
919
+ # languages that natively use different text encodings may access offsets
920
+ # differently.
921
+ module EncodingType
922
+ # If +EncodingType+ is not specified, encoding-dependent information (such as
923
+ # +begin_offset+) will be set at +-1+.
924
+ NONE = 0
925
+
926
+ # Encoding-dependent information (such as +begin_offset+) is calculated based
927
+ # on the UTF-8 encoding of the input. C++ and Go are examples of languages
928
+ # that use this encoding natively.
929
+ UTF8 = 1
930
+
931
+ # Encoding-dependent information (such as +begin_offset+) is calculated based
932
+ # on the UTF-16 encoding of the input. Java and Javascript are examples of
933
+ # languages that use this encoding natively.
934
+ UTF16 = 2
935
+
936
+ # Encoding-dependent information (such as +begin_offset+) is calculated based
937
+ # on the UTF-32 encoding of the input. Python is an example of a language
938
+ # that uses this encoding natively.
939
+ UTF32 = 3
940
+ end
941
+ end
942
+ end
943
+ end
944
+ end