google-cloud-language 0.27.1 → 0.28.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -40,10 +40,15 @@ module Google
40
40
  # along with entity types, salience, mentions for each entity, and
41
41
  # other properties.
42
42
  rpc :AnalyzeEntities, AnalyzeEntitiesRequest, AnalyzeEntitiesResponse
43
+ # Finds entities, similar to [AnalyzeEntities][google.cloud.language.v1.LanguageService.AnalyzeEntities] in the text and analyzes
44
+ # sentiment associated with each entity and its mentions.
45
+ rpc :AnalyzeEntitySentiment, AnalyzeEntitySentimentRequest, AnalyzeEntitySentimentResponse
43
46
  # Analyzes the syntax of the text and provides sentence boundaries and
44
47
  # tokenization along with part of speech tags, dependency trees, and other
45
48
  # properties.
46
49
  rpc :AnalyzeSyntax, AnalyzeSyntaxRequest, AnalyzeSyntaxResponse
50
+ # Classifies a document into categories.
51
+ rpc :ClassifyText, ClassifyTextRequest, ClassifyTextResponse
47
52
  # A convenience method that provides all the features that analyzeSentiment,
48
53
  # analyzeEntities, and analyzeSyntax provide in one call.
49
54
  rpc :AnnotateText, AnnotateTextRequest, AnnotateTextResponse
@@ -1,4 +1,5 @@
1
1
  # Copyright 2017, Google Inc. All rights reserved.
2
+ #
2
3
  # Licensed under the Apache License, Version 2.0 (the "License");
3
4
  # you may not use this file except in compliance with the License.
4
5
  # You may obtain a copy of the License at
@@ -12,3 +13,109 @@
12
13
  # limitations under the License.
13
14
 
14
15
  require "google/cloud/language/v1beta2/language_service_client"
16
+
17
+ module Google
18
+ module Cloud
19
+ # rubocop:disable LineLength
20
+
21
+ ##
22
+ # # Ruby Client for Google Cloud Natural Language API ([Alpha](https://github.com/GoogleCloudPlatform/google-cloud-ruby#versioning))
23
+ #
24
+ # [Google Cloud Natural Language API][Product Documentation]:
25
+ # Google Cloud Natural Language API provides natural language understanding
26
+ # technologies to developers. Examples include sentiment analysis, entity
27
+ # recognition, and text annotations.
28
+ # - [Product Documentation][]
29
+ #
30
+ # ## Quick Start
31
+ # In order to use this library, you first need to go through the following
32
+ # steps:
33
+ #
34
+ # 1. [Select or create a Cloud Platform project.](https://console.cloud.google.com/project)
35
+ # 2. [Enable the Google Cloud Natural Language API.](https://console.cloud.google.com/apis/api/language)
36
+ # 3. [Setup Authentication.](https://googlecloudplatform.github.io/google-cloud-ruby/#/docs/google-cloud/master/guides/authentication)
37
+ #
38
+ # ### Preview
39
+ # #### LanguageServiceClient
40
+ # ```rb
41
+ # require "google/cloud/language/v1beta2"
42
+ #
43
+ # language_service_client = Google::Cloud::Language::V1beta2.new
44
+ # content = "Hello, world!"
45
+ # type = :PLAIN_TEXT
46
+ # document = { content: content, type: type }
47
+ # response = language_service_client.analyze_sentiment(document)
48
+ # ```
49
+ #
50
+ # ### Next Steps
51
+ # - Read the [Google Cloud Natural Language API Product documentation][Product Documentation]
52
+ # to learn more about the product and see How-to Guides.
53
+ # - View this [repository's main README](https://github.com/GoogleCloudPlatform/google-cloud-ruby/blob/master/README.md)
54
+ # to see the full list of Cloud APIs that we cover.
55
+ #
56
+ # [Product Documentation]: https://cloud.google.com/language
57
+ #
58
+ #
59
+ module Language
60
+ module V1beta2
61
+ # rubocop:enable LineLength
62
+
63
+ ##
64
+ # Provides text analysis operations such as sentiment analysis and entity
65
+ # recognition.
66
+ #
67
+ # @param credentials [Google::Auth::Credentials, String, Hash, GRPC::Core::Channel, GRPC::Core::ChannelCredentials, Proc]
68
+ # Provides the means for authenticating requests made by the client. This parameter can
69
+ # be many types.
70
+ # A `Google::Auth::Credentials` uses a the properties of its represented keyfile for
71
+ # authenticating requests made by this client.
72
+ # A `String` will be treated as the path to the keyfile to be used for the construction of
73
+ # credentials for this client.
74
+ # A `Hash` will be treated as the contents of a keyfile to be used for the construction of
75
+ # credentials for this client.
76
+ # A `GRPC::Core::Channel` will be used to make calls through.
77
+ # A `GRPC::Core::ChannelCredentials` for the setting up the RPC client. The channel credentials
78
+ # should already be composed with a `GRPC::Core::CallCredentials` object.
79
+ # A `Proc` will be used as an updater_proc for the Grpc channel. The proc transforms the
80
+ # metadata for requests, generally, to give OAuth credentials.
81
+ # @param scopes [Array<String>]
82
+ # The OAuth scopes for this service. This parameter is ignored if
83
+ # an updater_proc is supplied.
84
+ # @param client_config [Hash]
85
+ # A Hash for call options for each method. See
86
+ # Google::Gax#construct_settings for the structure of
87
+ # this data. Falls back to the default config if not specified
88
+ # or the specified config is missing data points.
89
+ # @param timeout [Numeric]
90
+ # The default timeout, in seconds, for calls made through this client.
91
+ def self.new \
92
+ service_path: nil,
93
+ port: nil,
94
+ channel: nil,
95
+ chan_creds: nil,
96
+ updater_proc: nil,
97
+ credentials: nil,
98
+ scopes: nil,
99
+ client_config: nil,
100
+ timeout: nil,
101
+ lib_name: nil,
102
+ lib_version: nil
103
+ kwargs = {
104
+ service_path: service_path,
105
+ port: port,
106
+ channel: channel,
107
+ chan_creds: chan_creds,
108
+ updater_proc: updater_proc,
109
+ credentials: credentials,
110
+ scopes: scopes,
111
+ client_config: client_config,
112
+ timeout: timeout,
113
+ lib_name: lib_name,
114
+ lib_version: lib_version
115
+ }.select { |_, v| v != nil }
116
+ Google::Cloud::Language::V1beta2::LanguageServiceClient.new(**kwargs)
117
+ end
118
+ end
119
+ end
120
+ end
121
+ end
@@ -15,6 +15,17 @@
15
15
  module Google
