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