google-cloud-language 0.36.0 → 1.0.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.
- checksums.yaml +4 -4
- data/.yardopts +2 -1
- data/AUTHENTICATION.md +51 -59
- data/LICENSE.md +203 -0
- data/MIGRATING.md +235 -0
- data/README.md +35 -25
- data/lib/google-cloud-language.rb +35 -0
- data/lib/google/cloud/language.rb +62 -119
- data/lib/google/cloud/language/version.rb +1 -1
- metadata +83 -51
- data/LICENSE +0 -201
- data/lib/google/cloud/language/v1.rb +0 -148
- data/lib/google/cloud/language/v1/credentials.rb +0 -41
- data/lib/google/cloud/language/v1/doc/google/cloud/language/v1/language_service.rb +0 -1039
- data/lib/google/cloud/language/v1/language_service_client.rb +0 -451
- data/lib/google/cloud/language/v1/language_service_client_config.json +0 -56
- data/lib/google/cloud/language/v1/language_service_pb.rb +0 -403
- data/lib/google/cloud/language/v1/language_service_services_pb.rb +0 -64
- data/lib/google/cloud/language/v1beta2.rb +0 -160
- data/lib/google/cloud/language/v1beta2/credentials.rb +0 -41
- data/lib/google/cloud/language/v1beta2/doc/google/cloud/language/v1beta2/language_service.rb +0 -1049
- data/lib/google/cloud/language/v1beta2/language_service_client.rb +0 -451
- data/lib/google/cloud/language/v1beta2/language_service_client_config.json +0 -56
- data/lib/google/cloud/language/v1beta2/language_service_pb.rb +0 -404
- data/lib/google/cloud/language/v1beta2/language_service_services_pb.rb +0 -64
data/LICENSE
DELETED
@@ -1,201 +0,0 @@
|
|
1
|
-
Apache License
|
2
|
-
Version 2.0, January 2004
|
3
|
-
https://www.apache.org/licenses/
|
4
|
-
|
5
|
-
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
6
|
-
|
7
|
-
1. Definitions.
|
8
|
-
|
9
|
-
"License" shall mean the terms and conditions for use, reproduction,
|
10
|
-
and distribution as defined by Sections 1 through 9 of this document.
|
11
|
-
|
12
|
-
"Licensor" shall mean the copyright owner or entity authorized by
|
13
|
-
the copyright owner that is granting the License.
|
14
|
-
|
15
|
-
"Legal Entity" shall mean the union of the acting entity and all
|
16
|
-
other entities that control, are controlled by, or are under common
|
17
|
-
control with that entity. For the purposes of this definition,
|
18
|
-
"control" means (i) the power, direct or indirect, to cause the
|
19
|
-
direction or management of such entity, whether by contract or
|
20
|
-
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
21
|
-
outstanding shares, or (iii) beneficial ownership of such entity.
|
22
|
-
|
23
|
-
"You" (or "Your") shall mean an individual or Legal Entity
|
24
|
-
exercising permissions granted by this License.
|
25
|
-
|
26
|
-
"Source" form shall mean the preferred form for making modifications,
|
27
|
-
including but not limited to software source code, documentation
|
28
|
-
source, and configuration files.
|
29
|
-
|
30
|
-
"Object" form shall mean any form resulting from mechanical
|
31
|
-
transformation or translation of a Source form, including but
|
32
|
-
not limited to compiled object code, generated documentation,
|
33
|
-
and conversions to other media types.
|
34
|
-
|
35
|
-
"Work" shall mean the work of authorship, whether in Source or
|
36
|
-
Object form, made available under the License, as indicated by a
|
37
|
-
copyright notice that is included in or attached to the work
|
38
|
-
(an example is provided in the Appendix below).
|
39
|
-
|
40
|
-
"Derivative Works" shall mean any work, whether in Source or Object
|
41
|
-
form, that is based on (or derived from) the Work and for which the
|
42
|
-
editorial revisions, annotations, elaborations, or other modifications
|
43
|
-
represent, as a whole, an original work of authorship. For the purposes
|
44
|
-
of this License, Derivative Works shall not include works that remain
|
45
|
-
separable from, or merely link (or bind by name) to the interfaces of,
|
46
|
-
the Work and Derivative Works thereof.
|
47
|
-
|
48
|
-
"Contribution" shall mean any work of authorship, including
|
49
|
-
the original version of the Work and any modifications or additions
|
50
|
-
to that Work or Derivative Works thereof, that is intentionally
|
51
|
-
submitted to Licensor for inclusion in the Work by the copyright owner
|
52
|
-
or by an individual or Legal Entity authorized to submit on behalf of
|
53
|
-
the copyright owner. For the purposes of this definition, "submitted"
|
54
|
-
means any form of electronic, verbal, or written communication sent
|
55
|
-
to the Licensor or its representatives, including but not limited to
|
56
|
-
communication on electronic mailing lists, source code control systems,
|
57
|
-
and issue tracking systems that are managed by, or on behalf of, the
|
58
|
-
Licensor for the purpose of discussing and improving the Work, but
|
59
|
-
excluding communication that is conspicuously marked or otherwise
|
60
|
-
designated in writing by the copyright owner as "Not a Contribution."
|
61
|
-
|
62
|
-
"Contributor" shall mean Licensor and any individual or Legal Entity
|
63
|
-
on behalf of whom a Contribution has been received by Licensor and
|
64
|
-
subsequently incorporated within the Work.
|
65
|
-
|
66
|
-
2. Grant of Copyright License. Subject to the terms and conditions of
|
67
|
-
this License, each Contributor hereby grants to You a perpetual,
|
68
|
-
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
69
|
-
copyright license to reproduce, prepare Derivative Works of,
|
70
|
-
publicly display, publicly perform, sublicense, and distribute the
|
71
|
-
Work and such Derivative Works in Source or Object form.
|
72
|
-
|
73
|
-
3. Grant of Patent License. Subject to the terms and conditions of
|
74
|
-
this License, each Contributor hereby grants to You a perpetual,
|
75
|
-
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
76
|
-
(except as stated in this section) patent license to make, have made,
|
77
|
-
use, offer to sell, sell, import, and otherwise transfer the Work,
|
78
|
-
where such license applies only to those patent claims licensable
|
79
|
-
by such Contributor that are necessarily infringed by their
|
80
|
-
Contribution(s) alone or by combination of their Contribution(s)
|
81
|
-
with the Work to which such Contribution(s) was submitted. If You
|
82
|
-
institute patent litigation against any entity (including a
|
83
|
-
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
84
|
-
or a Contribution incorporated within the Work constitutes direct
|
85
|
-
or contributory patent infringement, then any patent licenses
|
86
|
-
granted to You under this License for that Work shall terminate
|
87
|
-
as of the date such litigation is filed.
|
88
|
-
|
89
|
-
4. Redistribution. You may reproduce and distribute copies of the
|
90
|
-
Work or Derivative Works thereof in any medium, with or without
|
91
|
-
modifications, and in Source or Object form, provided that You
|
92
|
-
meet the following conditions:
|
93
|
-
|
94
|
-
(a) You must give any other recipients of the Work or
|
95
|
-
Derivative Works a copy of this License; and
|
96
|
-
|
97
|
-
(b) You must cause any modified files to carry prominent notices
|
98
|
-
stating that You changed the files; and
|
99
|
-
|
100
|
-
(c) You must retain, in the Source form of any Derivative Works
|
101
|
-
that You distribute, all copyright, patent, trademark, and
|
102
|
-
attribution notices from the Source form of the Work,
|
103
|
-
excluding those notices that do not pertain to any part of
|
104
|
-
the Derivative Works; and
|
105
|
-
|
106
|
-
(d) If the Work includes a "NOTICE" text file as part of its
|
107
|
-
distribution, then any Derivative Works that You distribute must
|
108
|
-
include a readable copy of the attribution notices contained
|
109
|
-
within such NOTICE file, excluding those notices that do not
|
110
|
-
pertain to any part of the Derivative Works, in at least one
|
111
|
-
of the following places: within a NOTICE text file distributed
|
112
|
-
as part of the Derivative Works; within the Source form or
|
113
|
-
documentation, if provided along with the Derivative Works; or,
|
114
|
-
within a display generated by the Derivative Works, if and
|
115
|
-
wherever such third-party notices normally appear. The contents
|
116
|
-
of the NOTICE file are for informational purposes only and
|
117
|
-
do not modify the License. You may add Your own attribution
|
118
|
-
notices within Derivative Works that You distribute, alongside
|
119
|
-
or as an addendum to the NOTICE text from the Work, provided
|
120
|
-
that such additional attribution notices cannot be construed
|
121
|
-
as modifying the License.
|
122
|
-
|
123
|
-
You may add Your own copyright statement to Your modifications and
|
124
|
-
may provide additional or different license terms and conditions
|
125
|
-
for use, reproduction, or distribution of Your modifications, or
|
126
|
-
for any such Derivative Works as a whole, provided Your use,
|
127
|
-
reproduction, and distribution of the Work otherwise complies with
|
128
|
-
the conditions stated in this License.
|
129
|
-
|
130
|
-
5. Submission of Contributions. Unless You explicitly state otherwise,
|
131
|
-
any Contribution intentionally submitted for inclusion in the Work
|
132
|
-
by You to the Licensor shall be under the terms and conditions of
|
133
|
-
this License, without any additional terms or conditions.
|
134
|
-
Notwithstanding the above, nothing herein shall supersede or modify
|
135
|
-
the terms of any separate license agreement you may have executed
|
136
|
-
with Licensor regarding such Contributions.
|
137
|
-
|
138
|
-
6. Trademarks. This License does not grant permission to use the trade
|
139
|
-
names, trademarks, service marks, or product names of the Licensor,
|
140
|
-
except as required for reasonable and customary use in describing the
|
141
|
-
origin of the Work and reproducing the content of the NOTICE file.
|
142
|
-
|
143
|
-
7. Disclaimer of Warranty. Unless required by applicable law or
|
144
|
-
agreed to in writing, Licensor provides the Work (and each
|
145
|
-
Contributor provides its Contributions) on an "AS IS" BASIS,
|
146
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
147
|
-
implied, including, without limitation, any warranties or conditions
|
148
|
-
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
149
|
-
PARTICULAR PURPOSE. You are solely responsible for determining the
|
150
|
-
appropriateness of using or redistributing the Work and assume any
|
151
|
-
risks associated with Your exercise of permissions under this License.
|
152
|
-
|
153
|
-
8. Limitation of Liability. In no event and under no legal theory,
|
154
|
-
whether in tort (including negligence), contract, or otherwise,
|
155
|
-
unless required by applicable law (such as deliberate and grossly
|
156
|
-
negligent acts) or agreed to in writing, shall any Contributor be
|
157
|
-
liable to You for damages, including any direct, indirect, special,
|
158
|
-
incidental, or consequential damages of any character arising as a
|
159
|
-
result of this License or out of the use or inability to use the
|
160
|
-
Work (including but not limited to damages for loss of goodwill,
|
161
|
-
work stoppage, computer failure or malfunction, or any and all
|
162
|
-
other commercial damages or losses), even if such Contributor
|
163
|
-
has been advised of the possibility of such damages.
|
164
|
-
|
165
|
-
9. Accepting Warranty or Additional Liability. While redistributing
|
166
|
-
the Work or Derivative Works thereof, You may choose to offer,
|
167
|
-
and charge a fee for, acceptance of support, warranty, indemnity,
|
168
|
-
or other liability obligations and/or rights consistent with this
|
169
|
-
License. However, in accepting such obligations, You may act only
|
170
|
-
on Your own behalf and on Your sole responsibility, not on behalf
|
171
|
-
of any other Contributor, and only if You agree to indemnify,
|
172
|
-
defend, and hold each Contributor harmless for any liability
|
173
|
-
incurred by, or claims asserted against, such Contributor by reason
|
174
|
-
of your accepting any such warranty or additional liability.
|
175
|
-
|
176
|
-
END OF TERMS AND CONDITIONS
|
177
|
-
|
178
|
-
APPENDIX: How to apply the Apache License to your work.
|
179
|
-
|
180
|
-
To apply the Apache License to your work, attach the following
|
181
|
-
boilerplate notice, with the fields enclosed by brackets "[]"
|
182
|
-
replaced with your own identifying information. (Don't include
|
183
|
-
the brackets!) The text should be enclosed in the appropriate
|
184
|
-
comment syntax for the file format. We also recommend that a
|
185
|
-
file or class name and description of purpose be included on the
|
186
|
-
same "printed page" as the copyright notice for easier
|
187
|
-
identification within third-party archives.
|
188
|
-
|
189
|
-
Copyright [yyyy] [name of copyright owner]
|
190
|
-
|
191
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
192
|
-
you may not use this file except in compliance with the License.
|
193
|
-
You may obtain a copy of the License at
|
194
|
-
|
195
|
-
https://www.apache.org/licenses/LICENSE-2.0
|
196
|
-
|
197
|
-
Unless required by applicable law or agreed to in writing, software
|
198
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
199
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
200
|
-
See the License for the specific language governing permissions and
|
201
|
-
limitations under the License.
|
@@ -1,148 +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/v1/language_service_client"
|
17
|
-
|
18
|
-
module Google
|
19
|
-
module Cloud
|
20
|
-
module Language
|
21
|
-
# rubocop:disable LineLength
|
22
|
-
|
23
|
-
##
|
24
|
-
# # Ruby Client for Cloud Natural Language API
|
25
|
-
#
|
26
|
-
# [Cloud Natural Language API][Product Documentation]:
|
27
|
-
# Provides natural language understanding technologies, such as sentiment
|
28
|
-
# analysis, entity recognition, entity sentiment analysis, and other text
|
29
|
-
# annotations, to developers.
|
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 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
|
-
# ### Next Steps
|
47
|
-
# - Read the [Cloud Natural Language API Product documentation][Product Documentation]
|
48
|
-
# to learn more about the product and see How-to Guides.
|
49
|
-
# - View this [repository's main README](https://github.com/googleapis/google-cloud-ruby/blob/master/README.md)
|
50
|
-
# to see the full list of Cloud APIs that we cover.
|
51
|
-
#
|
52
|
-
# [Product Documentation]: https://cloud.google.com/natural-language
|
53
|
-
#
|
54
|
-
# ## Enabling Logging
|
55
|
-
#
|
56
|
-
# To enable logging for this library, set the logger for the underlying [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library.
|
57
|
-
# 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,
|
58
|
-
# or a [`Google::Cloud::Logging::Logger`](https://googleapis.dev/ruby/google-cloud-logging/latest)
|
59
|
-
# 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)
|
60
|
-
# and the gRPC [spec_helper.rb](https://github.com/grpc/grpc/blob/master/src/ruby/spec/spec_helper.rb) for additional information.
|
61
|
-
#
|
62
|
-
# Configuring a Ruby stdlib logger:
|
63
|
-
#
|
64
|
-
# ```ruby
|
65
|
-
# require "logger"
|
66
|
-
#
|
67
|
-
# module MyLogger
|
68
|
-
# LOGGER = Logger.new $stderr, level: Logger::WARN
|
69
|
-
# def logger
|
70
|
-
# LOGGER
|
71
|
-
# end
|
72
|
-
# end
|
73
|
-
#
|
74
|
-
# # Define a gRPC module-level logger method before grpc/logconfig.rb loads.
|
75
|
-
# module GRPC
|
76
|
-
# extend MyLogger
|
77
|
-
# end
|
78
|
-
# ```
|
79
|
-
#
|
80
|
-
module V1
|
81
|
-
# rubocop:enable LineLength
|
82
|
-
|
83
|
-
##
|
84
|
-
# Provides text analysis operations such as sentiment analysis and entity
|
85
|
-
# recognition.
|
86
|
-
#
|
87
|
-
# @param credentials [Google::Auth::Credentials, String, Hash, GRPC::Core::Channel, GRPC::Core::ChannelCredentials, Proc]
|
88
|
-
# Provides the means for authenticating requests made by the client. This parameter can
|
89
|
-
# be many types.
|
90
|
-
# A `Google::Auth::Credentials` uses a the properties of its represented keyfile for
|
91
|
-
# authenticating requests made by this client.
|
92
|
-
# A `String` will be treated as the path to the keyfile to be used for the construction of
|
93
|
-
# credentials for this client.
|
94
|
-
# A `Hash` will be treated as the contents of a keyfile to be used for the construction of
|
95
|
-
# credentials for this client.
|
96
|
-
# A `GRPC::Core::Channel` will be used to make calls through.
|
97
|
-
# A `GRPC::Core::ChannelCredentials` for the setting up the RPC client. The channel credentials
|
98
|
-
# should already be composed with a `GRPC::Core::CallCredentials` object.
|
99
|
-
# A `Proc` will be used as an updater_proc for the Grpc channel. The proc transforms the
|
100
|
-
# metadata for requests, generally, to give OAuth credentials.
|
101
|
-
# @param scopes [Array<String>]
|
102
|
-
# The OAuth scopes for this service. This parameter is ignored if
|
103
|
-
# an updater_proc is supplied.
|
104
|
-
# @param client_config [Hash]
|
105
|
-
# A Hash for call options for each method. See
|
106
|
-
# Google::Gax#construct_settings for the structure of
|
107
|
-
# this data. Falls back to the default config if not specified
|
108
|
-
# or the specified config is missing data points.
|
109
|
-
# @param timeout [Numeric]
|
110
|
-
# The default timeout, in seconds, for calls made through this client.
|
111
|
-
# @param metadata [Hash]
|
112
|
-
# Default metadata to be sent with each request. This can be overridden on a per call basis.
|
113
|
-
# @param service_address [String]
|
114
|
-
# Override for the service hostname, or `nil` to leave as the default.
|
115
|
-
# @param service_port [Integer]
|
116
|
-
# Override for the service port, or `nil` to leave as the default.
|
117
|
-
# @param exception_transformer [Proc]
|
118
|
-
# An optional proc that intercepts any exceptions raised during an API call to inject
|
119
|
-
# custom error handling.
|
120
|
-
def self.new \
|
121
|
-
credentials: nil,
|
122
|
-
scopes: nil,
|
123
|
-
client_config: nil,
|
124
|
-
timeout: nil,
|
125
|
-
metadata: nil,
|
126
|
-
service_address: nil,
|
127
|
-
service_port: nil,
|
128
|
-
exception_transformer: nil,
|
129
|
-
lib_name: nil,
|
130
|
-
lib_version: nil
|
131
|
-
kwargs = {
|
132
|
-
credentials: credentials,
|
133
|
-
scopes: scopes,
|
134
|
-
client_config: client_config,
|
135
|
-
timeout: timeout,
|
136
|
-
metadata: metadata,
|
137
|
-
exception_transformer: exception_transformer,
|
138
|
-
lib_name: lib_name,
|
139
|
-
service_address: service_address,
|
140
|
-
service_port: service_port,
|
141
|
-
lib_version: lib_version
|
142
|
-
}.select { |_, v| v != nil }
|
143
|
-
Google::Cloud::Language::V1::LanguageServiceClient.new(**kwargs)
|
144
|
-
end
|
145
|
-
end
|
146
|
-
end
|
147
|
-
end
|
148
|
-
end
|
@@ -1,41 +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 "googleauth"
|
17
|
-
|
18
|
-
module Google
|
19
|
-
module Cloud
|
20
|
-
module Language
|
21
|
-
module V1
|
22
|
-
class Credentials < Google::Auth::Credentials
|
23
|
-
SCOPE = [
|
24
|
-
"https://www.googleapis.com/auth/cloud-platform"
|
25
|
-
].freeze
|
26
|
-
PATH_ENV_VARS = %w(LANGUAGE_CREDENTIALS
|
27
|
-
LANGUAGE_KEYFILE
|
28
|
-
GOOGLE_CLOUD_CREDENTIALS
|
29
|
-
GOOGLE_CLOUD_KEYFILE
|
30
|
-
GCLOUD_KEYFILE)
|
31
|
-
JSON_ENV_VARS = %w(LANGUAGE_CREDENTIALS_JSON
|
32
|
-
LANGUAGE_KEYFILE_JSON
|
33
|
-
GOOGLE_CLOUD_CREDENTIALS_JSON
|
34
|
-
GOOGLE_CLOUD_KEYFILE_JSON
|
35
|
-
GCLOUD_KEYFILE_JSON)
|
36
|
-
DEFAULT_PATHS = ["~/.config/gcloud/application_default_credentials.json"]
|
37
|
-
end
|
38
|
-
end
|
39
|
-
end
|
40
|
-
end
|
41
|
-
end
|
@@ -1,1039 +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
|
-
module Google
|
17
|
-
module Cloud
|
18
|
-
module Language
|
19
|
-
module V1
|
20
|
-
# ================================================================ #
|
21
|
-
#
|
22
|
-
# Represents the input to API methods.
|
23
|
-
# @!attribute [rw] type
|
24
|
-
# @return [Google::Cloud::Language::V1::Document::Type]
|
25
|
-
# Required. If the type is not set or is `TYPE_UNSPECIFIED`,
|
26
|
-
# returns an `INVALID_ARGUMENT` error.
|
27
|
-
# @!attribute [rw] content
|
28
|
-
# @return [String]
|
29
|
-
# The content of the input in string format.
|
30
|
-
# Cloud audit logging exempt since it is based on user data.
|
31
|
-
# @!attribute [rw] gcs_content_uri
|
32
|
-
# @return [String]
|
33
|
-
# The Google Cloud Storage URI where the file content is located.
|
34
|
-
# This URI must be of the form: gs://bucket_name/object_name. For more
|
35
|
-
# details, see https://cloud.google.com/storage/docs/reference-uris.
|
36
|
-
# NOTE: Cloud Storage object versioning is not supported.
|
37
|
-
# @!attribute [rw] language
|
38
|
-
# @return [String]
|
39
|
-
# The language of the document (if not specified, the language is
|
40
|
-
# automatically detected). Both ISO and BCP-47 language codes are
|
41
|
-
# accepted.<br>
|
42
|
-
# [Language Support](https://cloud.google.com/natural-language/docs/languages)
|
43
|
-
# lists currently supported languages for each API method.
|
44
|
-
# If the language (either specified by the caller or automatically detected)
|
45
|
-
# is not supported by the called API method, an `INVALID_ARGUMENT` error
|
46
|
-
# is returned.
|
47
|
-
class Document
|
48
|
-
# The document types enum.
|
49
|
-
module Type
|
50
|
-
# The content type is not specified.
|
51
|
-
TYPE_UNSPECIFIED = 0
|
52
|
-
|
53
|
-
# Plain text
|
54
|
-
PLAIN_TEXT = 1
|
55
|
-
|
56
|
-
# HTML
|
57
|
-
HTML = 2
|
58
|
-
end
|
59
|
-
end
|
60
|
-
|
61
|
-
# Represents a sentence in the input document.
|
62
|
-
# @!attribute [rw] text
|
63
|
-
# @return [Google::Cloud::Language::V1::TextSpan]
|
64
|
-
# The sentence text.
|
65
|
-
# @!attribute [rw] sentiment
|
66
|
-
# @return [Google::Cloud::Language::V1::Sentiment]
|
67
|
-
# For calls to {AnalyzeSentiment} or if
|
68
|
-
# {Google::Cloud::Language::V1::AnnotateTextRequest::Features#extract_document_sentiment AnnotateTextRequest::Features#extract_document_sentiment} is set to
|
69
|
-
# true, this field will contain the sentiment for the sentence.
|
70
|
-
class Sentence; end
|
71
|
-
|
72
|
-
# Represents a phrase in the text that is a known entity, such as
|
73
|
-
# a person, an organization, or location. The API associates information, such
|
74
|
-
# as salience and mentions, with entities.
|
75
|
-
# @!attribute [rw] name
|
76
|
-
# @return [String]
|
77
|
-
# The representative name for the entity.
|
78
|
-
# @!attribute [rw] type
|
79
|
-
# @return [Google::Cloud::Language::V1::Entity::Type]
|
80
|
-
# The entity type.
|
81
|
-
# @!attribute [rw] metadata
|
82
|
-
# @return [Hash{String => String}]
|
83
|
-
# Metadata associated with the entity.
|
84
|
-
#
|
85
|
-
# For most entity types, the metadata is a Wikipedia URL (`wikipedia_url`)
|
86
|
-
# and Knowledge Graph MID (`mid`), if they are available. For the metadata
|
87
|
-
# associated with other entity types, see the Type table below.
|
88
|
-
# @!attribute [rw] salience
|
89
|
-
# @return [Float]
|
90
|
-
# The salience score associated with the entity in the [0, 1.0] range.
|
91
|
-
#
|
92
|
-
# The salience score for an entity provides information about the
|
93
|
-
# importance or centrality of that entity to the entire document text.
|
94
|
-
# Scores closer to 0 are less salient, while scores closer to 1.0 are highly
|
95
|
-
# salient.
|
96
|
-
# @!attribute [rw] mentions
|
97
|
-
# @return [Array<Google::Cloud::Language::V1::EntityMention>]
|
98
|
-
# The mentions of this entity in the input document. The API currently
|
99
|
-
# supports proper noun mentions.
|
100
|
-
# @!attribute [rw] sentiment
|
101
|
-
# @return [Google::Cloud::Language::V1::Sentiment]
|
102
|
-
# For calls to {AnalyzeEntitySentiment} or if
|
103
|
-
# {Google::Cloud::Language::V1::AnnotateTextRequest::Features#extract_entity_sentiment AnnotateTextRequest::Features#extract_entity_sentiment} is set to
|
104
|
-
# true, this field will contain the aggregate sentiment expressed for this
|
105
|
-
# entity in the provided document.
|
106
|
-
class Entity
|
107
|
-
# The type of the entity. For most entity types, the associated metadata is a
|
108
|
-
# Wikipedia URL (`wikipedia_url`) and Knowledge Graph MID (`mid`). The table
|
109
|
-
# below lists the associated fields for entities that have different
|
110
|
-
# metadata.
|
111
|
-
module Type
|
112
|
-
# Unknown
|
113
|
-
UNKNOWN = 0
|
114
|
-
|
115
|
-
# Person
|
116
|
-
PERSON = 1
|
117
|
-
|
118
|
-
# Location
|
119
|
-
LOCATION = 2
|
120
|
-
|
121
|
-
# Organization
|
122
|
-
ORGANIZATION = 3
|
123
|
-
|
124
|
-
# Event
|
125
|
-
EVENT = 4
|
126
|
-
|
127
|
-
# Artwork
|
128
|
-
WORK_OF_ART = 5
|
129
|
-
|
130
|
-
# Consumer product
|
131
|
-
CONSUMER_GOOD = 6
|
132
|
-
|
133
|
-
# Other types of entities
|
134
|
-
OTHER = 7
|
135
|
-
|
136
|
-
# Phone number<br><br>
|
137
|
-
# The metadata lists the phone number, formatted according to local
|
138
|
-
# convention, plus whichever additional elements appear in the text:<ul>
|
139
|
-
# <li><code>number</code> – the actual number, broken down into
|
140
|
-
# sections as per local convention</li> <li><code>national_prefix</code>
|
141
|
-
# – country code, if detected</li> <li><code>area_code</code> –
|
142
|
-
# region or area code, if detected</li> <li><code>extension</code> –
|
143
|
-
# phone extension (to be dialed after connection), if detected</li></ul>
|
144
|
-
PHONE_NUMBER = 9
|
145
|
-
|
146
|
-
# Address<br><br>
|
147
|
-
# The metadata identifies the street number and locality plus whichever
|
148
|
-
# additional elements appear in the text:<ul>
|
149
|
-
# <li><code>street_number</code> – street number</li>
|
150
|
-
# <li><code>locality</code> – city or town</li>
|
151
|
-
# <li><code>street_name</code> – street/route name, if detected</li>
|
152
|
-
# <li><code>postal_code</code> – postal code, if detected</li>
|
153
|
-
# <li><code>country</code> – country, if detected</li>
|
154
|
-
# <li><code>broad_region</code> – administrative area, such as the
|
155
|
-
# state, if detected</li> <li><code>narrow_region</code> – smaller
|
156
|
-
# administrative area, such as county, if detected</li>
|
157
|
-
# <li><code>sublocality</code> – used in Asian addresses to demark a
|
158
|
-
# district within a city, if detected</li></ul>
|
159
|
-
ADDRESS = 10
|
160
|
-
|
161
|
-
# Date<br><br>
|
162
|
-
# The metadata identifies the components of the date:<ul>
|
163
|
-
# <li><code>year</code> – four digit year, if detected</li>
|
164
|
-
# <li><code>month</code> – two digit month number, if detected</li>
|
165
|
-
# <li><code>day</code> – two digit day number, if detected</li></ul>
|
166
|
-
DATE = 11
|
167
|
-
|
168
|
-
# Number<br><br>
|
169
|
-
# The metadata is the number itself.
|
170
|
-
NUMBER = 12
|
171
|
-
|
172
|
-
# Price<br><br>
|
173
|
-
# The metadata identifies the <code>value</code> and <code>currency</code>.
|
174
|
-
PRICE = 13
|
175
|
-
end
|
176
|
-
end
|
177
|
-
|
178
|
-
# Represents the smallest syntactic building block of the text.
|
179
|
-
# @!attribute [rw] text
|
180
|
-
# @return [Google::Cloud::Language::V1::TextSpan]
|
181
|
-
# The token text.
|
182
|
-
# @!attribute [rw] part_of_speech
|
183
|
-
# @return [Google::Cloud::Language::V1::PartOfSpeech]
|
184
|
-
# Parts of speech tag for this token.
|
185
|
-
# @!attribute [rw] dependency_edge
|
186
|
-
# @return [Google::Cloud::Language::V1::DependencyEdge]
|
187
|
-
# Dependency tree parse for this token.
|
188
|
-
# @!attribute [rw] lemma
|
189
|
-
# @return [String]
|
190
|
-
# [Lemma](https://en.wikipedia.org/wiki/Lemma_%28morphology%29) of the token.
|
191
|
-
class Token; end
|
192
|
-
|
193
|
-
# Represents the feeling associated with the entire text or entities in
|
194
|
-
# the text.
|
195
|
-
# @!attribute [rw] magnitude
|
196
|
-
# @return [Float]
|
197
|
-
# A non-negative number in the [0, +inf) range, which represents
|
198
|
-
# the absolute magnitude of sentiment regardless of score (positive or
|
199
|
-
# negative).
|
200
|
-
# @!attribute [rw] score
|
201
|
-
# @return [Float]
|
202
|
-
# Sentiment score between -1.0 (negative sentiment) and 1.0
|
203
|
-
# (positive sentiment).
|
204
|
-
class Sentiment; end
|
205
|
-
|
206
|
-
# Represents part of speech information for a token. Parts of speech
|
207
|
-
# are as defined in
|
208
|
-
# http://www.lrec-conf.org/proceedings/lrec2012/pdf/274_Paper.pdf
|
209
|
-
# @!attribute [rw] tag
|
210
|
-
# @return [Google::Cloud::Language::V1::PartOfSpeech::Tag]
|
211
|
-
# The part of speech tag.
|
212
|
-
# @!attribute [rw] aspect
|
213
|
-
# @return [Google::Cloud::Language::V1::PartOfSpeech::Aspect]
|
214
|
-
# The grammatical aspect.
|
215
|
-
# @!attribute [rw] case
|
216
|
-
# @return [Google::Cloud::Language::V1::PartOfSpeech::Case]
|
217
|
-
# The grammatical case.
|
218
|
-
# @!attribute [rw] form
|
219
|
-
# @return [Google::Cloud::Language::V1::PartOfSpeech::Form]
|
220
|
-
# The grammatical form.
|
221
|
-
# @!attribute [rw] gender
|
222
|
-
# @return [Google::Cloud::Language::V1::PartOfSpeech::Gender]
|
223
|
-
# The grammatical gender.
|
224
|
-
# @!attribute [rw] mood
|
225
|
-
# @return [Google::Cloud::Language::V1::PartOfSpeech::Mood]
|
226
|
-
# The grammatical mood.
|
227
|
-
# @!attribute [rw] number
|
228
|
-
# @return [Google::Cloud::Language::V1::PartOfSpeech::Number]
|
229
|
-
# The grammatical number.
|
230
|
-
# @!attribute [rw] person
|
231
|
-
# @return [Google::Cloud::Language::V1::PartOfSpeech::Person]
|
232
|
-
# The grammatical person.
|
233
|
-
# @!attribute [rw] proper
|
234
|
-
# @return [Google::Cloud::Language::V1::PartOfSpeech::Proper]
|
235
|
-
# The grammatical properness.
|
236
|
-
# @!attribute [rw] reciprocity
|
237
|
-
# @return [Google::Cloud::Language::V1::PartOfSpeech::Reciprocity]
|
238
|
-
# The grammatical reciprocity.
|
239
|
-
# @!attribute [rw] tense
|
240
|
-
# @return [Google::Cloud::Language::V1::PartOfSpeech::Tense]
|
241
|
-
# The grammatical tense.
|
242
|
-
# @!attribute [rw] voice
|
243
|
-
# @return [Google::Cloud::Language::V1::PartOfSpeech::Voice]
|
244
|
-
# The grammatical voice.
|
245
|
-
class PartOfSpeech
|
246
|
-
# The characteristic of a verb that expresses time flow during an event.
|
247
|
-
module Aspect
|
248
|
-
# Aspect is not applicable in the analyzed language or is not predicted.
|
249
|
-
ASPECT_UNKNOWN = 0
|
250
|
-
|
251
|
-
# Perfective
|
252
|
-
PERFECTIVE = 1
|
253
|
-
|
254
|
-
# Imperfective
|
255
|
-
IMPERFECTIVE = 2
|
256
|
-
|
257
|
-
# Progressive
|
258
|
-
PROGRESSIVE = 3
|
259
|
-
end
|
260
|
-
|
261
|
-
# The grammatical function performed by a noun or pronoun in a phrase,
|
262
|
-
# clause, or sentence. In some languages, other parts of speech, such as
|
263
|
-
# adjective and determiner, take case inflection in agreement with the noun.
|
264
|
-
module Case
|
265
|
-
# Case is not applicable in the analyzed language or is not predicted.
|
266
|
-
CASE_UNKNOWN = 0
|
267
|
-
|
268
|
-
# Accusative
|
269
|
-
ACCUSATIVE = 1
|
270
|
-
|
271
|
-
# Adverbial
|
272
|
-
ADVERBIAL = 2
|
273
|
-
|
274
|
-
# Complementive
|
275
|
-
COMPLEMENTIVE = 3
|
276
|
-
|
277
|
-
# Dative
|
278
|
-
DATIVE = 4
|
279
|
-
|
280
|
-
# Genitive
|
281
|
-
GENITIVE = 5
|
282
|
-
|
283
|
-
# Instrumental
|
284
|
-
INSTRUMENTAL = 6
|
285
|
-
|
286
|
-
# Locative
|
287
|
-
LOCATIVE = 7
|
288
|
-
|
289
|
-
# Nominative
|
290
|
-
NOMINATIVE = 8
|
291
|
-
|
292
|
-
# Oblique
|
293
|
-
OBLIQUE = 9
|
294
|
-
|
295
|
-
# Partitive
|
296
|
-
PARTITIVE = 10
|
297
|
-
|
298
|
-
# Prepositional
|
299
|
-
PREPOSITIONAL = 11
|
300
|
-
|
301
|
-
# Reflexive
|
302
|
-
REFLEXIVE_CASE = 12
|
303
|
-
|
304
|
-
# Relative
|
305
|
-
RELATIVE_CASE = 13
|
306
|
-
|
307
|
-
# Vocative
|
308
|
-
VOCATIVE = 14
|
309
|
-
end
|
310
|
-
|
311
|
-
# Depending on the language, Form can be categorizing different forms of
|
312
|
-
# verbs, adjectives, adverbs, etc. For example, categorizing inflected
|
313
|
-
# endings of verbs and adjectives or distinguishing between short and long
|
314
|
-
# forms of adjectives and participles
|
315
|
-
module Form
|
316
|
-
# Form is not applicable in the analyzed language or is not predicted.
|
317
|
-
FORM_UNKNOWN = 0
|
318
|
-
|
319
|
-
# Adnomial
|
320
|
-
ADNOMIAL = 1
|
321
|
-
|
322
|
-
# Auxiliary
|
323
|
-
AUXILIARY = 2
|
324
|
-
|
325
|
-
# Complementizer
|
326
|
-
COMPLEMENTIZER = 3
|
327
|
-
|
328
|
-
# Final ending
|
329
|
-
FINAL_ENDING = 4
|
330
|
-
|
331
|
-
# Gerund
|
332
|
-
GERUND = 5
|
333
|
-
|
334
|
-
# Realis
|
335
|
-
REALIS = 6
|
336
|
-
|
337
|
-
# Irrealis
|
338
|
-
IRREALIS = 7
|
339
|
-
|
340
|
-
# Short form
|
341
|
-
SHORT = 8
|
342
|
-
|
343
|
-
# Long form
|
344
|
-
LONG = 9
|
345
|
-
|
346
|
-
# Order form
|
347
|
-
ORDER = 10
|
348
|
-
|
349
|
-
# Specific form
|
350
|
-
SPECIFIC = 11
|
351
|
-
end
|
352
|
-
|
353
|
-
# Gender classes of nouns reflected in the behaviour of associated words.
|
354
|
-
module Gender
|
355
|
-
# Gender is not applicable in the analyzed language or is not predicted.
|
356
|
-
GENDER_UNKNOWN = 0
|
357
|
-
|
358
|
-
# Feminine
|
359
|
-
FEMININE = 1
|
360
|
-
|
361
|
-
# Masculine
|
362
|
-
MASCULINE = 2
|
363
|
-
|
364
|
-
# Neuter
|
365
|
-
NEUTER = 3
|
366
|
-
end
|
367
|
-
|
368
|
-
# The grammatical feature of verbs, used for showing modality and attitude.
|
369
|
-
module Mood
|
370
|
-
# Mood is not applicable in the analyzed language or is not predicted.
|
371
|
-
MOOD_UNKNOWN = 0
|
372
|
-
|
373
|
-
# Conditional
|
374
|
-
CONDITIONAL_MOOD = 1
|
375
|
-
|
376
|
-
# Imperative
|
377
|
-
IMPERATIVE = 2
|
378
|
-
|
379
|
-
# Indicative
|
380
|
-
INDICATIVE = 3
|
381
|
-
|
382
|
-
# Interrogative
|
383
|
-
INTERROGATIVE = 4
|
384
|
-
|
385
|
-
# Jussive
|
386
|
-
JUSSIVE = 5
|
387
|
-
|
388
|
-
# Subjunctive
|
389
|
-
SUBJUNCTIVE = 6
|
390
|
-
end
|
391
|
-
|
392
|
-
# Count distinctions.
|
393
|
-
module Number
|
394
|
-
# Number is not applicable in the analyzed language or is not predicted.
|
395
|
-
NUMBER_UNKNOWN = 0
|
396
|
-
|
397
|
-
# Singular
|
398
|
-
SINGULAR = 1
|
399
|
-
|
400
|
-
# Plural
|
401
|
-
PLURAL = 2
|
402
|
-
|
403
|
-
# Dual
|
404
|
-
DUAL = 3
|
405
|
-
end
|
406
|
-
|
407
|
-
# The distinction between the speaker, second person, third person, etc.
|
408
|
-
module Person
|
409
|
-
# Person is not applicable in the analyzed language or is not predicted.
|
410
|
-
PERSON_UNKNOWN = 0
|
411
|
-
|
412
|
-
# First
|
413
|
-
FIRST = 1
|
414
|
-
|
415
|
-
# Second
|
416
|
-
SECOND = 2
|
417
|
-
|
418
|
-
# Third
|
419
|
-
THIRD = 3
|
420
|
-
|
421
|
-
# Reflexive
|
422
|
-
REFLEXIVE_PERSON = 4
|
423
|
-
end
|
424
|
-
|
425
|
-
# This category shows if the token is part of a proper name.
|
426
|
-
module Proper
|
427
|
-
# Proper is not applicable in the analyzed language or is not predicted.
|
428
|
-
PROPER_UNKNOWN = 0
|
429
|
-
|
430
|
-
# Proper
|
431
|
-
PROPER = 1
|
432
|
-
|
433
|
-
# Not proper
|
434
|
-
NOT_PROPER = 2
|
435
|
-
end
|
436
|
-
|
437
|
-
# Reciprocal features of a pronoun.
|
438
|
-
module Reciprocity
|
439
|
-
# Reciprocity is not applicable in the analyzed language or is not
|
440
|
-
# predicted.
|
441
|
-
RECIPROCITY_UNKNOWN = 0
|
442
|
-
|
443
|
-
# Reciprocal
|
444
|
-
RECIPROCAL = 1
|
445
|
-
|
446
|
-
# Non-reciprocal
|
447
|
-
NON_RECIPROCAL = 2
|
448
|
-
end
|
449
|
-
|
450
|
-
# The part of speech tags enum.
|
451
|
-
module Tag
|
452
|
-
# Unknown
|
453
|
-
UNKNOWN = 0
|
454
|
-
|
455
|
-
# Adjective
|
456
|
-
ADJ = 1
|
457
|
-
|
458
|
-
# Adposition (preposition and postposition)
|
459
|
-
ADP = 2
|
460
|
-
|
461
|
-
# Adverb
|
462
|
-
ADV = 3
|
463
|
-
|
464
|
-
# Conjunction
|
465
|
-
CONJ = 4
|
466
|
-
|
467
|
-
# Determiner
|
468
|
-
DET = 5
|
469
|
-
|
470
|
-
# Noun (common and proper)
|
471
|
-
NOUN = 6
|
472
|
-
|
473
|
-
# Cardinal number
|
474
|
-
NUM = 7
|
475
|
-
|
476
|
-
# Pronoun
|
477
|
-
PRON = 8
|
478
|
-
|
479
|
-
# Particle or other function word
|
480
|
-
PRT = 9
|
481
|
-
|
482
|
-
# Punctuation
|
483
|
-
PUNCT = 10
|
484
|
-
|
485
|
-
# Verb (all tenses and modes)
|
486
|
-
VERB = 11
|
487
|
-
|
488
|
-
# Other: foreign words, typos, abbreviations
|
489
|
-
X = 12
|
490
|
-
|
491
|
-
# Affix
|
492
|
-
AFFIX = 13
|
493
|
-
end
|
494
|
-
|
495
|
-
# Time reference.
|
496
|
-
module Tense
|
497
|
-
# Tense is not applicable in the analyzed language or is not predicted.
|
498
|
-
TENSE_UNKNOWN = 0
|
499
|
-
|
500
|
-
# Conditional
|
501
|
-
CONDITIONAL_TENSE = 1
|
502
|
-
|
503
|
-
# Future
|
504
|
-
FUTURE = 2
|
505
|
-
|
506
|
-
# Past
|
507
|
-
PAST = 3
|
508
|
-
|
509
|
-
# Present
|
510
|
-
PRESENT = 4
|
511
|
-
|
512
|
-
# Imperfect
|
513
|
-
IMPERFECT = 5
|
514
|
-
|
515
|
-
# Pluperfect
|
516
|
-
PLUPERFECT = 6
|
517
|
-
end
|
518
|
-
|
519
|
-
# The relationship between the action that a verb expresses and the
|
520
|
-
# participants identified by its arguments.
|
521
|
-
module Voice
|
522
|
-
# Voice is not applicable in the analyzed language or is not predicted.
|
523
|
-
VOICE_UNKNOWN = 0
|
524
|
-
|
525
|
-
# Active
|
526
|
-
ACTIVE = 1
|
527
|
-
|
528
|
-
# Causative
|
529
|
-
CAUSATIVE = 2
|
530
|
-
|
531
|
-
# Passive
|
532
|
-
PASSIVE = 3
|
533
|
-
end
|
534
|
-
end
|
535
|
-
|
536
|
-
# Represents dependency parse tree information for a token. (For more
|
537
|
-
# information on dependency labels, see
|
538
|
-
# http://www.aclweb.org/anthology/P13-2017
|
539
|
-
# @!attribute [rw] head_token_index
|
540
|
-
# @return [Integer]
|
541
|
-
# Represents the head of this token in the dependency tree.
|
542
|
-
# This is the index of the token which has an arc going to this token.
|
543
|
-
# The index is the position of the token in the array of tokens returned
|
544
|
-
# by the API method. If this token is a root token, then the
|
545
|
-
# `head_token_index` is its own index.
|
546
|
-
# @!attribute [rw] label
|
547
|
-
# @return [Google::Cloud::Language::V1::DependencyEdge::Label]
|
548
|
-
# The parse label for the token.
|
549
|
-
class DependencyEdge
|
550
|
-
# The parse label enum for the token.
|
551
|
-
module Label
|
552
|
-
# Unknown
|
553
|
-
UNKNOWN = 0
|
554
|
-
|
555
|
-
# Abbreviation modifier
|
556
|
-
ABBREV = 1
|
557
|
-
|
558
|
-
# Adjectival complement
|
559
|
-
ACOMP = 2
|
560
|
-
|
561
|
-
# Adverbial clause modifier
|
562
|
-
ADVCL = 3
|
563
|
-
|
564
|
-
# Adverbial modifier
|
565
|
-
ADVMOD = 4
|
566
|
-
|
567
|
-
# Adjectival modifier of an NP
|
568
|
-
AMOD = 5
|
569
|
-
|
570
|
-
# Appositional modifier of an NP
|
571
|
-
APPOS = 6
|
572
|
-
|
573
|
-
# Attribute dependent of a copular verb
|
574
|
-
ATTR = 7
|
575
|
-
|
576
|
-
# Auxiliary (non-main) verb
|
577
|
-
AUX = 8
|
578
|
-
|
579
|
-
# Passive auxiliary
|
580
|
-
AUXPASS = 9
|
581
|
-
|
582
|
-
# Coordinating conjunction
|
583
|
-
CC = 10
|
584
|
-
|
585
|
-
# Clausal complement of a verb or adjective
|
586
|
-
CCOMP = 11
|
587
|
-
|
588
|
-
# Conjunct
|
589
|
-
CONJ = 12
|
590
|
-
|
591
|
-
# Clausal subject
|
592
|
-
CSUBJ = 13
|
593
|
-
|
594
|
-
# Clausal passive subject
|
595
|
-
CSUBJPASS = 14
|
596
|
-
|
597
|
-
# Dependency (unable to determine)
|
598
|
-
DEP = 15
|
599
|
-
|
600
|
-
# Determiner
|
601
|
-
DET = 16
|
602
|
-
|
603
|
-
# Discourse
|
604
|
-
DISCOURSE = 17
|
605
|
-
|
606
|
-
# Direct object
|
607
|
-
DOBJ = 18
|
608
|
-
|
609
|
-
# Expletive
|
610
|
-
EXPL = 19
|
611
|
-
|
612
|
-
# Goes with (part of a word in a text not well edited)
|
613
|
-
GOESWITH = 20
|
614
|
-
|
615
|
-
# Indirect object
|
616
|
-
IOBJ = 21
|
617
|
-
|
618
|
-
# Marker (word introducing a subordinate clause)
|
619
|
-
MARK = 22
|
620
|
-
|
621
|
-
# Multi-word expression
|
622
|
-
MWE = 23
|
623
|
-
|
624
|
-
# Multi-word verbal expression
|
625
|
-
MWV = 24
|
626
|
-
|
627
|
-
# Negation modifier
|
628
|
-
NEG = 25
|
629
|
-
|
630
|
-
# Noun compound modifier
|
631
|
-
NN = 26
|
632
|
-
|
633
|
-
# Noun phrase used as an adverbial modifier
|
634
|
-
NPADVMOD = 27
|
635
|
-
|
636
|
-
# Nominal subject
|
637
|
-
NSUBJ = 28
|
638
|
-
|
639
|
-
# Passive nominal subject
|
640
|
-
NSUBJPASS = 29
|
641
|
-
|
642
|
-
# Numeric modifier of a noun
|
643
|
-
NUM = 30
|
644
|
-
|
645
|
-
# Element of compound number
|
646
|
-
NUMBER = 31
|
647
|
-
|
648
|
-
# Punctuation mark
|
649
|
-
P = 32
|
650
|
-
|
651
|
-
# Parataxis relation
|
652
|
-
PARATAXIS = 33
|
653
|
-
|
654
|
-
# Participial modifier
|
655
|
-
PARTMOD = 34
|
656
|
-
|
657
|
-
# The complement of a preposition is a clause
|
658
|
-
PCOMP = 35
|
659
|
-
|
660
|
-
# Object of a preposition
|
661
|
-
POBJ = 36
|
662
|
-
|
663
|
-
# Possession modifier
|
664
|
-
POSS = 37
|
665
|
-
|
666
|
-
# Postverbal negative particle
|
667
|
-
POSTNEG = 38
|
668
|
-
|
669
|
-
# Predicate complement
|
670
|
-
PRECOMP = 39
|
671
|
-
|
672
|
-
# Preconjunt
|
673
|
-
PRECONJ = 40
|
674
|
-
|
675
|
-
# Predeterminer
|
676
|
-
PREDET = 41
|
677
|
-
|
678
|
-
# Prefix
|
679
|
-
PREF = 42
|
680
|
-
|
681
|
-
# Prepositional modifier
|
682
|
-
PREP = 43
|
683
|
-
|
684
|
-
# The relationship between a verb and verbal morpheme
|
685
|
-
PRONL = 44
|
686
|
-
|
687
|
-
# Particle
|
688
|
-
PRT = 45
|
689
|
-
|
690
|
-
# Associative or possessive marker
|
691
|
-
PS = 46
|
692
|
-
|
693
|
-
# Quantifier phrase modifier
|
694
|
-
QUANTMOD = 47
|
695
|
-
|
696
|
-
# Relative clause modifier
|
697
|
-
RCMOD = 48
|
698
|
-
|
699
|
-
# Complementizer in relative clause
|
700
|
-
RCMODREL = 49
|
701
|
-
|
702
|
-
# Ellipsis without a preceding predicate
|
703
|
-
RDROP = 50
|
704
|
-
|
705
|
-
# Referent
|
706
|
-
REF = 51
|
707
|
-
|
708
|
-
# Remnant
|
709
|
-
REMNANT = 52
|
710
|
-
|
711
|
-
# Reparandum
|
712
|
-
REPARANDUM = 53
|
713
|
-
|
714
|
-
# Root
|
715
|
-
ROOT = 54
|
716
|
-
|
717
|
-
# Suffix specifying a unit of number
|
718
|
-
SNUM = 55
|
719
|
-
|
720
|
-
# Suffix
|
721
|
-
SUFF = 56
|
722
|
-
|
723
|
-
# Temporal modifier
|
724
|
-
TMOD = 57
|
725
|
-
|
726
|
-
# Topic marker
|
727
|
-
TOPIC = 58
|
728
|
-
|
729
|
-
# Clause headed by an infinite form of the verb that modifies a noun
|
730
|
-
VMOD = 59
|
731
|
-
|
732
|
-
# Vocative
|
733
|
-
VOCATIVE = 60
|
734
|
-
|
735
|
-
# Open clausal complement
|
736
|
-
XCOMP = 61
|
737
|
-
|
738
|
-
# Name suffix
|
739
|
-
SUFFIX = 62
|
740
|
-
|
741
|
-
# Name title
|
742
|
-
TITLE = 63
|
743
|
-
|
744
|
-
# Adverbial phrase modifier
|
745
|
-
ADVPHMOD = 64
|
746
|
-
|
747
|
-
# Causative auxiliary
|
748
|
-
AUXCAUS = 65
|
749
|
-
|
750
|
-
# Helper auxiliary
|
751
|
-
AUXVV = 66
|
752
|
-
|
753
|
-
# Rentaishi (Prenominal modifier)
|
754
|
-
DTMOD = 67
|
755
|
-
|
756
|
-
# Foreign words
|
757
|
-
FOREIGN = 68
|
758
|
-
|
759
|
-
# Keyword
|
760
|
-
KW = 69
|
761
|
-
|
762
|
-
# List for chains of comparable items
|
763
|
-
LIST = 70
|
764
|
-
|
765
|
-
# Nominalized clause
|
766
|
-
NOMC = 71
|
767
|
-
|
768
|
-
# Nominalized clausal subject
|
769
|
-
NOMCSUBJ = 72
|
770
|
-
|
771
|
-
# Nominalized clausal passive
|
772
|
-
NOMCSUBJPASS = 73
|
773
|
-
|
774
|
-
# Compound of numeric modifier
|
775
|
-
NUMC = 74
|
776
|
-
|
777
|
-
# Copula
|
778
|
-
COP = 75
|
779
|
-
|
780
|
-
# Dislocated relation (for fronted/topicalized elements)
|
781
|
-
DISLOCATED = 76
|
782
|
-
|
783
|
-
# Aspect marker
|
784
|
-
ASP = 77
|
785
|
-
|
786
|
-
# Genitive modifier
|
787
|
-
GMOD = 78
|
788
|
-
|
789
|
-
# Genitive object
|
790
|
-
GOBJ = 79
|
791
|
-
|
792
|
-
# Infinitival modifier
|
793
|
-
INFMOD = 80
|
794
|
-
|
795
|
-
# Measure
|
796
|
-
MES = 81
|
797
|
-
|
798
|
-
# Nominal complement of a noun
|
799
|
-
NCOMP = 82
|
800
|
-
end
|
801
|
-
end
|
802
|
-
|
803
|
-
# Represents a mention for an entity in the text. Currently, proper noun
|
804
|
-
# mentions are supported.
|
805
|
-
# @!attribute [rw] text
|
806
|
-
# @return [Google::Cloud::Language::V1::TextSpan]
|
807
|
-
# The mention text.
|
808
|
-
# @!attribute [rw] type
|
809
|
-
# @return [Google::Cloud::Language::V1::EntityMention::Type]
|
810
|
-
# The type of the entity mention.
|
811
|
-
# @!attribute [rw] sentiment
|
812
|
-
# @return [Google::Cloud::Language::V1::Sentiment]
|
813
|
-
# For calls to {AnalyzeEntitySentiment} or if
|
814
|
-
# {Google::Cloud::Language::V1::AnnotateTextRequest::Features#extract_entity_sentiment AnnotateTextRequest::Features#extract_entity_sentiment} is set to
|
815
|
-
# true, this field will contain the sentiment expressed for this mention of
|
816
|
-
# the entity in the provided document.
|
817
|
-
class EntityMention
|
818
|
-
# The supported types of mentions.
|
819
|
-
module Type
|
820
|
-
# Unknown
|
821
|
-
TYPE_UNKNOWN = 0
|
822
|
-
|
823
|
-
# Proper name
|
824
|
-
PROPER = 1
|
825
|
-
|
826
|
-
# Common noun (or noun compound)
|
827
|
-
COMMON = 2
|
828
|
-
end
|
829
|
-
end
|
830
|
-
|
831
|
-
# Represents an output piece of text.
|
832
|
-
# @!attribute [rw] content
|
833
|
-
# @return [String]
|
834
|
-
# The content of the output text.
|
835
|
-
# @!attribute [rw] begin_offset
|
836
|
-
# @return [Integer]
|
837
|
-
# The API calculates the beginning offset of the content in the original
|
838
|
-
# document according to the {Google::Cloud::Language::V1::EncodingType EncodingType} specified in the API request.
|
839
|
-
class TextSpan; end
|
840
|
-
|
841
|
-
# Represents a category returned from the text classifier.
|
842
|
-
# @!attribute [rw] name
|
843
|
-
# @return [String]
|
844
|
-
# The name of the category representing the document, from the [predefined
|
845
|
-
# taxonomy](/natural-language/docs/categories).
|
846
|
-
# @!attribute [rw] confidence
|
847
|
-
# @return [Float]
|
848
|
-
# The classifier's confidence of the category. Number represents how certain
|
849
|
-
# the classifier is that this category represents the given text.
|
850
|
-
class ClassificationCategory; end
|
851
|
-
|
852
|
-
# The sentiment analysis request message.
|
853
|
-
# @!attribute [rw] document
|
854
|
-
# @return [Google::Cloud::Language::V1::Document]
|
855
|
-
# Input document.
|
856
|
-
# @!attribute [rw] encoding_type
|
857
|
-
# @return [Google::Cloud::Language::V1::EncodingType]
|
858
|
-
# The encoding type used by the API to calculate sentence offsets.
|
859
|
-
class AnalyzeSentimentRequest; end
|
860
|
-
|
861
|
-
# The sentiment analysis response message.
|
862
|
-
# @!attribute [rw] document_sentiment
|
863
|
-
# @return [Google::Cloud::Language::V1::Sentiment]
|
864
|
-
# The overall sentiment of the input document.
|
865
|
-
# @!attribute [rw] language
|
866
|
-
# @return [String]
|
867
|
-
# The language of the text, which will be the same as the language specified
|
868
|
-
# in the request or, if not specified, the automatically-detected language.
|
869
|
-
# See {Google::Cloud::Language::V1::Document#language Document#language} field for more details.
|
870
|
-
# @!attribute [rw] sentences
|
871
|
-
# @return [Array<Google::Cloud::Language::V1::Sentence>]
|
872
|
-
# The sentiment for all the sentences in the document.
|
873
|
-
class AnalyzeSentimentResponse; end
|
874
|
-
|
875
|
-
# The entity-level sentiment analysis request message.
|
876
|
-
# @!attribute [rw] document
|
877
|
-
# @return [Google::Cloud::Language::V1::Document]
|
878
|
-
# Input document.
|
879
|
-
# @!attribute [rw] encoding_type
|
880
|
-
# @return [Google::Cloud::Language::V1::EncodingType]
|
881
|
-
# The encoding type used by the API to calculate offsets.
|
882
|
-
class AnalyzeEntitySentimentRequest; end
|
883
|
-
|
884
|
-
# The entity-level sentiment analysis response message.
|
885
|
-
# @!attribute [rw] entities
|
886
|
-
# @return [Array<Google::Cloud::Language::V1::Entity>]
|
887
|
-
# The recognized entities in the input document with associated sentiments.
|
888
|
-
# @!attribute [rw] language
|
889
|
-
# @return [String]
|
890
|
-
# The language of the text, which will be the same as the language specified
|
891
|
-
# in the request or, if not specified, the automatically-detected language.
|
892
|
-
# See {Google::Cloud::Language::V1::Document#language Document#language} field for more details.
|
893
|
-
class AnalyzeEntitySentimentResponse; end
|
894
|
-
|
895
|
-
# The entity analysis request message.
|
896
|
-
# @!attribute [rw] document
|
897
|
-
# @return [Google::Cloud::Language::V1::Document]
|
898
|
-
# Input document.
|
899
|
-
# @!attribute [rw] encoding_type
|
900
|
-
# @return [Google::Cloud::Language::V1::EncodingType]
|
901
|
-
# The encoding type used by the API to calculate offsets.
|
902
|
-
class AnalyzeEntitiesRequest; end
|
903
|
-
|
904
|
-
# The entity analysis response message.
|
905
|
-
# @!attribute [rw] entities
|
906
|
-
# @return [Array<Google::Cloud::Language::V1::Entity>]
|
907
|
-
# The recognized entities in the input document.
|
908
|
-
# @!attribute [rw] language
|
909
|
-
# @return [String]
|
910
|
-
# The language of the text, which will be the same as the language specified
|
911
|
-
# in the request or, if not specified, the automatically-detected language.
|
912
|
-
# See {Google::Cloud::Language::V1::Document#language Document#language} field for more details.
|
913
|
-
class AnalyzeEntitiesResponse; end
|
914
|
-
|
915
|
-
# The syntax analysis request message.
|
916
|
-
# @!attribute [rw] document
|
917
|
-
# @return [Google::Cloud::Language::V1::Document]
|
918
|
-
# Input document.
|
919
|
-
# @!attribute [rw] encoding_type
|
920
|
-
# @return [Google::Cloud::Language::V1::EncodingType]
|
921
|
-
# The encoding type used by the API to calculate offsets.
|
922
|
-
class AnalyzeSyntaxRequest; end
|
923
|
-
|
924
|
-
# The syntax analysis response message.
|
925
|
-
# @!attribute [rw] sentences
|
926
|
-
# @return [Array<Google::Cloud::Language::V1::Sentence>]
|
927
|
-
# Sentences in the input document.
|
928
|
-
# @!attribute [rw] tokens
|
929
|
-
# @return [Array<Google::Cloud::Language::V1::Token>]
|
930
|
-
# Tokens, along with their syntactic information, in the input document.
|
931
|
-
# @!attribute [rw] language
|
932
|
-
# @return [String]
|
933
|
-
# The language of the text, which will be the same as the language specified
|
934
|
-
# in the request or, if not specified, the automatically-detected language.
|
935
|
-
# See {Google::Cloud::Language::V1::Document#language Document#language} field for more details.
|
936
|
-
class AnalyzeSyntaxResponse; end
|
937
|
-
|
938
|
-
# The document classification request message.
|
939
|
-
# @!attribute [rw] document
|
940
|
-
# @return [Google::Cloud::Language::V1::Document]
|
941
|
-
# Input document.
|
942
|
-
class ClassifyTextRequest; end
|
943
|
-
|
944
|
-
# The document classification response message.
|
945
|
-
# @!attribute [rw] categories
|
946
|
-
# @return [Array<Google::Cloud::Language::V1::ClassificationCategory>]
|
947
|
-
# Categories representing the input document.
|
948
|
-
class ClassifyTextResponse; end
|
949
|
-
|
950
|
-
# The request message for the text annotation API, which can perform multiple
|
951
|
-
# analysis types (sentiment, entities, and syntax) in one call.
|
952
|
-
# @!attribute [rw] document
|
953
|
-
# @return [Google::Cloud::Language::V1::Document]
|
954
|
-
# Input document.
|
955
|
-
# @!attribute [rw] features
|
956
|
-
# @return [Google::Cloud::Language::V1::AnnotateTextRequest::Features]
|
957
|
-
# The enabled features.
|
958
|
-
# @!attribute [rw] encoding_type
|
959
|
-
# @return [Google::Cloud::Language::V1::EncodingType]
|
960
|
-
# The encoding type used by the API to calculate offsets.
|
961
|
-
class AnnotateTextRequest
|
962
|
-
# All available features for sentiment, syntax, and semantic analysis.
|
963
|
-
# Setting each one to true will enable that specific analysis for the input.
|
964
|
-
# @!attribute [rw] extract_syntax
|
965
|
-
# @return [true, false]
|
966
|
-
# Extract syntax information.
|
967
|
-
# @!attribute [rw] extract_entities
|
968
|
-
# @return [true, false]
|
969
|
-
# Extract entities.
|
970
|
-
# @!attribute [rw] extract_document_sentiment
|
971
|
-
# @return [true, false]
|
972
|
-
# Extract document-level sentiment.
|
973
|
-
# @!attribute [rw] extract_entity_sentiment
|
974
|
-
# @return [true, false]
|
975
|
-
# Extract entities and their associated sentiment.
|
976
|
-
# @!attribute [rw] classify_text
|
977
|
-
# @return [true, false]
|
978
|
-
# Classify the full document into categories.
|
979
|
-
class Features; end
|
980
|
-
end
|
981
|
-
|
982
|
-
# The text annotations response message.
|
983
|
-
# @!attribute [rw] sentences
|
984
|
-
# @return [Array<Google::Cloud::Language::V1::Sentence>]
|
985
|
-
# Sentences in the input document. Populated if the user enables
|
986
|
-
# {Google::Cloud::Language::V1::AnnotateTextRequest::Features#extract_syntax AnnotateTextRequest::Features#extract_syntax}.
|
987
|
-
# @!attribute [rw] tokens
|
988
|
-
# @return [Array<Google::Cloud::Language::V1::Token>]
|
989
|
-
# Tokens, along with their syntactic information, in the input document.
|
990
|
-
# Populated if the user enables
|
991
|
-
# {Google::Cloud::Language::V1::AnnotateTextRequest::Features#extract_syntax AnnotateTextRequest::Features#extract_syntax}.
|
992
|
-
# @!attribute [rw] entities
|
993
|
-
# @return [Array<Google::Cloud::Language::V1::Entity>]
|
994
|
-
# Entities, along with their semantic information, in the input document.
|
995
|
-
# Populated if the user enables
|
996
|
-
# {Google::Cloud::Language::V1::AnnotateTextRequest::Features#extract_entities AnnotateTextRequest::Features#extract_entities}.
|
997
|
-
# @!attribute [rw] document_sentiment
|
998
|
-
# @return [Google::Cloud::Language::V1::Sentiment]
|
999
|
-
# The overall sentiment for the document. Populated if the user enables
|
1000
|
-
# {Google::Cloud::Language::V1::AnnotateTextRequest::Features#extract_document_sentiment AnnotateTextRequest::Features#extract_document_sentiment}.
|
1001
|
-
# @!attribute [rw] language
|
1002
|
-
# @return [String]
|
1003
|
-
# The language of the text, which will be the same as the language specified
|
1004
|
-
# in the request or, if not specified, the automatically-detected language.
|
1005
|
-
# See {Google::Cloud::Language::V1::Document#language Document#language} field for more details.
|
1006
|
-
# @!attribute [rw] categories
|
1007
|
-
# @return [Array<Google::Cloud::Language::V1::ClassificationCategory>]
|
1008
|
-
# Categories identified in the input document.
|
1009
|
-
class AnnotateTextResponse; end
|
1010
|
-
|
1011
|
-
# Represents the text encoding that the caller uses to process the output.
|
1012
|
-
# Providing an `EncodingType` is recommended because the API provides the
|
1013
|
-
# beginning offsets for various outputs, such as tokens and mentions, and
|
1014
|
-
# languages that natively use different text encodings may access offsets
|
1015
|
-
# differently.
|
1016
|
-
module EncodingType
|
1017
|
-
# If `EncodingType` is not specified, encoding-dependent information (such as
|
1018
|
-
# `begin_offset`) will be set at `-1`.
|
1019
|
-
NONE = 0
|
1020
|
-
|
1021
|
-
# Encoding-dependent information (such as `begin_offset`) is calculated based
|
1022
|
-
# on the UTF-8 encoding of the input. C++ and Go are examples of languages
|
1023
|
-
# that use this encoding natively.
|
1024
|
-
UTF8 = 1
|
1025
|
-
|
1026
|
-
# Encoding-dependent information (such as `begin_offset`) is calculated based
|
1027
|
-
# on the UTF-16 encoding of the input. Java and JavaScript are examples of
|
1028
|
-
# languages that use this encoding natively.
|
1029
|
-
UTF16 = 2
|
1030
|
-
|
1031
|
-
# Encoding-dependent information (such as `begin_offset`) is calculated based
|
1032
|
-
# on the UTF-32 encoding of the input. Python is an example of a language
|
1033
|
-
# that uses this encoding natively.
|
1034
|
-
UTF32 = 3
|
1035
|
-
end
|
1036
|
-
end
|
1037
|
-
end
|
1038
|
-
end
|
1039
|
-
end
|