16
16
  module Cloud
17
17
  module Language
18
+ ##
19
+ # # Google Cloud Natural Language API Contents
20
+ #
21
+ # | Class | Description |
22
+ # | ----- | ----------- |
23
+ # | [LanguageServiceClient][] | Google Cloud Natural Language API provides natural language understanding technologies to developers. Examples include sentiment analysis, entity recognition, and text annotations. |
24
+ # | [Data Types][] | Data types for Google::Cloud::Language::V1beta2 |
25
+ #
26
+ # [LanguageServiceClient]: https://googlecloudplatform.github.io/google-cloud-ruby/#/docs/google-cloud-language/latest/google/cloud/language/v1beta2/languageserviceclient
27
+ # [Data Types]: https://googlecloudplatform.github.io/google-cloud-ruby/#/docs/google-cloud-language/latest/google/cloud/language/v1beta2/datatypes
28
+ #
18
29
  module V1beta2
19
30
  # ================================================================ #
20
31
  #
@@ -729,6 +740,24 @@ module Google
729
740
 
730
741
  # Dislocated relation (for fronted/topicalized elements)
731
742
  DISLOCATED = 76
743
+
744
+ # Aspect marker
745
+ ASP = 77
746
+
747
+ # Genitive modifier
748
+ GMOD = 78
749
+
750
+ # Genitive object
751
+ GOBJ = 79
752
+
753
+ # Infinitival modifier
754
+ INFMOD = 80
755
+
756
+ # Measure
757
+ MES = 81
758
+
759
+ # Nominal complement of a noun
760
+ NCOMP = 82
732
761
  end
733
762
  end
734
763
 
