google-cloud-language-v1beta2 0.1.3 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8afc95ac60ea9e40b1ac4c38c802aa3e6650ddb4bd3570b581f42276e251a72e
4
- data.tar.gz: 9009976bf309fcdeabb38cf07dd5f192b42e5f38c4836d1403924bb28295c974
3
+ metadata.gz: a848d58616ce066da01b52b73d9c0e7f37247bf09f263d307b1d3f614bd496e4
4
+ data.tar.gz: 752d80c52b6d62f0610cf0c6426fa6a276ee14525a30aef35eb6ffe524dcbcbb
5
5
  SHA512:
6
- metadata.gz: 24002f867c2a24fb13c98bf6c5fdd6f00ad30a900999af99e8f903b108666a2182623e9775c2d794522422ae128548d3364df34a503418744469d43f857264a0
7
- data.tar.gz: 9ee7c1ed416f09452b713f00c42e77e10fc04f8138e5b3c34a10ecdd537dea2936938e2407ea6cf9eec463de1258fb51870597dd37bea82ab9312659e6cb44ea
6
+ metadata.gz: 244ea95e05934f7c2e322d4ef1c3b4f6c58325b849915f0dbf1fa153da94fac01e1b5b8d768baea9a14a797076831327656fe557722d422ccce051c9104f6d5c
7
+ data.tar.gz: 5dc79decc6e60beff2478da0fca241f6f6140e65f992847b9b76db9b7376c074280622ea997d2df9ed24de2e36a58a9e9259f21a8d8fd17b9ac4d8b158a59f89
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # Natural Language V1beta2
1
+ # Ruby Client for the Natural Language V1beta2 API
2
2
 
3
3
  API Client library for the Natural Language V1beta2 API
4
4
 
@@ -12,6 +12,53 @@ https://github.com/googleapis/google-cloud-ruby
12
12
  $ gem install google-cloud-language-v1beta2
