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.
@@ -0,0 +1,343 @@
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
+ # EDITING INSTRUCTIONS
16
+ # This file was generated from the file
17
+ # https://github.com/googleapis/googleapis/blob/master/google/cloud/language/v1beta2/language_service.proto,
18
+ # and updates to that file get reflected here through a refresh process.
19
+ # For the short term, the refresh process will only be runnable by Google
20
+ # engineers.
21
+ #
22
+ # The only allowed edits are to method and file documentation. A 3-way
23
+ # merge preserves those additions if the generated source changes.
24
+
25
+ require "json"
26
+ require "pathname"
27
+
28
+ require "google/gax"
29
+
30
+ require "google/cloud/language/v1beta2/language_service_pb"
31
+
32
+ module Google
33
+ module Cloud
34
+ module Language
35
+ module V1beta2
36
+ # Provides text analysis operations such as sentiment analysis and entity
37
+ # recognition.
38
+ #
39
+ # @!attribute [r] language_service_stub
40
+ # @return [Google::Cloud::Language::V1beta2::LanguageService::Stub]
41
+ class LanguageServiceClient
42
+ attr_reader :language_service_stub
43
+
44
+ # The default address of the service.
45
+ SERVICE_ADDRESS = "language.googleapis.com".freeze
46
+
47
+ # The default port of the service.
48
+ DEFAULT_SERVICE_PORT = 443
49
+
50
+ DEFAULT_TIMEOUT = 30
51
+
52
+ # The scopes needed to make gRPC calls to all of the methods defined in
53
+ # this service.
54
+ ALL_SCOPES = [
55
+ "https://www.googleapis.com/auth/cloud-platform"
56
+ ].freeze
57
+
58
+ # @param service_path [String]
59
+ # The domain name of the API remote host.
60
+ # @param port [Integer]
61
+ # The port on which to connect to the remote host.
62
+ # @param channel [Channel]
63
+ # A Channel object through which to make calls.
64
+ # @param chan_creds [Grpc::ChannelCredentials]
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.
72
+ # @param client_config[Hash]
73
+ # A Hash for call options for each method. See
74
+ # Google::Gax#construct_settings for the structure of
75
+ # this data. Falls back to the default config if not specified
76
+ # or the specified config is missing data points.
77
+ # @param timeout [Numeric]
78
+ # The default timeout, in seconds, for calls made through this client.
79
+ def initialize \
80
+ service_path: SERVICE_ADDRESS,
81
+ port: DEFAULT_SERVICE_PORT,
82
+ channel: nil,
83
+ chan_creds: nil,
84
+ updater_proc: nil,
85
+ scopes: ALL_SCOPES,
86
+ client_config: {},
87
+ timeout: DEFAULT_TIMEOUT,
88
+ app_name: nil,
89
+ app_version: nil,
90
+ lib_name: nil,
91
+ lib_version: ""
92
+ # These require statements are intentionally placed here to initialize
93
+ # the gRPC module only when it's required.
94
+ # See https://github.com/googleapis/toolkit/issues/446
95
+ require "google/gax/grpc"
96
+ require "google/cloud/language/v1beta2/language_service_services_pb"
97
+
98
+
99
+ if app_name || app_version
100
+ warn "`app_name` and `app_version` are no longer being used in the request headers."
101
+ end
102
+
103
+ google_api_client = "gl-ruby/#{RUBY_VERSION}"
104
+ google_api_client << " #{lib_name}/#{lib_version}" if lib_name
105
+ google_api_client << " gapic/0.6.8 gax/#{Google::Gax::VERSION}"
106
+ google_api_client << " grpc/#{GRPC::VERSION}"
107
+ google_api_client.freeze
108
+
109
+ headers = { :"x-goog-api-client" => google_api_client }
110
+ client_config_file = Pathname.new(__dir__).join(
111
+ "language_service_client_config.json"
112
+ )
113
+ defaults = client_config_file.open do |f|
114
+ Google::Gax.construct_settings(
115
+ "google.cloud.language.v1beta2.LanguageService",
116
+ JSON.parse(f.read),
117
+ client_config,
118
+ Google::Gax::Grpc::STATUS_CODE_NAMES,
119
+ timeout,
120
+ errors: Google::Gax::Grpc::API_ERRORS,
121
+ kwargs: headers
122
+ )
123
+ end
124
+ @language_service_stub = Google::Gax::Grpc.create_stub(
125
+ service_path,
126
+ port,
127
+ chan_creds: chan_creds,
128
+ channel: channel,
129
+ updater_proc: updater_proc,
130
+ scopes: scopes,
131
+ &Google::Cloud::Language::V1beta2::LanguageService::Stub.method(:new)
132
+ )
133
+
134
+ @analyze_sentiment = Google::Gax.create_api_call(
135
+ @language_service_stub.method(:analyze_sentiment),
136
+ defaults["analyze_sentiment"]
137
+ )
138
+ @analyze_entities = Google::Gax.create_api_call(
139
+ @language_service_stub.method(:analyze_entities),
140
+ defaults["analyze_entities"]
141
+ )
142
+ @analyze_entity_sentiment = Google::Gax.create_api_call(
143
+ @language_service_stub.method(:analyze_entity_sentiment),
144
+ defaults["analyze_entity_sentiment"]
145
+ )
146
+ @analyze_syntax = Google::Gax.create_api_call(
147
+ @language_service_stub.method(:analyze_syntax),
148
+ defaults["analyze_syntax"]
149
+ )
150
+ @annotate_text = Google::Gax.create_api_call(
151
+ @language_service_stub.method(:annotate_text),
152
+ defaults["annotate_text"]
153
+ )
154
+ end
155
+
156
+ # Service calls
157
+
158
+ # Analyzes the sentiment of the provided text.
159
+ #
160
+ # @param document [Google::Cloud::Language::V1beta2::Document]
161
+ # Input document. Currently, +analyzeSentiment+ only supports English text
162
+ # (Document#language="EN").
163
+ # @param encoding_type [Google::Cloud::Language::V1beta2::EncodingType]
164
+ # The encoding type used by the API to calculate sentence offsets for the
165
+ # sentence sentiment.
166
+ # @param options [Google::Gax::CallOptions]
167
+ # Overrides the default settings for this call, e.g, timeout,
168
+ # retries, etc.
169
+ # @return [Google::Cloud::Language::V1beta2::AnalyzeSentimentResponse]
170
+ # @raise [Google::Gax::GaxError] if the RPC is aborted.
171
+ # @example
172
+ # require "google/cloud/language/v1beta2"
173
+ #
174
+ # Document = Google::Cloud::Language::V1beta2::Document
175
+ # LanguageServiceClient = Google::Cloud::Language::V1beta2::LanguageServiceClient
176
+ #
177
+ # language_service_client = LanguageServiceClient.new
178
+ # document = Document.new
179
+ # response = language_service_client.analyze_sentiment(document)
180
+
181
+ def analyze_sentiment \
182
+ document,
183
+ encoding_type: nil,
184
+ options: nil
185
+ req = Google::Cloud::Language::V1beta2::AnalyzeSentimentRequest.new({
186
+ document: document,
187
+ encoding_type: encoding_type
188
+ }.delete_if { |_, v| v.nil? })
189
+ @analyze_sentiment.call(req, options)
190
+ end
191
+
192
+ # Finds named entities (currently proper names and common nouns) in the text
193
+ # along with entity types, salience, mentions for each entity, and
194
+ # other properties.
195
+ #
196
+ # @param document [Google::Cloud::Language::V1beta2::Document]
197
+ # Input document.
198
+ # @param encoding_type [Google::Cloud::Language::V1beta2::EncodingType]
199
+ # The encoding type used by the API to calculate offsets.
200
+ # @param options [Google::Gax::CallOptions]
201
+ # Overrides the default settings for this call, e.g, timeout,
202
+ # retries, etc.
203
+ # @return [Google::Cloud::Language::V1beta2::AnalyzeEntitiesResponse]
204
+ # @raise [Google::Gax::GaxError] if the RPC is aborted.
205
+ # @example
206
+ # require "google/cloud/language/v1beta2"
207
+ #
208
+ # Document = Google::Cloud::Language::V1beta2::Document
209
+ # EncodingType = Google::Cloud::Language::V1beta2::EncodingType
210
+ # LanguageServiceClient = Google::Cloud::Language::V1beta2::LanguageServiceClient
211
+ #
212
+ # language_service_client = LanguageServiceClient.new
213
+ # document = Document.new
214
+ # encoding_type = EncodingType::NONE
215
+ # response = language_service_client.analyze_entities(document, encoding_type)
216
+
217
+ def analyze_entities \
218
+ document,
219
+ encoding_type,
220
+ options: nil
221
+ req = Google::Cloud::Language::V1beta2::AnalyzeEntitiesRequest.new({
222
+ document: document,
223
+ encoding_type: encoding_type
224
+ }.delete_if { |_, v| v.nil? })
225
+ @analyze_entities.call(req, options)
226
+ end
227
+
228
+ # Finds entities, similar to AnalyzeEntities in the text and analyzes
229
+ # sentiment associated with each entity and its mentions.
230
+ #
231
+ # @param document [Google::Cloud::Language::V1beta2::Document]
232
+ # Input document.
233
+ # @param encoding_type [Google::Cloud::Language::V1beta2::EncodingType]
234
+ # The encoding type used by the API to calculate offsets.
235
+ # @param options [Google::Gax::CallOptions]
236
+ # Overrides the default settings for this call, e.g, timeout,
237
+ # retries, etc.
238
+ # @return [Google::Cloud::Language::V1beta2::AnalyzeEntitySentimentResponse]
239
+ # @raise [Google::Gax::GaxError] if the RPC is aborted.
240
+ # @example
241
+ # require "google/cloud/language/v1beta2"
242
+ #
243
+ # Document = Google::Cloud::Language::V1beta2::Document
244
+ # EncodingType = Google::Cloud::Language::V1beta2::EncodingType
245
+ # LanguageServiceClient = Google::Cloud::Language::V1beta2::LanguageServiceClient
246
+ #
247
+ # language_service_client = LanguageServiceClient.new
248
+ # document = Document.new
249
+ # encoding_type = EncodingType::NONE
250
+ # response = language_service_client.analyze_entity_sentiment(document, encoding_type)
251
+
252
+ def analyze_entity_sentiment \
253
+ document,
254
+ encoding_type,
255
+ options: nil
256
+ req = Google::Cloud::Language::V1beta2::AnalyzeEntitySentimentRequest.new({
257
+ document: document,
258
+ encoding_type: encoding_type
259
+ }.delete_if { |_, v| v.nil? })
260
+ @analyze_entity_sentiment.call(req, options)
261
+ end
262
+
263
+ # Analyzes the syntax of the text and provides sentence boundaries and
264
+ # tokenization along with part of speech tags, dependency trees, and other
265
+ # properties.
266
+ #
267
+ # @param document [Google::Cloud::Language::V1beta2::Document]
268
+ # Input document.
269
+ # @param encoding_type [Google::Cloud::Language::V1beta2::EncodingType]
270
+ # The encoding type used by the API to calculate offsets.
271
+ # @param options [Google::Gax::CallOptions]
272
+ # Overrides the default settings for this call, e.g, timeout,
273
+ # retries, etc.
274
+ # @return [Google::Cloud::Language::V1beta2::AnalyzeSyntaxResponse]
275
+ # @raise [Google::Gax::GaxError] if the RPC is aborted.
276
+ # @example
277
+ # require "google/cloud/language/v1beta2"
278
+ #
279
+ # Document = Google::Cloud::Language::V1beta2::Document
280
+ # EncodingType = Google::Cloud::Language::V1beta2::EncodingType
281
+ # LanguageServiceClient = Google::Cloud::Language::V1beta2::LanguageServiceClient
282
+ #
283
+ # language_service_client = LanguageServiceClient.new
284
+ # document = Document.new
285
+ # encoding_type = EncodingType::NONE
286
+ # response = language_service_client.analyze_syntax(document, encoding_type)
287
+
288
+ def analyze_syntax \
289
+ document,
290
+ encoding_type,
291
+ options: nil
292
+ req = Google::Cloud::Language::V1beta2::AnalyzeSyntaxRequest.new({
293
+ document: document,
294
+ encoding_type: encoding_type
295
+ }.delete_if { |_, v| v.nil? })
296
+ @analyze_syntax.call(req, options)
297
+ end
298
+
299
+ # A convenience method that provides all syntax, sentiment, and entity
300
+ # features in one call.
301
+ #
302
+ # @param document [Google::Cloud::Language::V1beta2::Document]
303
+ # Input document.
304
+ # @param features [Google::Cloud::Language::V1beta2::AnnotateTextRequest::Features]
305
+ # The enabled features.
306
+ # @param encoding_type [Google::Cloud::Language::V1beta2::EncodingType]
307
+ # The encoding type used by the API to calculate offsets.
308
+ # @param options [Google::Gax::CallOptions]
309
+ # Overrides the default settings for this call, e.g, timeout,
310
+ # retries, etc.
311
+ # @return [Google::Cloud::Language::V1beta2::AnnotateTextResponse]
312
+ # @raise [Google::Gax::GaxError] if the RPC is aborted.
313
+ # @example
314
+ # require "google/cloud/language/v1beta2"
315
+ #
316
+ # Document = Google::Cloud::Language::V1beta2::Document
317
+ # EncodingType = Google::Cloud::Language::V1beta2::EncodingType
318
+ # Features = Google::Cloud::Language::V1beta2::AnnotateTextRequest::Features
319
+ # LanguageServiceClient = Google::Cloud::Language::V1beta2::LanguageServiceClient
320
+ #
321
+ # language_service_client = LanguageServiceClient.new
322
+ # document = Document.new
323
+ # features = Features.new
324
+ # encoding_type = EncodingType::NONE
325
+ # response = language_service_client.annotate_text(document, features, encoding_type)
326
+
327
+ def annotate_text \
328
+ document,
329
+ features,
330
+ encoding_type,
331
+ options: nil
332
+ req = Google::Cloud::Language::V1beta2::AnnotateTextRequest.new({
333
+ document: document,
334
+ features: features,
335
+ encoding_type: encoding_type
336
+ }.delete_if { |_, v| v.nil? })
337
+ @annotate_text.call(req, options)
338
+ end
339
+ end
340
+ end
341
+ end
342
+ end
343
+ end
@@ -0,0 +1,53 @@
1
+ {
2
+ "interfaces": {
3
+ "google.cloud.language.v1beta2.LanguageService": {
4
+ "retry_codes": {
5
+ "idempotent": [
6
+ "DEADLINE_EXCEEDED",
7
+ "UNAVAILABLE"
8
+ ],
9
+ "non_idempotent": [
10
+ "UNAVAILABLE"
11
+ ]
12
+ },
13
+ "retry_params": {
14
+ "default": {
15
+ "initial_retry_delay_millis": 100,
16
+ "retry_delay_multiplier": 1.3,
17
+ "max_retry_delay_millis": 60000,
18
+ "initial_rpc_timeout_millis": 60000,
19
+ "rpc_timeout_multiplier": 1.0,
20
+ "max_rpc_timeout_millis": 60000,
21
+ "total_timeout_millis": 600000
22
+ }
23
+ },
24
+ "methods": {
25
+ "AnalyzeSentiment": {
26
+ "timeout_millis": 30000,
27
+ "retry_codes_name": "idempotent",
28
+ "retry_params_name": "default"
29
+ },
30
+ "AnalyzeEntities": {
31
+ "timeout_millis": 30000,
32
+ "retry_codes_name": "idempotent",
33
+ "retry_params_name": "default"
34
+ },
35
+ "AnalyzeEntitySentiment": {
36
+ "timeout_millis": 30000,
37
+ "retry_codes_name": "idempotent",
38
+ "retry_params_name": "default"
39
+ },
40
+ "AnalyzeSyntax": {
41
+ "timeout_millis": 30000,
42
+ "retry_codes_name": "idempotent",
43
+ "retry_params_name": "default"
44
+ },
45
+ "AnnotateText": {
46
+ "timeout_millis": 30000,
47
+ "retry_codes_name": "idempotent",
48
+ "retry_params_name": "default"
49
+ }
50
+ }
51
+ }
52
+ }
53
+ }
@@ -0,0 +1,377 @@
1
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
2
+ # source: google/cloud/language/v1beta2/language_service.proto
3
+
4
+ require 'google/protobuf'
5
+
6
+ require 'google/api/annotations_pb'
7
+ require 'google/longrunning/operations_pb'
8
+ require 'google/protobuf/timestamp_pb'
9
+ require 'google/rpc/status_pb'
10
+ Google::Protobuf::DescriptorPool.generated_pool.build do
11
+ add_message "google.cloud.language.v1beta2.Document" do
12
+ optional :type, :enum, 1, "google.cloud.language.v1beta2.Document.Type"
13
+ optional :language, :string, 4
14
+ oneof :source do
15
+ optional :content, :string, 2
16
+ optional :gcs_content_uri, :string, 3
17
+ end
18
+ end
19
+ add_enum "google.cloud.language.v1beta2.Document.Type" do
20
+ value :TYPE_UNSPECIFIED, 0
21
+ value :PLAIN_TEXT, 1
22
+ value :HTML, 2
23
+ end
24
+ add_message "google.cloud.language.v1beta2.Sentence" do
25
+ optional :text, :message, 1, "google.cloud.language.v1beta2.TextSpan"
26
+ optional :sentiment, :message, 2, "google.cloud.language.v1beta2.Sentiment"
27
+ end
28
+ add_message "google.cloud.language.v1beta2.Entity" do
29
+ optional :name, :string, 1
30
+ optional :type, :enum, 2, "google.cloud.language.v1beta2.Entity.Type"
31
+ map :metadata, :string, :string, 3
32
+ optional :salience, :float, 4
33
+ repeated :mentions, :message, 5, "google.cloud.language.v1beta2.EntityMention"
34
+ optional :sentiment, :message, 6, "google.cloud.language.v1beta2.Sentiment"
35
+ end
36
+ add_enum "google.cloud.language.v1beta2.Entity.Type" do
37
+ value :UNKNOWN, 0
38
+ value :PERSON, 1
39
+ value :LOCATION, 2
40
+ value :ORGANIZATION, 3
41
+ value :EVENT, 4
42
+ value :WORK_OF_ART, 5
43
+ value :CONSUMER_GOOD, 6
44
+ value :OTHER, 7
45
+ end
46
+ add_message "google.cloud.language.v1beta2.Token" do
47
+ optional :text, :message, 1, "google.cloud.language.v1beta2.TextSpan"
48
+ optional :part_of_speech, :message, 2, "google.cloud.language.v1beta2.PartOfSpeech"
49
+ optional :dependency_edge, :message, 3, "google.cloud.language.v1beta2.DependencyEdge"
50
+ optional :lemma, :string, 4
51
+ end
52
+ add_message "google.cloud.language.v1beta2.Sentiment" do
53
+ optional :magnitude, :float, 2
54
+ optional :score, :float, 3
55
+ end
56
+ add_message "google.cloud.language.v1beta2.PartOfSpeech" do
57
+ optional :tag, :enum, 1, "google.cloud.language.v1beta2.PartOfSpeech.Tag"
58
+ optional :aspect, :enum, 2, "google.cloud.language.v1beta2.PartOfSpeech.Aspect"
59
+ optional :case, :enum, 3, "google.cloud.language.v1beta2.PartOfSpeech.Case"
60
+ optional :form, :enum, 4, "google.cloud.language.v1beta2.PartOfSpeech.Form"
61
+ optional :gender, :enum, 5, "google.cloud.language.v1beta2.PartOfSpeech.Gender"
62
+ optional :mood, :enum, 6, "google.cloud.language.v1beta2.PartOfSpeech.Mood"
63
+ optional :number, :enum, 7, "google.cloud.language.v1beta2.PartOfSpeech.Number"
64
+ optional :person, :enum, 8, "google.cloud.language.v1beta2.PartOfSpeech.Person"
65
+ optional :proper, :enum, 9, "google.cloud.language.v1beta2.PartOfSpeech.Proper"
66
+ optional :reciprocity, :enum, 10, "google.cloud.language.v1beta2.PartOfSpeech.Reciprocity"
67
+ optional :tense, :enum, 11, "google.cloud.language.v1beta2.PartOfSpeech.Tense"
68
+ optional :voice, :enum, 12, "google.cloud.language.v1beta2.PartOfSpeech.Voice"
69
+ end
70
+ add_enum "google.cloud.language.v1beta2.PartOfSpeech.Tag" do
71
+ value :UNKNOWN, 0
72
+ value :ADJ, 1
73
+ value :ADP, 2
74
+ value :ADV, 3
75
+ value :CONJ, 4
76
+ value :DET, 5
77
+ value :NOUN, 6
78
+ value :NUM, 7
79
+ value :PRON, 8
80
+ value :PRT, 9
81
+ value :PUNCT, 10
82
+ value :VERB, 11
83
+ value :X, 12
84
+ value :AFFIX, 13
85
+ end
86
+ add_enum "google.cloud.language.v1beta2.PartOfSpeech.Aspect" do
87
+ value :ASPECT_UNKNOWN, 0
88
+ value :PERFECTIVE, 1
89
+ value :IMPERFECTIVE, 2
90
+ value :PROGRESSIVE, 3
91
+ end
92
+ add_enum "google.cloud.language.v1beta2.PartOfSpeech.Case" do
93
+ value :CASE_UNKNOWN, 0
94
+ value :ACCUSATIVE, 1
95
+ value :ADVERBIAL, 2
96
+ value :COMPLEMENTIVE, 3
97
+ value :DATIVE, 4
98
+ value :GENITIVE, 5
99
+ value :INSTRUMENTAL, 6
100
+ value :LOCATIVE, 7
101
+ value :NOMINATIVE, 8
102
+ value :OBLIQUE, 9
103
+ value :PARTITIVE, 10
104
+ value :PREPOSITIONAL, 11
105
+ value :REFLEXIVE_CASE, 12
106
+ value :RELATIVE_CASE, 13
107
+ value :VOCATIVE, 14
108
+ end
109
+ add_enum "google.cloud.language.v1beta2.PartOfSpeech.Form" do
110
+ value :FORM_UNKNOWN, 0
111
+ value :ADNOMIAL, 1
112
+ value :AUXILIARY, 2
113
+ value :COMPLEMENTIZER, 3
114
+ value :FINAL_ENDING, 4
115
+ value :GERUND, 5
116
+ value :REALIS, 6
117
+ value :IRREALIS, 7
118
+ value :SHORT, 8
119
+ value :LONG, 9
120
+ value :ORDER, 10
121
+ value :SPECIFIC, 11
122
+ end
123
+ add_enum "google.cloud.language.v1beta2.PartOfSpeech.Gender" do
124
+ value :GENDER_UNKNOWN, 0
125
+ value :FEMININE, 1
126
+ value :MASCULINE, 2
127
+ value :NEUTER, 3
128
+ end
129
+ add_enum "google.cloud.language.v1beta2.PartOfSpeech.Mood" do
130
+ value :MOOD_UNKNOWN, 0
131
+ value :CONDITIONAL_MOOD, 1
132
+ value :IMPERATIVE, 2
133
+ value :INDICATIVE, 3
134
+ value :INTERROGATIVE, 4
135
+ value :JUSSIVE, 5
136
+ value :SUBJUNCTIVE, 6
137
+ end
138
+ add_enum "google.cloud.language.v1beta2.PartOfSpeech.Number" do
139
+ value :NUMBER_UNKNOWN, 0
140
+ value :SINGULAR, 1
141
+ value :PLURAL, 2
142
+ value :DUAL, 3
143
+ end
144
+ add_enum "google.cloud.language.v1beta2.PartOfSpeech.Person" do
145
+ value :PERSON_UNKNOWN, 0
146
+ value :FIRST, 1
147
+ value :SECOND, 2
148
+ value :THIRD, 3
149
+ value :REFLEXIVE_PERSON, 4
150
+ end
151
+ add_enum "google.cloud.language.v1beta2.PartOfSpeech.Proper" do
152
+ value :PROPER_UNKNOWN, 0
153
+ value :PROPER, 1
154
+ value :NOT_PROPER, 2
155
+ end
156
+ add_enum "google.cloud.language.v1beta2.PartOfSpeech.Reciprocity" do
157
+ value :RECIPROCITY_UNKNOWN, 0
158
+ value :RECIPROCAL, 1
159
+ value :NON_RECIPROCAL, 2
160
+ end
161
+ add_enum "google.cloud.language.v1beta2.PartOfSpeech.Tense" do
162
+ value :TENSE_UNKNOWN, 0
163
+ value :CONDITIONAL_TENSE, 1
164
+ value :FUTURE, 2
165
+ value :PAST, 3
166
+ value :PRESENT, 4
167
+ value :IMPERFECT, 5
168
+ value :PLUPERFECT, 6
169
+ end
170
+ add_enum "google.cloud.language.v1beta2.PartOfSpeech.Voice" do
171
+ value :VOICE_UNKNOWN, 0
172
+ value :ACTIVE, 1
173
+ value :CAUSATIVE, 2
174
+ value :PASSIVE, 3
175
+ end
176
+ add_message "google.cloud.language.v1beta2.DependencyEdge" do
177
+ optional :head_token_index, :int32, 1
178
+ optional :label, :enum, 2, "google.cloud.language.v1beta2.DependencyEdge.Label"
179
+ end
180
+ add_enum "google.cloud.language.v1beta2.DependencyEdge.Label" do
181
+ value :UNKNOWN, 0
182
+ value :ABBREV, 1
183
+ value :ACOMP, 2
184
+ value :ADVCL, 3
185
+ value :ADVMOD, 4
186
+ value :AMOD, 5
187
+ value :APPOS, 6
188
+ value :ATTR, 7
189
+ value :AUX, 8
190
+ value :AUXPASS, 9
191
+ value :CC, 10
192
+ value :CCOMP, 11
193
+ value :CONJ, 12
194
+ value :CSUBJ, 13
195
+ value :CSUBJPASS, 14
196
+ value :DEP, 15
197
+ value :DET, 16
198
+ value :DISCOURSE, 17
199
+ value :DOBJ, 18
200
+ value :EXPL, 19
201
+ value :GOESWITH, 20
202
+ value :IOBJ, 21
203
+ value :MARK, 22
204
+ value :MWE, 23
205
+ value :MWV, 24
206
+ value :NEG, 25
207
+ value :NN, 26
208
+ value :NPADVMOD, 27
209
+ value :NSUBJ, 28
210
+ value :NSUBJPASS, 29
211
+ value :NUM, 30
212
+ value :NUMBER, 31
213
+ value :P, 32
214
+ value :PARATAXIS, 33
215
+ value :PARTMOD, 34
216
+ value :PCOMP, 35
217
+ value :POBJ, 36
218
+ value :POSS, 37
219
+ value :POSTNEG, 38
220
+ value :PRECOMP, 39
221
+ value :PRECONJ, 40
222
+ value :PREDET, 41
223
+ value :PREF, 42
224
+ value :PREP, 43
225
+ value :PRONL, 44
226
+ value :PRT, 45
227
+ value :PS, 46
228
+ value :QUANTMOD, 47
229
+ value :RCMOD, 48
230
+ value :RCMODREL, 49
231
+ value :RDROP, 50
232
+ value :REF, 51
233
+ value :REMNANT, 52
234
+ value :REPARANDUM, 53
235
+ value :ROOT, 54
236
+ value :SNUM, 55
237
+ value :SUFF, 56
238
+ value :TMOD, 57
239
+ value :TOPIC, 58
240
+ value :VMOD, 59
241
+ value :VOCATIVE, 60
242
+ value :XCOMP, 61
243
+ value :SUFFIX, 62
244
+ value :TITLE, 63
245
+ value :ADVPHMOD, 64
246
+ value :AUXCAUS, 65
247
+ value :AUXVV, 66
248
+ value :DTMOD, 67
249
+ value :FOREIGN, 68
250
+ value :KW, 69
251
+ value :LIST, 70
252
+ value :NOMC, 71
253
+ value :NOMCSUBJ, 72
254
+ value :NOMCSUBJPASS, 73
255
+ value :NUMC, 74
256
+ value :COP, 75
257
+ value :DISLOCATED, 76
258
+ end
259
+ add_message "google.cloud.language.v1beta2.EntityMention" do
260
+ optional :text, :message, 1, "google.cloud.language.v1beta2.TextSpan"
261
+ optional :type, :enum, 2, "google.cloud.language.v1beta2.EntityMention.Type"
262
+ optional :sentiment, :message, 3, "google.cloud.language.v1beta2.Sentiment"
263
+ end
264
+ add_enum "google.cloud.language.v1beta2.EntityMention.Type" do
265
+ value :TYPE_UNKNOWN, 0
266
+ value :PROPER, 1
267
+ value :COMMON, 2
268
+ end
269
+ add_message "google.cloud.language.v1beta2.TextSpan" do
270
+ optional :content, :string, 1
271
+ optional :begin_offset, :int32, 2
272
+ end
273
+ add_message "google.cloud.language.v1beta2.AnalyzeSentimentRequest" do
274
+ optional :document, :message, 1, "google.cloud.language.v1beta2.Document"
275
+ optional :encoding_type, :enum, 2, "google.cloud.language.v1beta2.EncodingType"
276
+ end
277
+ add_message "google.cloud.language.v1beta2.AnalyzeSentimentResponse" do
278
+ optional :document_sentiment, :message, 1, "google.cloud.language.v1beta2.Sentiment"
279
+ optional :language, :string, 2
280
+ repeated :sentences, :message, 3, "google.cloud.language.v1beta2.Sentence"
281
+ end
282
+ add_message "google.cloud.language.v1beta2.AnalyzeEntitySentimentRequest" do
283
+ optional :document, :message, 1, "google.cloud.language.v1beta2.Document"
284
+ optional :encoding_type, :enum, 2, "google.cloud.language.v1beta2.EncodingType"
285
+ end
286
+ add_message "google.cloud.language.v1beta2.AnalyzeEntitySentimentResponse" do
287
+ repeated :entities, :message, 1, "google.cloud.language.v1beta2.Entity"
288
+ optional :language, :string, 2
289
+ end
290
+ add_message "google.cloud.language.v1beta2.AnalyzeEntitiesRequest" do
291
+ optional :document, :message, 1, "google.cloud.language.v1beta2.Document"
292
+ optional :encoding_type, :enum, 2, "google.cloud.language.v1beta2.EncodingType"
293
+ end
294
+ add_message "google.cloud.language.v1beta2.AnalyzeEntitiesResponse" do
295
+ repeated :entities, :message, 1, "google.cloud.language.v1beta2.Entity"
296
+ optional :language, :string, 2
297
+ end
298
+ add_message "google.cloud.language.v1beta2.AnalyzeSyntaxRequest" do
299
+ optional :document, :message, 1, "google.cloud.language.v1beta2.Document"
300
+ optional :encoding_type, :enum, 2, "google.cloud.language.v1beta2.EncodingType"
301
+ end
302
+ add_message "google.cloud.language.v1beta2.AnalyzeSyntaxResponse" do
303
+ repeated :sentences, :message, 1, "google.cloud.language.v1beta2.Sentence"
304
+ repeated :tokens, :message, 2, "google.cloud.language.v1beta2.Token"
305
+ optional :language, :string, 3
306
+ end
307
+ add_message "google.cloud.language.v1beta2.AnnotateTextRequest" do
308
+ optional :document, :message, 1, "google.cloud.language.v1beta2.Document"
309
+ optional :features, :message, 2, "google.cloud.language.v1beta2.AnnotateTextRequest.Features"
310
+ optional :encoding_type, :enum, 3, "google.cloud.language.v1beta2.EncodingType"
311
+ end
312
+ add_message "google.cloud.language.v1beta2.AnnotateTextRequest.Features" do
313
+ optional :extract_syntax, :bool, 1
314
+ optional :extract_entities, :bool, 2
315
+ optional :extract_document_sentiment, :bool, 3
316
+ optional :extract_entity_sentiment, :bool, 4
317
+ end
318
+ add_message "google.cloud.language.v1beta2.AnnotateTextResponse" do
319
+ repeated :sentences, :message, 1, "google.cloud.language.v1beta2.Sentence"
320
+ repeated :tokens, :message, 2, "google.cloud.language.v1beta2.Token"
321
+ repeated :entities, :message, 3, "google.cloud.language.v1beta2.Entity"
322
+ optional :document_sentiment, :message, 4, "google.cloud.language.v1beta2.Sentiment"
323
+ optional :language, :string, 5
324
+ end
325
+ add_enum "google.cloud.language.v1beta2.EncodingType" do
326
+ value :NONE, 0
327
+ value :UTF8, 1
328
+ value :UTF16, 2
329
+ value :UTF32, 3
330
+ end
331
+ end
332
+
333
+ module Google
334
+ module Cloud
335
+ module Language
336
+ module V1beta2
337
+ Document = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.language.v1beta2.Document").msgclass
338
+ Document::Type = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.language.v1beta2.Document.Type").enummodule
339
+ Sentence = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.language.v1beta2.Sentence").msgclass
340
+ Entity = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.language.v1beta2.Entity").msgclass
341
+ Entity::Type = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.language.v1beta2.Entity.Type").enummodule
342
+ Token = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.language.v1beta2.Token").msgclass
343
+ Sentiment = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.language.v1beta2.Sentiment").msgclass
344
+ PartOfSpeech = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.language.v1beta2.PartOfSpeech").msgclass
345
+ PartOfSpeech::Tag = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.language.v1beta2.PartOfSpeech.Tag").enummodule
346
+ PartOfSpeech::Aspect = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.language.v1beta2.PartOfSpeech.Aspect").enummodule
347
+ PartOfSpeech::Case = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.language.v1beta2.PartOfSpeech.Case").enummodule
348
+ PartOfSpeech::Form = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.language.v1beta2.PartOfSpeech.Form").enummodule
349
+ PartOfSpeech::Gender = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.language.v1beta2.PartOfSpeech.Gender").enummodule
350
+ PartOfSpeech::Mood = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.language.v1beta2.PartOfSpeech.Mood").enummodule
351
+ PartOfSpeech::Number = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.language.v1beta2.PartOfSpeech.Number").enummodule
352
+ PartOfSpeech::Person = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.language.v1beta2.PartOfSpeech.Person").enummodule
353
+ PartOfSpeech::Proper = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.language.v1beta2.PartOfSpeech.Proper").enummodule
354
+ PartOfSpeech::Reciprocity = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.language.v1beta2.PartOfSpeech.Reciprocity").enummodule
355
+ PartOfSpeech::Tense = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.language.v1beta2.PartOfSpeech.Tense").enummodule
356
+ PartOfSpeech::Voice = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.language.v1beta2.PartOfSpeech.Voice").enummodule
357
+ DependencyEdge = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.language.v1beta2.DependencyEdge").msgclass
358
+ DependencyEdge::Label = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.language.v1beta2.DependencyEdge.Label").enummodule
359
+ EntityMention = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.language.v1beta2.EntityMention").msgclass
360
+ EntityMention::Type = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.language.v1beta2.EntityMention.Type").enummodule
361
+ TextSpan = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.language.v1beta2.TextSpan").msgclass
362
+ AnalyzeSentimentRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.language.v1beta2.AnalyzeSentimentRequest").msgclass
363
+ AnalyzeSentimentResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.language.v1beta2.AnalyzeSentimentResponse").msgclass
364
+ AnalyzeEntitySentimentRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.language.v1beta2.AnalyzeEntitySentimentRequest").msgclass
365
+ AnalyzeEntitySentimentResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.language.v1beta2.AnalyzeEntitySentimentResponse").msgclass
366
+ AnalyzeEntitiesRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.language.v1beta2.AnalyzeEntitiesRequest").msgclass
367
+ AnalyzeEntitiesResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.language.v1beta2.AnalyzeEntitiesResponse").msgclass
368
+ AnalyzeSyntaxRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.language.v1beta2.AnalyzeSyntaxRequest").msgclass
369
+ AnalyzeSyntaxResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.language.v1beta2.AnalyzeSyntaxResponse").msgclass
370
+ AnnotateTextRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.language.v1beta2.AnnotateTextRequest").msgclass
371
+ AnnotateTextRequest::Features = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.language.v1beta2.AnnotateTextRequest.Features").msgclass
372
+ AnnotateTextResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.language.v1beta2.AnnotateTextResponse").msgclass
373
+ EncodingType = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.language.v1beta2.EncodingType").enummodule
374
+ end
375
+ end
376
+ end
377
+ end