@@ -0,0 +1,67 @@
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
+ module Google
16
+ module Cloud
17
+ # rubocop:disable LineLength
18
+
19
+ ##
20
+ # # Ruby Client for Google Cloud Natural Language API ([Alpha](https://github.com/GoogleCloudPlatform/google-cloud-ruby#versioning))
21
+ #
22
+ # [Google Cloud Natural Language API][Product Documentation]:
23
+ # Google Cloud Natural Language API provides natural language understanding
24
+ # technologies to developers. Examples include sentiment analysis, entity
25
+ # recognition, and text annotations.
26
+ # - [Product Documentation][]
27
+ #
28
+ # ## Quick Start
29
+ # In order to use this library, you first need to go through the following
30
+ # steps:
31
+ #
32
+ # 1. [Select or create a Cloud Platform project.](https://console.cloud.google.com/project)
33
+ # 2. [Enable the Google Cloud Natural Language API.](https://console.cloud.google.com/apis/api/language)
34
+ # 3. [Setup Authentication.](https://googlecloudplatform.github.io/google-cloud-ruby/#/docs/google-cloud/master/guides/authentication)
35
+ #
36
+ # ### Installation
37
+ # ```
38
+ # $ gem install google-cloud-language
39
+ # ```
40
+ #
41
+ # ### Preview
42
+ # #### LanguageServiceClient
43
+ # ```rb
44
+ # require "google/cloud/language"
45
+ #
46
+ # language_service_client = Google::Cloud::Language.new
47
+ # content = "Hello, world!"
48
+ # type = :PLAIN_TEXT
49
+ # document = { content: content, type: type }
50
+ # response = language_service_client.analyze_sentiment(document)
51
+ # ```
52
+ #
53
+ # ### Next Steps
54
+ # - Read the [Google Cloud Natural Language API Product documentation][Product Documentation]
55
+ # to learn more about the product and see How-to Guides.
56
+ # - View this [repository's main README](https://github.com/GoogleCloudPlatform/google-cloud-ruby/blob/master/README.md)
57
+ # to see the full list of Cloud APIs that we cover.
58
+ #
59
+ # [Product Documentation]: https://cloud.google.com/language
60
+ #
61
+ #
62
+ module Language
63
+ module V1beta2
64
+ end
65
+ end
66
+ end
67
+ end
@@ -56,11 +56,10 @@ module Google
56
56
  "https://www.googleapis.com/auth/cloud-platform"
57
57
  ].freeze
58
58
 
59
- # @param credentials
60
- # [Google::Gax::Credentials, String, Hash, GRPC::Core::Channel, GRPC::Core::ChannelCredentials, Proc]
59
+ # @param credentials [Google::Auth::Credentials, String, Hash, GRPC::Core::Channel, GRPC::Core::ChannelCredentials, Proc]
61
60
  # Provides the means for authenticating requests made by the client. This parameter can
62
61
  # be many types.
63
- # A `Google::Gax::Credentials` uses a the properties of its represented keyfile for
62
+ # A `Google::Auth::Credentials` uses a the properties of its represented keyfile for
64
63
  # authenticating requests made by this client.
65
64
  # A `String` will be treated as the path to the keyfile to be used for the construction of
66
65
  # credentials for this client.
@@ -74,7 +73,7 @@ module Google
74
73
  # @param scopes [Array<String>]
75
74
  # The OAuth scopes for this service. This parameter is ignored if
76
75
  # an updater_proc is supplied.
77
- # @param client_config[Hash]
76
+ # @param client_config [Hash]
78
77
  # A Hash for call options for each method. See
79
78
  # Google::Gax#construct_settings for the structure of
80
79
  # this data. Falls back to the default config if not specified
@@ -106,7 +105,7 @@ module Google
106
105
  credentials ||= chan_creds
107
106
  credentials ||= updater_proc
108
107
  end
109
- if service_path || port
108
+ if service_path != SERVICE_ADDRESS || port != DEFAULT_SERVICE_PORT
110
109
  warn "`service_path` and `port` parameters are deprecated and will be removed"
111
110
  end
112
111
 
@@ -124,7 +123,7 @@ module Google
124
123
  if credentials.is_a?(Proc)
125
124
  updater_proc = credentials
126
125
  end
127
- if credentials.is_a?(Google::Gax::Credentials)
126
+ if credentials.is_a?(Google::Auth::Credentials)
128
127
  updater_proc = credentials.updater_proc
129
128
  end
130
129
 
@@ -255,6 +255,12 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
255
255
  value :NUMC, 74
256
256
  value :COP, 75
257
257
  value :DISLOCATED, 76
258
+ value :ASP, 77
259
+ value :GMOD, 78
260
+ value :GOBJ, 79
261
+ value :INFMOD, 80
262
+ value :MES, 81
263
+ value :NCOMP, 82
258
264
  end
259
265
  add_message "google.cloud.language.v1beta2.EntityMention" do
