google-cloud-language 0.23.0 → 0.24.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/lib/google/cloud/language/annotation.rb +2 -2
- data/lib/google/cloud/language/convert.rb +35 -0
- data/lib/google/cloud/language/v1/doc/google/cloud/language/v1/language_service.rb +0 -23
- data/lib/google/cloud/language/v1/language_service_client_config.json +0 -2
- data/lib/google/cloud/language/version.rb +1 -1
- metadata +7 -48
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f4746ad71299b97d1c90269c16d10011255303e5
|
4
|
+
data.tar.gz: 38a1b60ef127d27c7272f580e83163ab4595f89b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: eb9797c45b158d81f825900385e9e06bfdd2e26974c6b007df8a4d84c5785b2db93b52de3f5b289c37e3a2b080b5a00626a7c1a8e8c29f84511910fe863a68be
|
7
|
+
data.tar.gz: 87d8d3b512ad3c3d9b8eac5d5323084a1b9188160972d2da14e585bdd6dfd38c73c682cadd5339ce676be2a5b2a6d825e71eb93a80cbd00a535b8cee437c1539
|
@@ -13,7 +13,7 @@
|
|
13
13
|
# limitations under the License.
|
14
14
|
|
15
15
|
|
16
|
-
require "google/cloud/
|
16
|
+
require "google/cloud/language/convert"
|
17
17
|
|
18
18
|
module Google
|
19
19
|
module Cloud
|
@@ -882,7 +882,7 @@ module Google
|
|
882
882
|
##
|
883
883
|
# @private New Entity from a V1::Entity object.
|
884
884
|
def self.from_grpc grpc
|
885
|
-
metadata =
|
885
|
+
metadata = Convert.map_to_hash grpc.metadata
|
886
886
|
mentions = Array(grpc.mentions).map do |g|
|
887
887
|
text_span = TextSpan.from_grpc g.text
|
888
888
|
Mention.new text_span, g.type
|
@@ -0,0 +1,35 @@
|
|
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
|
+
|
16
|
+
module Google
|
17
|
+
module Cloud
|
18
|
+
module Language
|
19
|
+
##
|
20
|
+
# @private Conversion to/from Language GRPC objects.
|
21
|
+
module Convert
|
22
|
+
##
|
23
|
+
# @private Convert a Google::Protobuf::Map to a Hash
|
24
|
+
def self.map_to_hash map
|
25
|
+
if map.respond_to? :to_h
|
26
|
+
map.to_h
|
27
|
+
else
|
28
|
+
# Enumerable doesn't have to_h on ruby 2.0...
|
29
|
+
Hash[map.to_a]
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
@@ -15,29 +15,6 @@
|
|
15
15
|
module Google
|
16
16
|
module Cloud
|
17
17
|
module Language
|
18
|
-
##
|
19
|
-
# The `Google::Cloud::Language::V1` module provides the following types:
|
20
|
-
#
|
21
|
-
# Class | Description
|
22
|
-
# ----- | -----------
|
23
|
-
# {Google::Cloud::Language::V1::AnalyzeEntitiesRequest} | The entity analysis request message.
|
24
|
-
# {Google::Cloud::Language::V1::AnalyzeEntitiesResponse} | The entity analysis response message.
|
25
|
-
# {Google::Cloud::Language::V1::AnalyzeSentimentRequest} | The sentiment analysis request message.
|
26
|
-
# {Google::Cloud::Language::V1::AnalyzeSentimentResponse} | The sentiment analysis response message.
|
27
|
-
# {Google::Cloud::Language::V1::AnalyzeSyntaxRequest} | The syntax analysis request message.
|
28
|
-
# {Google::Cloud::Language::V1::AnalyzeSyntaxResponse} | The syntax analysis response message.
|
29
|
-
# {Google::Cloud::Language::V1::AnnotateTextRequest} | The request message for the text annotation API, which can perform multiple analysis types (sentiment, entities, and syntax) in one call.
|
30
|
-
# {Google::Cloud::Language::V1::AnnotateTextRequest::Features} | All available features for sentiment, syntax, and semantic analysis.
|
31
|
-
# {Google::Cloud::Language::V1::DependencyEdge} | Represents dependency parse tree information for a token.
|
32
|
-
# {Google::Cloud::Language::V1::EncodingType} | Represents the text encoding that the caller uses to process the output.
|
33
|
-
# {Google::Cloud::Language::V1::Entity} | Represents a phrase in the text that is a known entity, such as a person, an organization, or location.
|
34
|
-
# {Google::Cloud::Language::V1::EntityMention} | Represents a mention for an entity in the text.
|
35
|
-
# {Google::Cloud::Language::V1::PartOfSpeech} | Represents part of speech information for a token.
|
36
|
-
# {Google::Cloud::Language::V1::Sentence} | Represents a sentence in the input document.
|
37
|
-
# {Google::Cloud::Language::V1::Sentiment} | Represents the feeling associated with the entire text or entities in the text.
|
38
|
-
# {Google::Cloud::Language::V1::TextSpan} | Represents an output piece of text.
|
39
|
-
# {Google::Cloud::Language::V1::Token} | Represents the smallest syntactic building block of the text.
|
40
|
-
#
|
41
18
|
module V1
|
42
19
|
# ================================================================ #
|
43
20
|
#
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: google-cloud-language
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.24.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mike Moore
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2017-
|
12
|
+
date: 2017-02-21 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: google-cloud-core
|
@@ -25,76 +25,34 @@ dependencies:
|
|
25
25
|
- - "~>"
|
26
26
|
- !ruby/object:Gem::Version
|
27
27
|
version: 0.21.0
|
28
|
-
- !ruby/object:Gem::Dependency
|
29
|
-
name: grpc
|
30
|
-
requirement: !ruby/object:Gem::Requirement
|
31
|
-
requirements:
|
32
|
-
- - "~>"
|
33
|
-
- !ruby/object:Gem::Version
|
34
|
-
version: '1.0'
|
35
|
-
type: :runtime
|
36
|
-
prerelease: false
|
37
|
-
version_requirements: !ruby/object:Gem::Requirement
|
38
|
-
requirements:
|
39
|
-
- - "~>"
|
40
|
-
- !ruby/object:Gem::Version
|
41
|
-
version: '1.0'
|
42
28
|
- !ruby/object:Gem::Dependency
|
43
29
|
name: google-gax
|
44
30
|
requirement: !ruby/object:Gem::Requirement
|
45
31
|
requirements:
|
46
32
|
- - "~>"
|
47
33
|
- !ruby/object:Gem::Version
|
48
|
-
version: 0.
|
49
|
-
type: :runtime
|
50
|
-
prerelease: false
|
51
|
-
version_requirements: !ruby/object:Gem::Requirement
|
52
|
-
requirements:
|
53
|
-
- - "~>"
|
54
|
-
- !ruby/object:Gem::Version
|
55
|
-
version: 0.6.0
|
56
|
-
- !ruby/object:Gem::Dependency
|
57
|
-
name: google-protobuf
|
58
|
-
requirement: !ruby/object:Gem::Requirement
|
59
|
-
requirements:
|
60
|
-
- - "~>"
|
61
|
-
- !ruby/object:Gem::Version
|
62
|
-
version: '3.0'
|
63
|
-
type: :runtime
|
64
|
-
prerelease: false
|
65
|
-
version_requirements: !ruby/object:Gem::Requirement
|
66
|
-
requirements:
|
67
|
-
- - "~>"
|
68
|
-
- !ruby/object:Gem::Version
|
69
|
-
version: '3.0'
|
70
|
-
- !ruby/object:Gem::Dependency
|
71
|
-
name: googleapis-common-protos
|
72
|
-
requirement: !ruby/object:Gem::Requirement
|
73
|
-
requirements:
|
74
|
-
- - "~>"
|
75
|
-
- !ruby/object:Gem::Version
|
76
|
-
version: '1.3'
|
34
|
+
version: 0.8.0
|
77
35
|
type: :runtime
|
78
36
|
prerelease: false
|
79
37
|
version_requirements: !ruby/object:Gem::Requirement
|
80
38
|
requirements:
|
81
39
|
- - "~>"
|
82
40
|
- !ruby/object:Gem::Version
|
83
|
-
version:
|
41
|
+
version: 0.8.0
|
84
42
|
- !ruby/object:Gem::Dependency
|
85
43
|
name: minitest
|
86
44
|
requirement: !ruby/object:Gem::Requirement
|
87
45
|
requirements:
|
88
46
|
- - "~>"
|
89
47
|
- !ruby/object:Gem::Version
|
90
|
-
version: '5.
|
48
|
+
version: '5.10'
|
91
49
|
type: :development
|
92
50
|
prerelease: false
|
93
51
|
version_requirements: !ruby/object:Gem::Requirement
|
94
52
|
requirements:
|
95
53
|
- - "~>"
|
96
54
|
- !ruby/object:Gem::Version
|
97
|
-
version: '5.
|
55
|
+
version: '5.10'
|
98
56
|
- !ruby/object:Gem::Dependency
|
99
57
|
name: minitest-autotest
|
100
58
|
requirement: !ruby/object:Gem::Requirement
|
@@ -222,6 +180,7 @@ files:
|
|
222
180
|
- lib/google-cloud-language.rb
|
223
181
|
- lib/google/cloud/language.rb
|
224
182
|
- lib/google/cloud/language/annotation.rb
|
183
|
+
- lib/google/cloud/language/convert.rb
|
225
184
|
- lib/google/cloud/language/credentials.rb
|
226
185
|
- lib/google/cloud/language/document.rb
|
227
186
|
- lib/google/cloud/language/project.rb
|