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