260
266
  optional :text, :message, 1, "google.cloud.language.v1beta2.TextSpan"
metadata CHANGED
@@ -1,114 +1,71 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-cloud-language
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.27.1
4
+ version: 0.28.0
5
5
  platform: ruby
6
6
  authors:
7
- - Mike Moore
8
- - Chris Smith
7
+ - Google Inc
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2017-08-30 00:00:00.000000000 Z
11
+ date: 2017-11-14 00:00:00.000000000 Z
13
12
  dependencies:
14
- - !ruby/object:Gem::Dependency
15
- name: google-cloud-core
16
- requirement: !ruby/object:Gem::Requirement
17
- requirements:
18
- - - "~>"
19
- - !ruby/object:Gem::Version
20
- version: '1.0'
21
- type: :runtime
22
- prerelease: false
23
- version_requirements: !ruby/object:Gem::Requirement
24
- requirements:
25
- - - "~>"
26
- - !ruby/object:Gem::Version
27
- version: '1.0'
28
13
  - !ruby/object:Gem::Dependency
29
14
  name: google-gax
30
15
  requirement: !ruby/object:Gem::Requirement
31
16
  requirements:
32
17
  - - "~>"
33
18
  - !ruby/object:Gem::Version
34
- version: 0.8.2
19
+ version: 0.10.1
35
20
  type: :runtime
36
21
  prerelease: false
37
22
  version_requirements: !ruby/object:Gem::Requirement
38
23
  requirements:
39
24
  - - "~>"
40
25
  - !ruby/object:Gem::Version
41
- version: 0.8.2
42
- - !ruby/object:Gem::Dependency
43
- name: minitest
44
- requirement: !ruby/object:Gem::Requirement
45
- requirements:
46
- - - "~>"
47
- - !ruby/object:Gem::Version
48
- version: '5.10'
49
- type: :development
50
- prerelease: false
51
- version_requirements: !ruby/object:Gem::Requirement
52
- requirements:
53
- - - "~>"
54
- - !ruby/object:Gem::Version
55
- version: '5.10'
26
+ version: 0.10.1
56
27
  - !ruby/object:Gem::Dependency
57
- name: minitest-autotest
28
+ name: googleapis-common-protos
58
29
  requirement: !ruby/object:Gem::Requirement
59
30
  requirements:
60
31
  - - "~>"
61
32
  - !ruby/object:Gem::Version
62
- version: '1.0'
63
- type: :development
64
- prerelease: false
65
- version_requirements: !ruby/object:Gem::Requirement
66
- requirements:
67
- - - "~>"
68
- - !ruby/object:Gem::Version
69
- version: '1.0'
70
- - !ruby/object:Gem::Dependency
71
- name: minitest-focus
72
- requirement: !ruby/object:Gem::Requirement
73
- requirements:
74
- - - "~>"
75
- - !ruby/object:Gem::Version
76
- version: '1.1'
77
- type: :development
33
+ version: 1.3.1
34
+ type: :runtime
78
35
  prerelease: false
79
36
  version_requirements: !ruby/object:Gem::Requirement
80
37
  requirements:
81
38
  - - "~>"
82
39
  - !ruby/object:Gem::Version
83
- version: '1.1'
40
+ version: 1.3.1
84
41
  - !ruby/object:Gem::Dependency
85
- name: minitest-rg
42
+ name: googleauth
86
43
  requirement: !ruby/object:Gem::Requirement
87
44
  requirements:
88
45
  - - "~>"
89
46
  - !ruby/object:Gem::Version
90
- version: '5.2'
91
- type: :development
47
+ version: 0.6.1
48
+ type: :runtime
92
49
  prerelease: false
93
50
  version_requirements: !ruby/object:Gem::Requirement
94
51
  requirements:
95
52
  - - "~>"
96
53
  - !ruby/object:Gem::Version
97
- version: '5.2'
54
+ version: 0.6.1
98
55
  - !ruby/object:Gem::Dependency
99
- name: autotest-suffix
56
+ name: minitest
100
57
  requirement: !ruby/object:Gem::Requirement
101
58
  requirements:
102
59
  - - "~>"
103
60
  - !ruby/object:Gem::Version
104
- version: '1.1'
61
+ version: '5.10'
105
62
  type: :development
106
63
  prerelease: false
107
64
  version_requirements: !ruby/object:Gem::Requirement
108
65
  requirements:
109
66
  - - "~>"
