google-cloud-language 0.36.0 → 1.4.0

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.
@@ -1,404 +0,0 @@
1
- # Generated by the protocol buffer compiler. DO NOT EDIT!
2
- # source: google/cloud/language/v1beta2/language_service.proto
3
-
4
-
5
- require 'google/protobuf'
6
-
7
- require 'google/api/annotations_pb'
8
- require 'google/api/client_pb'
9
- require 'google/api/field_behavior_pb'
10
- require 'google/protobuf/timestamp_pb'
11
- Google::Protobuf::DescriptorPool.generated_pool.build do
12
- add_message "google.cloud.language.v1beta2.Document" do
13
- optional :type, :enum, 1, "google.cloud.language.v1beta2.Document.Type"
14
- optional :language, :string, 4
15
- oneof :source do
16
- optional :content, :string, 2
17
- optional :gcs_content_uri, :string, 3
18
- end
19
- end
20
- add_enum "google.cloud.language.v1beta2.Document.Type" do
21
- value :TYPE_UNSPECIFIED, 0
22
- value :PLAIN_TEXT, 1
23
- value :HTML, 2
24
- end
25
- add_message "google.cloud.language.v1beta2.Sentence" do
26
- optional :text, :message, 1, "google.cloud.language.v1beta2.TextSpan"
27
- optional :sentiment, :message, 2, "google.cloud.language.v1beta2.Sentiment"
28
- end
29
- add_message "google.cloud.language.v1beta2.Entity" do
30
- optional :name, :string, 1
31
- optional :type, :enum, 2, "google.cloud.language.v1beta2.Entity.Type"
32
- map :metadata, :string, :string, 3
33
- optional :salience, :float, 4
34
- repeated :mentions, :message, 5, "google.cloud.language.v1beta2.EntityMention"
35
- optional :sentiment, :message, 6, "google.cloud.language.v1beta2.Sentiment"
36
- end
37
- add_enum "google.cloud.language.v1beta2.Entity.Type" do
38
- value :UNKNOWN, 0
39
- value :PERSON, 1
40
- value :LOCATION, 2
41
- value :ORGANIZATION, 3
42
- value :EVENT, 4
43
- value :WORK_OF_ART, 5
44
- value :CONSUMER_GOOD, 6
45
- value :OTHER, 7
46
- value :PHONE_NUMBER, 9
47
- value :ADDRESS, 10
48
- value :DATE, 11
49
- value :NUMBER, 12
50
- value :PRICE, 13
51
- end
52
- add_message "google.cloud.language.v1beta2.Token" do
53
- optional :text, :message, 1, "google.cloud.language.v1beta2.TextSpan"
54
- optional :part_of_speech, :message, 2, "google.cloud.language.v1beta2.PartOfSpeech"
55
- optional :dependency_edge, :message, 3, "google.cloud.language.v1beta2.DependencyEdge"
56
- optional :lemma, :string, 4
57
- end
58
- add_message "google.cloud.language.v1beta2.Sentiment" do
59
- optional :magnitude, :float, 2
60
- optional :score, :float, 3
61
- end
62
- add_message "google.cloud.language.v1beta2.PartOfSpeech" do
63
- optional :tag, :enum, 1, "google.cloud.language.v1beta2.PartOfSpeech.Tag"
64
- optional :aspect, :enum, 2, "google.cloud.language.v1beta2.PartOfSpeech.Aspect"
65
- optional :case, :enum, 3, "google.cloud.language.v1beta2.PartOfSpeech.Case"
66
- optional :form, :enum, 4, "google.cloud.language.v1beta2.PartOfSpeech.Form"
67
- optional :gender, :enum, 5, "google.cloud.language.v1beta2.PartOfSpeech.Gender"
68
- optional :mood, :enum, 6, "google.cloud.language.v1beta2.PartOfSpeech.Mood"
69
- optional :number, :enum, 7, "google.cloud.language.v1beta2.PartOfSpeech.Number"
70
- optional :person, :enum, 8, "google.cloud.language.v1beta2.PartOfSpeech.Person"
71
- optional :proper, :enum, 9, "google.cloud.language.v1beta2.PartOfSpeech.Proper"
72
- optional :reciprocity, :enum, 10, "google.cloud.language.v1beta2.PartOfSpeech.Reciprocity"
73
- optional :tense, :enum, 11, "google.cloud.language.v1beta2.PartOfSpeech.Tense"
74
- optional :voice, :enum, 12, "google.cloud.language.v1beta2.PartOfSpeech.Voice"
75
- end
76
- add_enum "google.cloud.language.v1beta2.PartOfSpeech.Tag" do
77
- value :UNKNOWN, 0
78
- value :ADJ, 1
79
- value :ADP, 2
80
- value :ADV, 3
81
- value :CONJ, 4
82
- value :DET, 5
83
- value :NOUN, 6
84
- value :NUM, 7
85
- value :PRON, 8
86
- value :PRT, 9
87
- value :PUNCT, 10
88
- value :VERB, 11
89
- value :X, 12
90
- value :AFFIX, 13
91
- end
92
- add_enum "google.cloud.language.v1beta2.PartOfSpeech.Aspect" do
93
- value :ASPECT_UNKNOWN, 0
94
- value :PERFECTIVE, 1
95
- value :IMPERFECTIVE, 2
96
- value :PROGRESSIVE, 3
97
- end
98
- add_enum "google.cloud.language.v1beta2.PartOfSpeech.Case" do
99
- value :CASE_UNKNOWN, 0
100
- value :ACCUSATIVE, 1
101
- value :ADVERBIAL, 2
102
- value :COMPLEMENTIVE, 3
103
- value :DATIVE, 4
104
- value :GENITIVE, 5
105
- value :INSTRUMENTAL, 6
106
- value :LOCATIVE, 7
107
- value :NOMINATIVE, 8
108
- value :OBLIQUE, 9
109
- value :PARTITIVE, 10
110
- value :PREPOSITIONAL, 11
111
- value :REFLEXIVE_CASE, 12
112
- value :RELATIVE_CASE, 13
113
- value :VOCATIVE, 14
114
- end
115
- add_enum "google.cloud.language.v1beta2.PartOfSpeech.Form" do
116
- value :FORM_UNKNOWN, 0
117
- value :ADNOMIAL, 1
118
- value :AUXILIARY, 2
119
- value :COMPLEMENTIZER, 3
120
- value :FINAL_ENDING, 4
121
- value :GERUND, 5
122
- value :REALIS, 6
123
- value :IRREALIS, 7
124
- value :SHORT, 8
125
- value :LONG, 9
126
- value :ORDER, 10
127
- value :SPECIFIC, 11
128
- end
129
- add_enum "google.cloud.language.v1beta2.PartOfSpeech.Gender" do
130
- value :GENDER_UNKNOWN, 0
131
- value :FEMININE, 1
132
- value :MASCULINE, 2
133
- value :NEUTER, 3
134
- end
135
- add_enum "google.cloud.language.v1beta2.PartOfSpeech.Mood" do
136
- value :MOOD_UNKNOWN, 0
137
- value :CONDITIONAL_MOOD, 1
138
- value :IMPERATIVE, 2
139
- value :INDICATIVE, 3
140
- value :INTERROGATIVE, 4
141
- value :JUSSIVE, 5
142
- value :SUBJUNCTIVE, 6
143
- end
144
- add_enum "google.cloud.language.v1beta2.PartOfSpeech.Number" do
145
- value :NUMBER_UNKNOWN, 0
146
- value :SINGULAR, 1
147
- value :PLURAL, 2
148
- value :DUAL, 3
149
- end
150
- add_enum "google.cloud.language.v1beta2.PartOfSpeech.Person" do
151
- value :PERSON_UNKNOWN, 0
152
- value :FIRST, 1
153
- value :SECOND, 2
154
- value :THIRD, 3
155
- value :REFLEXIVE_PERSON, 4
156
- end
157
- add_enum "google.cloud.language.v1beta2.PartOfSpeech.Proper" do
158
- value :PROPER_UNKNOWN, 0
159
- value :PROPER, 1
160
- value :NOT_PROPER, 2
161
- end
162
- add_enum "google.cloud.language.v1beta2.PartOfSpeech.Reciprocity" do
163
- value :RECIPROCITY_UNKNOWN, 0
164
- value :RECIPROCAL, 1
165
- value :NON_RECIPROCAL, 2
166
- end
167
- add_enum "google.cloud.language.v1beta2.PartOfSpeech.Tense" do
168
- value :TENSE_UNKNOWN, 0
169
- value :CONDITIONAL_TENSE, 1
170
- value :FUTURE, 2
171
- value :PAST, 3
172
- value :PRESENT, 4
173
- value :IMPERFECT, 5
174
- value :PLUPERFECT, 6
175
- end
176
- add_enum "google.cloud.language.v1beta2.PartOfSpeech.Voice" do
177
- value :VOICE_UNKNOWN, 0
178
- value :ACTIVE, 1
179
- value :CAUSATIVE, 2
180
- value :PASSIVE, 3
181
- end
182
- add_message "google.cloud.language.v1beta2.DependencyEdge" do
183
- optional :head_token_index, :int32, 1
184
- optional :label, :enum, 2, "google.cloud.language.v1beta2.DependencyEdge.Label"
185
- end
186
- add_enum "google.cloud.language.v1beta2.DependencyEdge.Label" do
187
- value :UNKNOWN, 0
188
- value :ABBREV, 1
189
- value :ACOMP, 2
190
- value :ADVCL, 3
191
- value :ADVMOD, 4
192
- value :AMOD, 5
193
- value :APPOS, 6
194
- value :ATTR, 7
195
- value :AUX, 8
196
- value :AUXPASS, 9
197
- value :CC, 10
198
- value :CCOMP, 11
199
- value :CONJ, 12
200
- value :CSUBJ, 13
201
- value :CSUBJPASS, 14
202
- value :DEP, 15
203
- value :DET, 16
204
- value :DISCOURSE, 17
205
- value :DOBJ, 18
206
- value :EXPL, 19
207
- value :GOESWITH, 20
208
- value :IOBJ, 21
209
- value :MARK, 22
210
- value :MWE, 23
211
- value :MWV, 24
212
- value :NEG, 25
213
- value :NN, 26
214
- value :NPADVMOD, 27
215
- value :NSUBJ, 28
216
- value :NSUBJPASS, 29
217
- value :NUM, 30
218
- value :NUMBER, 31
219
- value :P, 32
220
- value :PARATAXIS, 33
221
- value :PARTMOD, 34
222
- value :PCOMP, 35
223
- value :POBJ, 36
224
- value :POSS, 37
225
- value :POSTNEG, 38
226
- value :PRECOMP, 39
227
- value :PRECONJ, 40
228
- value :PREDET, 41
229
- value :PREF, 42
230
- value :PREP, 43
231
- value :PRONL, 44
232
- value :PRT, 45
233
- value :PS, 46
234
- value :QUANTMOD, 47
235
- value :RCMOD, 48
236
- value :RCMODREL, 49
237
- value :RDROP, 50
238
- value :REF, 51
239
- value :REMNANT, 52
240
- value :REPARANDUM, 53
241
- value :ROOT, 54
242
- value :SNUM, 55
243
- value :SUFF, 56
244
- value :TMOD, 57
245
- value :TOPIC, 58
246
- value :VMOD, 59
247
- value :VOCATIVE, 60
248
- value :XCOMP, 61
249
- value :SUFFIX, 62
250
- value :TITLE, 63
251
- value :ADVPHMOD, 64
252
- value :AUXCAUS, 65
253
- value :AUXVV, 66
254
- value :DTMOD, 67
255
- value :FOREIGN, 68
256
- value :KW, 69
257
- value :LIST, 70
258
- value :NOMC, 71
259
- value :NOMCSUBJ, 72
260
- value :NOMCSUBJPASS, 73
261
- value :NUMC, 74
262
- value :COP, 75
263
- value :DISLOCATED, 76
264
- value :ASP, 77
265
- value :GMOD, 78
266
- value :GOBJ, 79
267
- value :INFMOD, 80
268
- value :MES, 81
269
- value :NCOMP, 82
270
- end
271
- add_message "google.cloud.language.v1beta2.EntityMention" do
272
- optional :text, :message, 1, "google.cloud.language.v1beta2.TextSpan"
273
- optional :type, :enum, 2, "google.cloud.language.v1beta2.EntityMention.Type"
274
- optional :sentiment, :message, 3, "google.cloud.language.v1beta2.Sentiment"
275
- end
276
- add_enum "google.cloud.language.v1beta2.EntityMention.Type" do
277
- value :TYPE_UNKNOWN, 0
278
- value :PROPER, 1
279
- value :COMMON, 2
280
- end
281
- add_message "google.cloud.language.v1beta2.TextSpan" do
282
- optional :content, :string, 1
283
- optional :begin_offset, :int32, 2
284
- end
285
- add_message "google.cloud.language.v1beta2.ClassificationCategory" do
286
- optional :name, :string, 1
287
- optional :confidence, :float, 2
288
- end
289
- add_message "google.cloud.language.v1beta2.AnalyzeSentimentRequest" do
290
- optional :document, :message, 1, "google.cloud.language.v1beta2.Document"
291
- optional :encoding_type, :enum, 2, "google.cloud.language.v1beta2.EncodingType"
292
- end
293
- add_message "google.cloud.language.v1beta2.AnalyzeSentimentResponse" do
294
- optional :document_sentiment, :message, 1, "google.cloud.language.v1beta2.Sentiment"
295
- optional :language, :string, 2
296
- repeated :sentences, :message, 3, "google.cloud.language.v1beta2.Sentence"
297
- end
298
- add_message "google.cloud.language.v1beta2.AnalyzeEntitySentimentRequest" 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.AnalyzeEntitySentimentResponse" do
303
- repeated :entities, :message, 1, "google.cloud.language.v1beta2.Entity"
304
- optional :language, :string, 2
305
- end
306
- add_message "google.cloud.language.v1beta2.AnalyzeEntitiesRequest" do
307
- optional :document, :message, 1, "google.cloud.language.v1beta2.Document"
308
- optional :encoding_type, :enum, 2, "google.cloud.language.v1beta2.EncodingType"
309
- end
310
- add_message "google.cloud.language.v1beta2.AnalyzeEntitiesResponse" do
311
- repeated :entities, :message, 1, "google.cloud.language.v1beta2.Entity"
312
- optional :language, :string, 2
313
- end
314
- add_message "google.cloud.language.v1beta2.AnalyzeSyntaxRequest" do
315
- optional :document, :message, 1, "google.cloud.language.v1beta2.Document"
316
- optional :encoding_type, :enum, 2, "google.cloud.language.v1beta2.EncodingType"
317
- end
318
- add_message "google.cloud.language.v1beta2.AnalyzeSyntaxResponse" do
319
- repeated :sentences, :message, 1, "google.cloud.language.v1beta2.Sentence"
320
- repeated :tokens, :message, 2, "google.cloud.language.v1beta2.Token"
321
- optional :language, :string, 3
322
- end
323
- add_message "google.cloud.language.v1beta2.ClassifyTextRequest" do
324
- optional :document, :message, 1, "google.cloud.language.v1beta2.Document"
325
- end
326
- add_message "google.cloud.language.v1beta2.ClassifyTextResponse" do
327
- repeated :categories, :message, 1, "google.cloud.language.v1beta2.ClassificationCategory"
328
- end
329
- add_message "google.cloud.language.v1beta2.AnnotateTextRequest" do
330
- optional :document, :message, 1, "google.cloud.language.v1beta2.Document"
331
- optional :features, :message, 2, "google.cloud.language.v1beta2.AnnotateTextRequest.Features"
332
- optional :encoding_type, :enum, 3, "google.cloud.language.v1beta2.EncodingType"
333
- end
334
- add_message "google.cloud.language.v1beta2.AnnotateTextRequest.Features" do
335
- optional :extract_syntax, :bool, 1
336
- optional :extract_entities, :bool, 2
337
- optional :extract_document_sentiment, :bool, 3
338
- optional :extract_entity_sentiment, :bool, 4
339
- optional :classify_text, :bool, 6
340
- end
341
- add_message "google.cloud.language.v1beta2.AnnotateTextResponse" do
342
- repeated :sentences, :message, 1, "google.cloud.language.v1beta2.Sentence"
343
- repeated :tokens, :message, 2, "google.cloud.language.v1beta2.Token"
344
- repeated :entities, :message, 3, "google.cloud.language.v1beta2.Entity"
345
- optional :document_sentiment, :message, 4, "google.cloud.language.v1beta2.Sentiment"
346
- optional :language, :string, 5
347
- repeated :categories, :message, 6, "google.cloud.language.v1beta2.ClassificationCategory"
348
- end
349
- add_enum "google.cloud.language.v1beta2.EncodingType" do
350
- value :NONE, 0
351
- value :UTF8, 1
352
- value :UTF16, 2
353
- value :UTF32, 3
354
- end
355
- end
356
-
357
- module Google
358
- module Cloud
359
- module Language
360
- module V1beta2
361
- Document = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.language.v1beta2.Document").msgclass
362
- Document::Type = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.language.v1beta2.Document.Type").enummodule
363
- Sentence = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.language.v1beta2.Sentence").msgclass
364
- Entity = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.language.v1beta2.Entity").msgclass
365
- Entity::Type = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.language.v1beta2.Entity.Type").enummodule
366
- Token = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.language.v1beta2.Token").msgclass
367
- Sentiment = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.language.v1beta2.Sentiment").msgclass
368
- PartOfSpeech = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.language.v1beta2.PartOfSpeech").msgclass
369
- PartOfSpeech::Tag = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.language.v1beta2.PartOfSpeech.Tag").enummodule
370
- PartOfSpeech::Aspect = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.language.v1beta2.PartOfSpeech.Aspect").enummodule
371
- PartOfSpeech::Case = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.language.v1beta2.PartOfSpeech.Case").enummodule
372
- PartOfSpeech::Form = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.language.v1beta2.PartOfSpeech.Form").enummodule
373
- PartOfSpeech::Gender = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.language.v1beta2.PartOfSpeech.Gender").enummodule
374
- PartOfSpeech::Mood = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.language.v1beta2.PartOfSpeech.Mood").enummodule
375
- PartOfSpeech::Number = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.language.v1beta2.PartOfSpeech.Number").enummodule
376
- PartOfSpeech::Person = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.language.v1beta2.PartOfSpeech.Person").enummodule
377
- PartOfSpeech::Proper = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.language.v1beta2.PartOfSpeech.Proper").enummodule
378
- PartOfSpeech::Reciprocity = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.language.v1beta2.PartOfSpeech.Reciprocity").enummodule
379
- PartOfSpeech::Tense = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.language.v1beta2.PartOfSpeech.Tense").enummodule
380
- PartOfSpeech::Voice = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.language.v1beta2.PartOfSpeech.Voice").enummodule
381
- DependencyEdge = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.language.v1beta2.DependencyEdge").msgclass
382
- DependencyEdge::Label = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.language.v1beta2.DependencyEdge.Label").enummodule
383
- EntityMention = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.language.v1beta2.EntityMention").msgclass
384
- EntityMention::Type = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.language.v1beta2.EntityMention.Type").enummodule
385
- TextSpan = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.language.v1beta2.TextSpan").msgclass
386
- ClassificationCategory = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.language.v1beta2.ClassificationCategory").msgclass
387
- AnalyzeSentimentRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.language.v1beta2.AnalyzeSentimentRequest").msgclass
388
- AnalyzeSentimentResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.language.v1beta2.AnalyzeSentimentResponse").msgclass
389
- AnalyzeEntitySentimentRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.language.v1beta2.AnalyzeEntitySentimentRequest").msgclass
390
- AnalyzeEntitySentimentResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.language.v1beta2.AnalyzeEntitySentimentResponse").msgclass
391
- AnalyzeEntitiesRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.language.v1beta2.AnalyzeEntitiesRequest").msgclass
392
- AnalyzeEntitiesResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.language.v1beta2.AnalyzeEntitiesResponse").msgclass
393
- AnalyzeSyntaxRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.language.v1beta2.AnalyzeSyntaxRequest").msgclass
394
- AnalyzeSyntaxResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.language.v1beta2.AnalyzeSyntaxResponse").msgclass
395
- ClassifyTextRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.language.v1beta2.ClassifyTextRequest").msgclass
396
- ClassifyTextResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.language.v1beta2.ClassifyTextResponse").msgclass
397
- AnnotateTextRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.language.v1beta2.AnnotateTextRequest").msgclass
398
- AnnotateTextRequest::Features = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.language.v1beta2.AnnotateTextRequest.Features").msgclass
399
- AnnotateTextResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.language.v1beta2.AnnotateTextResponse").msgclass
400
- EncodingType = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.language.v1beta2.EncodingType").enummodule
401
- end
402
- end
403
- end
404
- end
@@ -1,64 +0,0 @@
1
- # Generated by the protocol buffer compiler. DO NOT EDIT!
2
- # Source: google/cloud/language/v1beta2/language_service.proto for package 'google.cloud.language.v1beta2'
3
- # Original file comments:
4
- # Copyright 2019 Google LLC.
5
- #
6
- # Licensed under the Apache License, Version 2.0 (the "License");
7
- # you may not use this file except in compliance with the License.
8
- # You may obtain a copy of the License at
9
- #
10
- # http://www.apache.org/licenses/LICENSE-2.0
11
- #
12
- # Unless required by applicable law or agreed to in writing, software
13
- # distributed under the License is distributed on an "AS IS" BASIS,
14
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
- # See the License for the specific language governing permissions and
16
- # limitations under the License.
17
- #
18
- #
19
-
20
-
21
- require 'grpc'
22
- require 'google/cloud/language/v1beta2/language_service_pb'
23
-
24
- module Google
25
- module Cloud
26
- module Language
27
- module V1beta2
28
- module LanguageService
29
- # Provides text analysis operations such as sentiment analysis and entity
30
- # recognition.
31
- class Service
32
-
33
- include GRPC::GenericService
34
-
35
- self.marshal_class_method = :encode
36
- self.unmarshal_class_method = :decode
37
- self.service_name = 'google.cloud.language.v1beta2.LanguageService'
38
-
39
- # Analyzes the sentiment of the provided text.
40
- rpc :AnalyzeSentiment, AnalyzeSentimentRequest, AnalyzeSentimentResponse
41
- # Finds named entities (currently proper names and common nouns) in the text
42
- # along with entity types, salience, mentions for each entity, and
43
- # other properties.
44
- rpc :AnalyzeEntities, AnalyzeEntitiesRequest, AnalyzeEntitiesResponse
45
- # Finds entities, similar to [AnalyzeEntities][google.cloud.language.v1beta2.LanguageService.AnalyzeEntities] in the text and analyzes
46
- # sentiment associated with each entity and its mentions.
47
- rpc :AnalyzeEntitySentiment, AnalyzeEntitySentimentRequest, AnalyzeEntitySentimentResponse
48
- # Analyzes the syntax of the text and provides sentence boundaries and
49
- # tokenization along with part-of-speech tags, dependency trees, and other
50
- # properties.
51
- rpc :AnalyzeSyntax, AnalyzeSyntaxRequest, AnalyzeSyntaxResponse
52
- # Classifies a document into categories.
53
- rpc :ClassifyText, ClassifyTextRequest, ClassifyTextResponse
54
- # A convenience method that provides all syntax, sentiment, entity, and
55
- # classification features in one call.
56
- rpc :AnnotateText, AnnotateTextRequest, AnnotateTextResponse
57
- end
58
-
59
- Stub = Service.rpc_stub_class
60
- end
61
- end
62
- end
63
- end
64
- end
@@ -1,160 +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
- require "google/cloud/language/v1beta2/language_service_client"
17
-
18
- module Google
19
- module Cloud
20
- module Language
21
- # rubocop:disable LineLength
22
-
23
- ##
24
- # # Ruby Client for Google Cloud Natural Language API
25
- #
26
- # [Google Cloud Natural Language API][Product Documentation]:
27
- # Google Cloud Natural Language API provides natural language understanding
28
- # technologies to developers. Examples include sentiment analysis, entity
29
- # recognition, and text annotations.
30
- # - [Product Documentation][]
31
- #
32
- # ## Quick Start
33
- # In order to use this library, you first need to go through the following
34
- # steps:
35
- #
36
- # 1. [Select or create a Cloud Platform project.](https://console.cloud.google.com/project)
37
- # 2. [Enable billing for your project.](https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project)
38
- # 3. [Enable the Google Cloud Natural Language API.](https://console.cloud.google.com/apis/library/language.googleapis.com)
39
- # 4. [Setup Authentication.](https://googleapis.dev/ruby/google-cloud-language/latest/file.AUTHENTICATION.html)
40
- #
41
- # ### Installation
42
- # ```
43
- # $ gem install google-cloud-language
44
- # ```
45
- #
46
- # ### Preview
47
- # #### LanguageServiceClient
48
- # ```rb
49
- # require "google/cloud/language"
50
- #
51
- # language_client = Google::Cloud::Language.new(version: :v1beta2)
52
- # content = "Hello, world!"
53
- # type = :PLAIN_TEXT
54
- # document = { content: content, type: type }
55
- # response = language_client.analyze_sentiment(document)
56
- # ```
57
- #
58
- # ### Next Steps
59
- # - Read the [Google Cloud Natural Language API Product documentation][Product Documentation]
60
- # to learn more about the product and see How-to Guides.
61
- # - View this [repository's main README](https://github.com/googleapis/google-cloud-ruby/blob/master/README.md)
62
- # to see the full list of Cloud APIs that we cover.
63
- #
64
- # [Product Documentation]: https://cloud.google.com/natural-language
65
- #
66
- # ## Enabling Logging
67
- #
68
- # To enable logging for this library, set the logger for the underlying [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library.
69
- # The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/stdlib-2.5.0/libdoc/logger/rdoc/Logger.html) as shown below,
70
- # or a [`Google::Cloud::Logging::Logger`](https://googleapis.dev/ruby/google-cloud-logging/latest)
71
- # that will write logs to [Stackdriver Logging](https://cloud.google.com/logging/). See [grpc/logconfig.rb](https://github.com/grpc/grpc/blob/master/src/ruby/lib/grpc/logconfig.rb)
72
- # and the gRPC [spec_helper.rb](https://github.com/grpc/grpc/blob/master/src/ruby/spec/spec_helper.rb) for additional information.
73
- #
74
- # Configuring a Ruby stdlib logger:
75
- #
76
- # ```ruby
77
- # require "logger"
78
- #
79
- # module MyLogger
80
- # LOGGER = Logger.new $stderr, level: Logger::WARN
81
- # def logger
82
- # LOGGER
83
- # end
84
- # end
85
- #
86
- # # Define a gRPC module-level logger method before grpc/logconfig.rb loads.
87
- # module GRPC
88
- # extend MyLogger
89
- # end
90
- # ```
91
- #
92
- module V1beta2
93
- # rubocop:enable LineLength
94
-
95
- ##
96
- # Provides text analysis operations such as sentiment analysis and entity
97
- # recognition.
98
- #
99
- # @param credentials [Google::Auth::Credentials, String, Hash, GRPC::Core::Channel, GRPC::Core::ChannelCredentials, Proc]
100
- # Provides the means for authenticating requests made by the client. This parameter can
101
- # be many types.
102
- # A `Google::Auth::Credentials` uses a the properties of its represented keyfile for
103
- # authenticating requests made by this client.
104
- # A `String` will be treated as the path to the keyfile to be used for the construction of
105
- # credentials for this client.
106
- # A `Hash` will be treated as the contents of a keyfile to be used for the construction of
107
- # credentials for this client.
108
- # A `GRPC::Core::Channel` will be used to make calls through.
109
- # A `GRPC::Core::ChannelCredentials` for the setting up the RPC client. The channel credentials
110
- # should already be composed with a `GRPC::Core::CallCredentials` object.
111
- # A `Proc` will be used as an updater_proc for the Grpc channel. The proc transforms the
112
- # metadata for requests, generally, to give OAuth credentials.
113
- # @param scopes [Array<String>]
114
- # The OAuth scopes for this service. This parameter is ignored if
115
- # an updater_proc is supplied.
116
- # @param client_config [Hash]
117
- # A Hash for call options for each method. See
118
- # Google::Gax#construct_settings for the structure of
119
- # this data. Falls back to the default config if not specified
120
- # or the specified config is missing data points.
121
- # @param timeout [Numeric]
122
- # The default timeout, in seconds, for calls made through this client.
123
- # @param metadata [Hash]
124
- # Default metadata to be sent with each request. This can be overridden on a per call basis.
125
- # @param service_address [String]
126
- # Override for the service hostname, or `nil` to leave as the default.
127
- # @param service_port [Integer]
128
- # Override for the service port, or `nil` to leave as the default.
129
- # @param exception_transformer [Proc]
130
- # An optional proc that intercepts any exceptions raised during an API call to inject
131
- # custom error handling.
132
- def self.new \
133
- credentials: nil,
134
- scopes: nil,
135
- client_config: nil,
136
- timeout: nil,
137
- metadata: nil,
138
- service_address: nil,
139
- service_port: nil,
140
- exception_transformer: nil,
141
- lib_name: nil,
142
- lib_version: nil
143
- kwargs = {
144
- credentials: credentials,
145
- scopes: scopes,
146
- client_config: client_config,
147
- timeout: timeout,
148
- metadata: metadata,
149
- exception_transformer: exception_transformer,
150
- lib_name: lib_name,
151
- service_address: service_address,
152
- service_port: service_port,
153
- lib_version: lib_version
154
- }.select { |_, v| v != nil }
155
- Google::Cloud::Language::V1beta2::LanguageServiceClient.new(**kwargs)
156
- end
157
- end
158
- end
159
- end
160
- end