13
13
  ```
14
14
 
15
+ ## Before You Begin
16
+
17
+ In order to use this library, you first need to go through the following steps:
18
+
19
+ 1. [Select or create a Cloud Platform project.](https://console.cloud.google.com/project)
20
+ 1. [Enable billing for your project.](https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project)
21
+ 1. {file:AUTHENTICATION.md Set up authentication.}
22
+
23
+ ## Quick Start
24
+
25
+ ```ruby
26
+ require "google/cloud/language/v1beta2"
27
+
28
+ client = Google::Cloud::Language::V1beta2::LanguageService::Client.new
29
+ request = my_create_request
30
+ response = client.analyze_sentiment request
31
+ ```
32
+
33
+ View the [Client Library Documentation](https://googleapis.dev/ruby/google-cloud-language-v1beta2/latest)
34
+ for class and method documentation.
35
+
36
+ ## Enabling Logging
37
+
38
+ To enable logging for this library, set the logger for the underlying [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library.
39
+ The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/stdlib/libdoc/logger/rdoc/Logger.html) as shown below,
40
+ or a [`Google::Cloud::Logging::Logger`](https://googleapis.dev/ruby/google-cloud-logging/latest)
41
+ that will write logs to [Cloud Logging](https://cloud.google.com/logging/). See [grpc/logconfig.rb](https://github.com/grpc/grpc/blob/master/src/ruby/lib/grpc/logconfig.rb)
42
+ and the gRPC [spec_helper.rb](https://github.com/grpc/grpc/blob/master/src/ruby/spec/spec_helper.rb) for additional information.
43
+
44
+ Configuring a Ruby stdlib logger:
45
+
46
+ ```ruby
47
+ require "logger"
48
+
49
+ module MyLogger
50
+ LOGGER = Logger.new $stderr, level: Logger::WARN
51
+ def logger
52
+ LOGGER
53
+ end
54
+ end
55
+
56
+ # Define a gRPC module-level logger method before grpc/logconfig.rb loads.
57
+ module GRPC
58
+ extend MyLogger
59
+ end
60
+ ```
61
+
15
62
  ## Supported Ruby Versions
16
63
 
17
64
  This library is supported on Ruby 2.4+.
@@ -16,14 +16,8 @@
16
16
 
17
17
  # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
18
 
19
- require "gapic/common"
20
- require "gapic/config"
21
- require "gapic/config/method"
22
-
23
19
  require "google/cloud/errors"
24
- require "google/cloud/language/v1beta2/version"
25
20
  require "google/cloud/language/v1beta2/language_service_pb"
26
- require "google/cloud/language/v1beta2/language_service/credentials"
27
21
 
28
22
  module Google
29
23
  module Cloud
@@ -200,19 +194,26 @@ module Google
200
194
  # Analyzes the sentiment of the provided text.
201
195
  #
202
196
  # @overload analyze_sentiment(request, options = nil)
203
- # @param request [Google::Cloud::Language::V1beta2::AnalyzeSentimentRequest | Hash]
204
- # Analyzes the sentiment of the provided text.
197
+ # Pass arguments to `analyze_sentiment` via a request object, either of type
198
+ # {Google::Cloud::Language::V1beta2::AnalyzeSentimentRequest} or an equivalent Hash.
199
+ #
200
+ # @param request [Google::Cloud::Language::V1beta2::AnalyzeSentimentRequest, Hash]
201
+ # A request object representing the call parameters. Required. To specify no
202
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
205
203
  # @param options [Gapic::CallOptions, Hash]
206
204
  # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
207
205
  #
208
206
  # @overload analyze_sentiment(document: nil, encoding_type: nil)
209
- # @param document [Google::Cloud::Language::V1beta2::Document | Hash]
207
+ # Pass arguments to `analyze_sentiment` via keyword arguments. Note that at
208
+ # least one keyword argument is required. To specify no parameters, or to keep all
209
+ # the default parameter values, pass an empty Hash as a request object (see above).
210
+ #
211
+ # @param document [Google::Cloud::Language::V1beta2::Document, Hash]
210
212
  # Required. Input document.
211
213
  # @param encoding_type [Google::Cloud::Language::V1beta2::EncodingType]
212
214
  # The encoding type used by the API to calculate sentence offsets for the
213
215
  # sentence sentiment.
214
216
  #
215
- #
216
217
  # @yield [response, operation] Access the result along with the RPC operation
217
218
  # @yieldparam response [Google::Cloud::Language::V1beta2::AnalyzeSentimentResponse]
218
219
  # @yieldparam operation [GRPC::ActiveCall::Operation]
@@ -258,20 +259,25 @@ module Google
258
259
  # other properties.
259
260
  #
260
261
  # @overload analyze_entities(request, options = nil)
261
- # @param request [Google::Cloud::Language::V1beta2::AnalyzeEntitiesRequest | Hash]
262
- # Finds named entities (currently proper names and common nouns) in the text
263
- # along with entity types, salience, mentions for each entity, and
264
- # other properties.
262
+ # Pass arguments to `analyze_entities` via a request object, either of type
263
+ # {Google::Cloud::Language::V1beta2::AnalyzeEntitiesRequest} or an equivalent Hash.
264
+ #
265
+ # @param request [Google::Cloud::Language::V1beta2::AnalyzeEntitiesRequest, Hash]
266
+ # A request object representing the call parameters. Required. To specify no
267
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
265
268
  # @param options [Gapic::CallOptions, Hash]
266
269
  # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
267
270
  #
268
271
  # @overload analyze_entities(document: nil, encoding_type: nil)
269
- # @param document [Google::Cloud::Language::V1beta2::Document | Hash]
272
+ # Pass arguments to `analyze_entities` via keyword arguments. Note that at
273
+ # least one keyword argument is required. To specify no parameters, or to keep all
274
+ # the default parameter values, pass an empty Hash as a request object (see above).
275
+ #
276
+ # @param document [Google::Cloud::Language::V1beta2::Document, Hash]
270
277
  # Required. Input document.
271
278
  # @param encoding_type [Google::Cloud::Language::V1beta2::EncodingType]
272
279
  # The encoding type used by the API to calculate offsets.
273
280
  #
274
- #
275
281
  # @yield [response, operation] Access the result along with the RPC operation
276
282
  # @yieldparam response [Google::Cloud::Language::V1beta2::AnalyzeEntitiesResponse]
277
283
  # @yieldparam operation [GRPC::ActiveCall::Operation]
@@ -316,19 +322,25 @@ module Google
316
322
  # sentiment associated with each entity and its mentions.
317
323
  #
318
324
  # @overload analyze_entity_sentiment(request, options = nil)
319
- # @param request [Google::Cloud::Language::V1beta2::AnalyzeEntitySentimentRequest | Hash]
320
- # Finds entities, similar to {Google::Cloud::Language::V1beta2::LanguageService::Client#analyze_entities AnalyzeEntities} in the text and analyzes
321
- # sentiment associated with each entity and its mentions.
325
+ # Pass arguments to `analyze_entity_sentiment` via a request object, either of type
326
+ # {Google::Cloud::Language::V1beta2::AnalyzeEntitySentimentRequest} or an equivalent Hash.
327
+ #
328
+ # @param request [Google::Cloud::Language::V1beta2::AnalyzeEntitySentimentRequest, Hash]
329
+ # A request object representing the call parameters. Required. To specify no
330
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
322
331
  # @param options [Gapic::CallOptions, Hash]
323
332
  # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
324
333
  #
325
334
  # @overload analyze_entity_sentiment(document: nil, encoding_type: nil)
326
- # @param document [Google::Cloud::Language::V1beta2::Document | Hash]
335
+ # Pass arguments to `analyze_entity_sentiment` via keyword arguments. Note that at
336
+ # least one keyword argument is required. To specify no parameters, or to keep all
337
+ # the default parameter values, pass an empty Hash as a request object (see above).
338
+ #
339
+ # @param document [Google::Cloud::Language::V1beta2::Document, Hash]
327
340
  # Required. Input document.
328
341
  # @param encoding_type [Google::Cloud::Language::V1beta2::EncodingType]
329
342
  # The encoding type used by the API to calculate offsets.
330
343
  #
331
- #
332
344
  # @yield [response, operation] Access the result along with the RPC operation
333
345
  # @yieldparam response [Google::Cloud::Language::V1beta2::AnalyzeEntitySentimentResponse]
334
346
  # @yieldparam operation [GRPC::ActiveCall::Operation]
@@ -374,20 +386,25 @@ module Google
374
386
  # properties.
375
387
  #
376
388
  # @overload analyze_syntax(request, options = nil)
377
- # @param request [Google::Cloud::Language::V1beta2::AnalyzeSyntaxRequest | Hash]
378
- # Analyzes the syntax of the text and provides sentence boundaries and
379
- # tokenization along with part-of-speech tags, dependency trees, and other
380
- # properties.
389
+ # Pass arguments to `analyze_syntax` via a request object, either of type
390
+ # {Google::Cloud::Language::V1beta2::AnalyzeSyntaxRequest} or an equivalent Hash.
391
+ #
392
+ # @param request [Google::Cloud::Language::V1beta2::AnalyzeSyntaxRequest, Hash]
393
+ # A request object representing the call parameters. Required. To specify no
394
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
381
395
  # @param options [Gapic::CallOptions, Hash]
382
396
  # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
383
397
  #
384
398
  # @overload analyze_syntax(document: nil, encoding_type: nil)
385
- # @param document [Google::Cloud::Language::V1beta2::Document | Hash]
399
+ # Pass arguments to `analyze_syntax` via keyword arguments. Note that at
400
+ # least one keyword argument is required. To specify no parameters, or to keep all
401
+ # the default parameter values, pass an empty Hash as a request object (see above).
402
+ #
403
+ # @param document [Google::Cloud::Language::V1beta2::Document, Hash]
386
404
  # Required. Input document.
387
405
  # @param encoding_type [Google::Cloud::Language::V1beta2::EncodingType]
388
406
  # The encoding type used by the API to calculate offsets.
389
407
  #
390
- #
391
408
  # @yield [response, operation] Access the result along with the RPC operation
392
409
  # @yieldparam response [Google::Cloud::Language::V1beta2::AnalyzeSyntaxResponse]
393
410
  # @yieldparam operation [GRPC::ActiveCall::Operation]
@@ -431,15 +448,22 @@ module Google
431
448
  # Classifies a document into categories.
432
449
  #
433
450
  # @overload classify_text(request, options = nil)
434
- # @param request [Google::Cloud::Language::V1beta2::ClassifyTextRequest | Hash]
435
- # Classifies a document into categories.
451
+ # Pass arguments to `classify_text` via a request object, either of type
452
+ # {Google::Cloud::Language::V1beta2::ClassifyTextRequest} or an equivalent Hash.
453
+ #
454
+ # @param request [Google::Cloud::Language::V1beta2::ClassifyTextRequest, Hash]
455
+ # A request object representing the call parameters. Required. To specify no
456
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
436
457
  # @param options [Gapic::CallOptions, Hash]
437
458
  # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
438
459
  #
439
460
  # @overload classify_text(document: nil)
440
- # @param document [Google::Cloud::Language::V1beta2::Document | Hash]
441
- # Required. Input document.
461
+ # Pass arguments to `classify_text` via keyword arguments. Note that at
462
+ # least one keyword argument is required. To specify no parameters, or to keep all
463
+ # the default parameter values, pass an empty Hash as a request object (see above).
442
464
  #
465
+ # @param document [Google::Cloud::Language::V1beta2::Document, Hash]
466
+ # Required. Input document.
443
467
  #
444
468
  # @yield [response, operation] Access the result along with the RPC operation
445
469
  # @yieldparam response [Google::Cloud::Language::V1beta2::ClassifyTextResponse]
@@ -485,21 +509,27 @@ module Google
485
509
  # classification features in one call.
486
510
  #
487
511
  # @overload annotate_text(request, options = nil)
488
- # @param request [Google::Cloud::Language::V1beta2::AnnotateTextRequest | Hash]
489
- # A convenience method that provides all syntax, sentiment, entity, and
490
- # classification features in one call.
512
+ # Pass arguments to `annotate_text` via a request object, either of type
513
+ # {Google::Cloud::Language::V1beta2::AnnotateTextRequest} or an equivalent Hash.
514
+ #
515
+ # @param request [Google::Cloud::Language::V1beta2::AnnotateTextRequest, Hash]
516
+ # A request object representing the call parameters. Required. To specify no
517
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
491
518
  # @param options [Gapic::CallOptions, Hash]
492
519
  # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
493
520
  #
494
521
  # @overload annotate_text(document: nil, features: nil, encoding_type: nil)
495
- # @param document [Google::Cloud::Language::V1beta2::Document | Hash]
522
+ # Pass arguments to `annotate_text` via keyword arguments. Note that at
523
+ # least one keyword argument is required. To specify no parameters, or to keep all
524
+ # the default parameter values, pass an empty Hash as a request object (see above).
525
+ #
526
+ # @param document [Google::Cloud::Language::V1beta2::Document, Hash]
496
527
  # Required. Input document.
497
- # @param features [Google::Cloud::Language::V1beta2::AnnotateTextRequest::Features | Hash]
528
+ # @param features [Google::Cloud::Language::V1beta2::AnnotateTextRequest::Features, Hash]
498
529
  # Required. The enabled features.
499
530
  # @param encoding_type [Google::Cloud::Language::V1beta2::EncodingType]
500
531
  # The encoding type used by the API to calculate offsets.
501
532
  #
502
- #
503
533
  # @yield [response, operation] Access the result along with the RPC operation
504
534
  # @yieldparam response [Google::Cloud::Language::V1beta2::AnnotateTextResponse]
505
535
  # @yieldparam operation [GRPC::ActiveCall::Operation]
@@ -727,13 +757,3 @@ module Google
727
757
  end
728
758
  end
729
759
  end
730
-
731
- # rubocop:disable Lint/HandleExceptions
732
-
733
- # Once client is loaded, load helpers.rb if it exists.
734
- begin
735
- require "google/cloud/language/v1beta2/language_service/helpers"
736
- rescue LoadError
737
- end
738
-
739
- # rubocop:enable Lint/HandleExceptions
@@ -16,5 +16,34 @@
16
16
 
17
17
  # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
18
 
19
- require "google/cloud/language/v1beta2/language_service/client"
19
+ require "gapic/common"
20
+ require "gapic/config"
21
+ require "gapic/config/method"
22
+
23
+ require "google/cloud/language/v1beta2/version"
24
+
20
25
  require "google/cloud/language/v1beta2/language_service/credentials"
26
+ require "google/cloud/language/v1beta2/language_service/client"
27
+
28
+ module Google
29
+ module Cloud
30
+ module Language
31
+ module V1beta2
32
+ ##
33
+ # Provides text analysis operations such as sentiment analysis and entity
34
+ # recognition.
35
+ #
36
+ # To load this service and instantiate a client:
37
+ #
38
+ # require "google/cloud/language/v1beta2/language_service"
39
+ # client = Google::Cloud::Language::V1beta2::LanguageService::Client.new
40
+ #
41
+ module LanguageService
42
+ end
43
+ end
44
+ end
45
+ end
46
+ end
47
+
48
+ helper_path = ::File.join __dir__, "language_service", "helpers.rb"
49
+ require "google/cloud/language/v1beta2/language_service/helpers" if ::File.file? helper_path
@@ -21,7 +21,7 @@ module Google
21
21
  module Cloud
22
22
  module Language
23
23
  module V1beta2
24
- VERSION = "0.1.3"
24
+ VERSION = "0.1.4"
25
25
  end
26
26
  end
27
27
  end
@@ -17,3 +17,19 @@
17
17
  # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
18
 
19
19
  require "google/cloud/language/v1beta2/language_service"
20
+ require "google/cloud/language/v1beta2/version"
21
+
22
+ module Google
23
+ module Cloud
24
+ module Language
25
+ ##
26
+ # To load this package, including all its services, and instantiate a client:
27
+ #
28
+ # require "google/cloud/language/v1beta2"
29
+ # client = Google::Cloud::Language::V1beta2::LanguageService::Client.new
30
+ #
31
+ module V1beta2
32
+ end
33
+ end
34
+ end
35
+ end
@@ -1 +1,21 @@
1
- require "google/cloud/language/v1beta2/version"
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2020 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ # This gem does not autoload during Bundler.require. To load this gem,
20
+ # issue explicit require statements for the packages desired, e.g.:
21
+ # require "google/cloud/language/v1beta2"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-cloud-language-v1beta2
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Google LLC
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-04-06 00:00:00.000000000 Z
11
+ date: 2020-04-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gapic-common