110
67
  - !ruby/object:Gem::Version
111
- version: '1.1'
68
+ version: '5.10'
112
69
  - !ruby/object:Gem::Dependency
113
70
  name: rubocop
114
71
  requirement: !ruby/object:Gem::Requirement
@@ -137,39 +94,9 @@ dependencies:
137
94
  - - "~>"
138
95
  - !ruby/object:Gem::Version
139
96
  version: '0.9'
140
- - !ruby/object:Gem::Dependency
141
- name: yard
142
- requirement: !ruby/object:Gem::Requirement
143
- requirements:
144
- - - "~>"
145
- - !ruby/object:Gem::Version
146
- version: '0.9'
147
- type: :development
148
- prerelease: false
149
- version_requirements: !ruby/object:Gem::Requirement
150
- requirements:
151
- - - "~>"
152
- - !ruby/object:Gem::Version
153
- version: '0.9'
154
- - !ruby/object:Gem::Dependency
155
- name: yard-doctest
156
- requirement: !ruby/object:Gem::Requirement
157
- requirements:
158
- - - "<="
159
- - !ruby/object:Gem::Version
160
- version: 0.1.8
161
- type: :development
162
- prerelease: false
163
- version_requirements: !ruby/object:Gem::Requirement
164
- requirements:
165
- - - "<="
166
- - !ruby/object:Gem::Version
167
- version: 0.1.8
168
97
  description: google-cloud-language is the official library for Google Cloud Natural
169
98
  Language API.
170
- email:
171
- - mike@blowmage.com
172
- - quartzmo@gmail.com
99
+ email: googleapis-packages@google.com
173
100
  executables: []
174
101
  extensions: []
175
102
  extra_rdoc_files: []
@@ -177,32 +104,29 @@ files:
177
104
  - ".yardopts"
178
105
  - LICENSE
179
106
  - README.md
180
- - lib/google-cloud-language.rb
181
107
  - lib/google/cloud/language.rb
182
- - lib/google/cloud/language/annotation.rb
183
- - lib/google/cloud/language/convert.rb
184
108
  - lib/google/cloud/language/credentials.rb
185
- - lib/google/cloud/language/document.rb
186
- - lib/google/cloud/language/project.rb
187
- - lib/google/cloud/language/service.rb
188
109
  - lib/google/cloud/language/v1.rb
189
110
  - lib/google/cloud/language/v1/doc/google/cloud/language/v1/language_service.rb
111
+ - lib/google/cloud/language/v1/doc/overview.rb
190
112
  - lib/google/cloud/language/v1/language_service_client.rb
191
113
  - lib/google/cloud/language/v1/language_service_client_config.json
192
114
  - lib/google/cloud/language/v1/language_service_pb.rb
193
115
  - lib/google/cloud/language/v1/language_service_services_pb.rb
194
116
  - lib/google/cloud/language/v1beta2.rb
195
117
  - lib/google/cloud/language/v1beta2/doc/google/cloud/language/v1beta2/language_service.rb
118
+ - lib/google/cloud/language/v1beta2/doc/overview.rb
196
119
  - lib/google/cloud/language/v1beta2/language_service_client.rb
197
120
  - lib/google/cloud/language/v1beta2/language_service_client_config.json
198
121
  - lib/google/cloud/language/v1beta2/language_service_pb.rb
199
122
  - lib/google/cloud/language/v1beta2/language_service_services_pb.rb
200
- - lib/google/cloud/language/version.rb
201
- homepage: https://github.com/GoogleCloudPlatform/google-cloud-ruby/tree/master/google-cloud-language
123
+ homepage: https://github.com/googleapis/googleapis
202
124
  licenses:
203
125
  - Apache-2.0
204
126
  metadata: {}
205
- post_install_message:
127
+ post_install_message: 'This release, 0.28.0, introduces breaking changes relative
128
+ to the previous release, 0.27.1. For more details and instructions to migrate your
129
+ code, please visit the migration guide: https://cloud.google.com/natural-language/docs/ruby-client-migration.'
206
130
  rdoc_options: []
207
131
  require_paths:
208
132
  - lib
@@ -218,7 +142,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
218
142
  version: '0'
219
143
  requirements: []
220
144
  rubyforge_project:
221
- rubygems_version: 2.6.13
145
+ rubygems_version: 2.7.2
222
146
  signing_key:
223
147
  specification_version: 4
224
148
  summary: API Client library for Google Cloud Natural Language API