cloudmersive-nlp-api-client 2.0.6 → 2.0.7

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 246a67c5ed5ac6e1f87cb9c909ab67fd333d403e29f586337e4b3811f4d50a39
4
- data.tar.gz: 9c5b93723080d6dbd283652d2bdd95bdf01a87e54227f0def19443df75756fcd
3
+ metadata.gz: 8c0eaaeb4e04854092863a69111f7a1e3ca0d0466967b6a70b022df0265dd2b6
4
+ data.tar.gz: f1e72c1d03e2c581adaf781b858bd3edb4d4937efd02aebb25debab0b4ab8ac9
5
5
  SHA512:
6
- metadata.gz: 4e58d407f9668bef355e4dff7b1355e0452a7816beae84b3f6b2cb8c181e655b9604de63f1f6ad9b82e7c1d1ab4c686cd654dfa4f636485da1c58d035cb16c11
7
- data.tar.gz: ba3d52454818d717e9fb163df9bb49fe613f1cbe29397575330e0f313711bc52ebe0c863362ea092cbe7da1379df4217d301b7a2758ca41d2c9c3e94109c173a
6
+ metadata.gz: 92f797b91d75a0d6e4cbe9d1012970e93ab2aef55af9b7049603c4eefde6f8287e272eab675fa128f3e0e792ec45020741af13d9d6aa9210c2bb916c79ba295a
7
+ data.tar.gz: e1aa218875eaa7b86abff3ff29e45a3c4835a34c53783dd58e41c78a956611ae4f56cb66a69b76fc290ba441bf03358a8b13590b14f1685d0d3b34abb4856fba
data/README.md CHANGED
@@ -7,7 +7,7 @@ The powerful Natural Language Processing APIs (v2) let you perform part of speec
7
7
  This SDK is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project:
8
8
 
9
9
  - API version: v1
10
- - Package version: 2.0.6
10
+ - Package version: 2.0.7
11
11
  - Build package: io.swagger.codegen.languages.RubyClientCodegen
12
12
 
13
13
  ## Installation
@@ -23,15 +23,15 @@ gem build cloudmersive-nlp-api-client.gemspec
23
23
  Then either install the gem locally:
24
24
 
25
25
  ```shell
26
- gem install ./cloudmersive-nlp-api-client-2.0.6.gem
26
+ gem install ./cloudmersive-nlp-api-client-2.0.7.gem
27
27
  ```
28
- (for development, run `gem install --dev ./cloudmersive-nlp-api-client-2.0.6.gem` to install the development dependencies)
28
+ (for development, run `gem install --dev ./cloudmersive-nlp-api-client-2.0.7.gem` to install the development dependencies)
29
29
 
30
30
  or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/).
31
31
 
32
32
  Finally add this to the Gemfile:
33
33
 
34
- gem 'cloudmersive-nlp-api-client', '~> 2.0.6'
34
+ gem 'cloudmersive-nlp-api-client', '~> 2.0.7'
35
35
 
36
36
  ### Install from Git
37
37
 
@@ -85,6 +85,7 @@ Class | Method | HTTP request | Description
85
85
  ------------ | ------------- | ------------- | -------------
86
86
  *CloudmersiveNlpApiClient::AnalyticsApi* | [**analytics_profanity**](docs/AnalyticsApi.md#analytics_profanity) | **POST** /nlp-v2/analytics/profanity | Perform Profanity and Obscene Language Analysis and Detection on Text
87
87
  *CloudmersiveNlpApiClient::AnalyticsApi* | [**analytics_sentiment**](docs/AnalyticsApi.md#analytics_sentiment) | **POST** /nlp-v2/analytics/sentiment | Perform Sentiment Analysis and Classification on Text
88
+ *CloudmersiveNlpApiClient::AnalyticsApi* | [**analytics_subjectivity**](docs/AnalyticsApi.md#analytics_subjectivity) | **POST** /nlp-v2/analytics/subjectivity | Perform Subjectivity and Objectivity Analysis on Text
88
89
  *CloudmersiveNlpApiClient::ExtractEntitiesApi* | [**extract_entities_post**](docs/ExtractEntitiesApi.md#extract_entities_post) | **POST** /nlp-v2/extract-entities | Extract entities from string
89
90
  *CloudmersiveNlpApiClient::LanguageDetectionApi* | [**language_detection_get_language**](docs/LanguageDetectionApi.md#language_detection_get_language) | **POST** /nlp-v2/language/detect | Detect language of text
90
91
  *CloudmersiveNlpApiClient::LanguageTranslationApi* | [**language_translation_translate_deu_to_eng**](docs/LanguageTranslationApi.md#language_translation_translate_deu_to_eng) | **POST** /nlp-v2/translate/language/deu/to/eng | Translate German to English text with Deep Learning AI
@@ -98,7 +99,7 @@ Class | Method | HTTP request | Description
98
99
  *CloudmersiveNlpApiClient::PosTaggerApi* | [**pos_tagger_tag_pronouns**](docs/PosTaggerApi.md#pos_tagger_tag_pronouns) | **POST** /nlp-v2/pos/tag/pronouns | Part-of-speech tag a string, filter to pronouns
99
100
  *CloudmersiveNlpApiClient::PosTaggerApi* | [**pos_tagger_tag_sentence**](docs/PosTaggerApi.md#pos_tagger_tag_sentence) | **POST** /nlp-v2/pos/tag/sentence | Part-of-speech tag a string
100
101
  *CloudmersiveNlpApiClient::PosTaggerApi* | [**pos_tagger_tag_verbs**](docs/PosTaggerApi.md#pos_tagger_tag_verbs) | **POST** /nlp-v2/pos/tag/verbs | Part-of-speech tag a string, filter to verbs
101
- *CloudmersiveNlpApiClient::RephraseApi* | [**rephrase_translate_deu_to_eng**](docs/RephraseApi.md#rephrase_translate_deu_to_eng) | **POST** /nlp-v2/rephrase/rephrase/eng/by-sentence | Rephrase, paraphrase English text sentence-by-sentence using Deep Learning AI
102
+ *CloudmersiveNlpApiClient::RephraseApi* | [**rephrase_english_rephrase_sentence_by_sentence**](docs/RephraseApi.md#rephrase_english_rephrase_sentence_by_sentence) | **POST** /nlp-v2/rephrase/rephrase/eng/by-sentence | Rephrase, paraphrase English text sentence-by-sentence using Deep Learning AI
102
103
  *CloudmersiveNlpApiClient::SegmentationApi* | [**segmentation_get_sentences**](docs/SegmentationApi.md#segmentation_get_sentences) | **POST** /nlp-v2/segmentation/sentences | Extract sentences from string
103
104
  *CloudmersiveNlpApiClient::SegmentationApi* | [**segmentation_get_words**](docs/SegmentationApi.md#segmentation_get_words) | **POST** /nlp-v2/segmentation/words | Get words in input string
104
105
  *CloudmersiveNlpApiClient::SpellcheckApi* | [**spellcheck_check_sentence**](docs/SpellcheckApi.md#spellcheck_check_sentence) | **POST** /nlp-v2/spellcheck/check/sentence | Check if sentence is spelled correctly
@@ -137,6 +138,8 @@ Class | Method | HTTP request | Description
137
138
  - [CloudmersiveNlpApiClient::SentenceSegmentationResponse](docs/SentenceSegmentationResponse.md)
138
139
  - [CloudmersiveNlpApiClient::SentimentAnalysisRequest](docs/SentimentAnalysisRequest.md)
139
140
  - [CloudmersiveNlpApiClient::SentimentAnalysisResponse](docs/SentimentAnalysisResponse.md)
141
+ - [CloudmersiveNlpApiClient::SubjectivityAnalysisRequest](docs/SubjectivityAnalysisRequest.md)
142
+ - [CloudmersiveNlpApiClient::SubjectivityAnalysisResponse](docs/SubjectivityAnalysisResponse.md)
140
143
  - [CloudmersiveNlpApiClient::WordPosition](docs/WordPosition.md)
141
144
 
142
145
 
@@ -6,6 +6,7 @@ Method | HTTP request | Description
6
6
  ------------- | ------------- | -------------
7
7
  [**analytics_profanity**](AnalyticsApi.md#analytics_profanity) | **POST** /nlp-v2/analytics/profanity | Perform Profanity and Obscene Language Analysis and Detection on Text
8
8
  [**analytics_sentiment**](AnalyticsApi.md#analytics_sentiment) | **POST** /nlp-v2/analytics/sentiment | Perform Sentiment Analysis and Classification on Text
9
+ [**analytics_subjectivity**](AnalyticsApi.md#analytics_subjectivity) | **POST** /nlp-v2/analytics/subjectivity | Perform Subjectivity and Objectivity Analysis on Text
9
10
 
10
11
 
11
12
  # **analytics_profanity**
@@ -116,3 +117,57 @@ Name | Type | Description | Notes
116
117
 
117
118
 
118
119
 
120
+ # **analytics_subjectivity**
121
+ > SubjectivityAnalysisResponse analytics_subjectivity(input)
122
+
123
+ Perform Subjectivity and Objectivity Analysis on Text
124
+
125
+ Analyze input text using advanced Subjectivity and Objectivity Language Analysis to determine if the input text is objective or subjective, and how much. Supports English language input. Consumes 1-2 API calls per sentence.
126
+
127
+ ### Example
128
+ ```ruby
129
+ # load the gem
130
+ require 'cloudmersive-nlp-api-client'
131
+ # setup authorization
132
+ CloudmersiveNlpApiClient.configure do |config|
133
+ # Configure API key authorization: Apikey
134
+ config.api_key['Apikey'] = 'YOUR API KEY'
135
+ # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
136
+ #config.api_key_prefix['Apikey'] = 'Bearer'
137
+ end
138
+
139
+ api_instance = CloudmersiveNlpApiClient::AnalyticsApi.new
140
+
141
+ input = CloudmersiveNlpApiClient::SubjectivityAnalysisRequest.new # SubjectivityAnalysisRequest | Input subjectivity analysis request
142
+
143
+
144
+ begin
145
+ #Perform Subjectivity and Objectivity Analysis on Text
146
+ result = api_instance.analytics_subjectivity(input)
147
+ p result
148
+ rescue CloudmersiveNlpApiClient::ApiError => e
149
+ puts "Exception when calling AnalyticsApi->analytics_subjectivity: #{e}"
150
+ end
151
+ ```
152
+
153
+ ### Parameters
154
+
155
+ Name | Type | Description | Notes
156
+ ------------- | ------------- | ------------- | -------------
157
+ **input** | [**SubjectivityAnalysisRequest**](SubjectivityAnalysisRequest.md)| Input subjectivity analysis request |
158
+
159
+ ### Return type
160
+
161
+ [**SubjectivityAnalysisResponse**](SubjectivityAnalysisResponse.md)
162
+
163
+ ### Authorization
164
+
165
+ [Apikey](../README.md#Apikey)
166
+
167
+ ### HTTP request headers
168
+
169
+ - **Content-Type**: application/json, text/json, application/xml, text/xml, application/x-www-form-urlencoded
170
+ - **Accept**: application/json, text/json, application/xml, text/xml
171
+
172
+
173
+
@@ -4,11 +4,11 @@ All URIs are relative to *https://api.cloudmersive.com*
4
4
 
5
5
  Method | HTTP request | Description
6
6
  ------------- | ------------- | -------------
7
- [**rephrase_translate_deu_to_eng**](RephraseApi.md#rephrase_translate_deu_to_eng) | **POST** /nlp-v2/rephrase/rephrase/eng/by-sentence | Rephrase, paraphrase English text sentence-by-sentence using Deep Learning AI
7
+ [**rephrase_english_rephrase_sentence_by_sentence**](RephraseApi.md#rephrase_english_rephrase_sentence_by_sentence) | **POST** /nlp-v2/rephrase/rephrase/eng/by-sentence | Rephrase, paraphrase English text sentence-by-sentence using Deep Learning AI
8
8
 
9
9
 
10
- # **rephrase_translate_deu_to_eng**
11
- > RephraseResponse rephrase_translate_deu_to_eng(input)
10
+ # **rephrase_english_rephrase_sentence_by_sentence**
11
+ > RephraseResponse rephrase_english_rephrase_sentence_by_sentence(input)
12
12
 
13
13
  Rephrase, paraphrase English text sentence-by-sentence using Deep Learning AI
14
14
 
@@ -33,10 +33,10 @@ input = CloudmersiveNlpApiClient::RephraseRequest.new # RephraseRequest | Input
33
33
 
34
34
  begin
35
35
  #Rephrase, paraphrase English text sentence-by-sentence using Deep Learning AI
36
- result = api_instance.rephrase_translate_deu_to_eng(input)
36
+ result = api_instance.rephrase_english_rephrase_sentence_by_sentence(input)
37
37
  p result
38
38
  rescue CloudmersiveNlpApiClient::ApiError => e
39
- puts "Exception when calling RephraseApi->rephrase_translate_deu_to_eng: #{e}"
39
+ puts "Exception when calling RephraseApi->rephrase_english_rephrase_sentence_by_sentence: #{e}"
40
40
  end
41
41
  ```
42
42
 
@@ -0,0 +1,8 @@
1
+ # CloudmersiveNlpApiClient::SubjectivityAnalysisRequest
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **text_to_analyze** | **String** | Text to analyze | [optional]
7
+
8
+
@@ -0,0 +1,10 @@
1
+ # CloudmersiveNlpApiClient::SubjectivityAnalysisResponse
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **successful** | **BOOLEAN** | True if the subjectivity analysis operation was successful, false otherwise | [optional]
7
+ **subjectivity_score_result** | **Float** | Subjectivity vs. objectivity classification score between 0.0 and 1.0 where scores closer to zero have a high probability of objectivity, while scores close to 1.0 have a high probability of subjectivity. | [optional]
8
+ **sentence_count** | **Integer** | Number of sentences in input text | [optional]
9
+
10
+
@@ -47,6 +47,8 @@ require 'cloudmersive-nlp-api-client/models/sentence_segmentation_request'
47
47
  require 'cloudmersive-nlp-api-client/models/sentence_segmentation_response'
48
48
  require 'cloudmersive-nlp-api-client/models/sentiment_analysis_request'
49
49
  require 'cloudmersive-nlp-api-client/models/sentiment_analysis_response'
50
+ require 'cloudmersive-nlp-api-client/models/subjectivity_analysis_request'
51
+ require 'cloudmersive-nlp-api-client/models/subjectivity_analysis_response'
50
52
  require 'cloudmersive-nlp-api-client/models/word_position'
51
53
 
52
54
  # APIs
@@ -129,5 +129,60 @@ module CloudmersiveNlpApiClient
129
129
  end
130
130
  return data, status_code, headers
131
131
  end
132
+
133
+ # Perform Subjectivity and Objectivity Analysis on Text
134
+ # Analyze input text using advanced Subjectivity and Objectivity Language Analysis to determine if the input text is objective or subjective, and how much. Supports English language input. Consumes 1-2 API calls per sentence.
135
+ # @param input Input subjectivity analysis request
136
+ # @param [Hash] opts the optional parameters
137
+ # @return [SubjectivityAnalysisResponse]
138
+ def analytics_subjectivity(input, opts = {})
139
+ data, _status_code, _headers = analytics_subjectivity_with_http_info(input, opts)
140
+ return data
141
+ end
142
+
143
+ # Perform Subjectivity and Objectivity Analysis on Text
144
+ # Analyze input text using advanced Subjectivity and Objectivity Language Analysis to determine if the input text is objective or subjective, and how much. Supports English language input. Consumes 1-2 API calls per sentence.
145
+ # @param input Input subjectivity analysis request
146
+ # @param [Hash] opts the optional parameters
147
+ # @return [Array<(SubjectivityAnalysisResponse, Fixnum, Hash)>] SubjectivityAnalysisResponse data, response status code and response headers
148
+ def analytics_subjectivity_with_http_info(input, opts = {})
149
+ if @api_client.config.debugging
150
+ @api_client.config.logger.debug "Calling API: AnalyticsApi.analytics_subjectivity ..."
151
+ end
152
+ # verify the required parameter 'input' is set
153
+ if @api_client.config.client_side_validation && input.nil?
154
+ fail ArgumentError, "Missing the required parameter 'input' when calling AnalyticsApi.analytics_subjectivity"
155
+ end
156
+ # resource path
157
+ local_var_path = "/nlp-v2/analytics/subjectivity"
158
+
159
+ # query parameters
160
+ query_params = {}
161
+
162
+ # header parameters
163
+ header_params = {}
164
+ # HTTP header 'Accept' (if needed)
165
+ header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/json', 'application/xml', 'text/xml'])
166
+ # HTTP header 'Content-Type'
167
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'text/json', 'application/xml', 'text/xml', 'application/x-www-form-urlencoded'])
168
+
169
+ # form parameters
170
+ form_params = {}
171
+
172
+ # http body (model)
173
+ post_body = @api_client.object_to_http_body(input)
174
+ auth_names = ['Apikey']
175
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
176
+ :header_params => header_params,
177
+ :query_params => query_params,
178
+ :form_params => form_params,
179
+ :body => post_body,
180
+ :auth_names => auth_names,
181
+ :return_type => 'SubjectivityAnalysisResponse')
182
+ if @api_client.config.debugging
183
+ @api_client.config.logger.debug "API called: AnalyticsApi#analytics_subjectivity\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
184
+ end
185
+ return data, status_code, headers
186
+ end
132
187
  end
133
188
  end
@@ -25,8 +25,8 @@ module CloudmersiveNlpApiClient
25
25
  # @param input Input rephrase request
26
26
  # @param [Hash] opts the optional parameters
27
27
  # @return [RephraseResponse]
28
- def rephrase_translate_deu_to_eng(input, opts = {})
29
- data, _status_code, _headers = rephrase_translate_deu_to_eng_with_http_info(input, opts)
28
+ def rephrase_english_rephrase_sentence_by_sentence(input, opts = {})
29
+ data, _status_code, _headers = rephrase_english_rephrase_sentence_by_sentence_with_http_info(input, opts)
30
30
  return data
31
31
  end
32
32
 
@@ -35,13 +35,13 @@ module CloudmersiveNlpApiClient
35
35
  # @param input Input rephrase request
36
36
  # @param [Hash] opts the optional parameters
37
37
  # @return [Array<(RephraseResponse, Fixnum, Hash)>] RephraseResponse data, response status code and response headers
38
- def rephrase_translate_deu_to_eng_with_http_info(input, opts = {})
38
+ def rephrase_english_rephrase_sentence_by_sentence_with_http_info(input, opts = {})
39
39
  if @api_client.config.debugging
40
- @api_client.config.logger.debug "Calling API: RephraseApi.rephrase_translate_deu_to_eng ..."
40
+ @api_client.config.logger.debug "Calling API: RephraseApi.rephrase_english_rephrase_sentence_by_sentence ..."
41
41
  end
42
42
  # verify the required parameter 'input' is set
43
43
  if @api_client.config.client_side_validation && input.nil?
44
- fail ArgumentError, "Missing the required parameter 'input' when calling RephraseApi.rephrase_translate_deu_to_eng"
44
+ fail ArgumentError, "Missing the required parameter 'input' when calling RephraseApi.rephrase_english_rephrase_sentence_by_sentence"
45
45
  end
46
46
  # resource path
47
47
  local_var_path = "/nlp-v2/rephrase/rephrase/eng/by-sentence"
@@ -70,7 +70,7 @@ module CloudmersiveNlpApiClient
70
70
  :auth_names => auth_names,
71
71
  :return_type => 'RephraseResponse')
72
72
  if @api_client.config.debugging
73
- @api_client.config.logger.debug "API called: RephraseApi#rephrase_translate_deu_to_eng\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
73
+ @api_client.config.logger.debug "API called: RephraseApi#rephrase_english_rephrase_sentence_by_sentence\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
74
74
  end
75
75
  return data, status_code, headers
76
76
  end
@@ -0,0 +1,189 @@
1
+ =begin
2
+ #nlpapiv2
3
+
4
+ #The powerful Natural Language Processing APIs (v2) let you perform part of speech tagging, entity identification, sentence parsing, and much more to help you understand the meaning of unstructured text.
5
+
6
+ OpenAPI spec version: v1
7
+
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.3.1
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module CloudmersiveNlpApiClient
16
+ # Input to a subjectivity analysis operation
17
+ class SubjectivityAnalysisRequest
18
+ # Text to analyze
19
+ attr_accessor :text_to_analyze
20
+
21
+
22
+ # Attribute mapping from ruby-style variable name to JSON key.
23
+ def self.attribute_map
24
+ {
25
+ :'text_to_analyze' => :'TextToAnalyze'
26
+ }
27
+ end
28
+
29
+ # Attribute type mapping.
30
+ def self.swagger_types
31
+ {
32
+ :'text_to_analyze' => :'String'
33
+ }
34
+ end
35
+
36
+ # Initializes the object
37
+ # @param [Hash] attributes Model attributes in the form of hash
38
+ def initialize(attributes = {})
39
+ return unless attributes.is_a?(Hash)
40
+
41
+ # convert string to symbol for hash key
42
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
43
+
44
+ if attributes.has_key?(:'TextToAnalyze')
45
+ self.text_to_analyze = attributes[:'TextToAnalyze']
46
+ end
47
+
48
+ end
49
+
50
+ # Show invalid properties with the reasons. Usually used together with valid?
51
+ # @return Array for valid properties with the reasons
52
+ def list_invalid_properties
53
+ invalid_properties = Array.new
54
+ return invalid_properties
55
+ end
56
+
57
+ # Check to see if the all the properties in the model are valid
58
+ # @return true if the model is valid
59
+ def valid?
60
+ return true
61
+ end
62
+
63
+ # Checks equality by comparing each attribute.
64
+ # @param [Object] Object to be compared
65
+ def ==(o)
66
+ return true if self.equal?(o)
67
+ self.class == o.class &&
68
+ text_to_analyze == o.text_to_analyze
69
+ end
70
+
71
+ # @see the `==` method
72
+ # @param [Object] Object to be compared
73
+ def eql?(o)
74
+ self == o
75
+ end
76
+
77
+ # Calculates hash code according to all attributes.
78
+ # @return [Fixnum] Hash code
79
+ def hash
80
+ [text_to_analyze].hash
81
+ end
82
+
83
+ # Builds the object from hash
84
+ # @param [Hash] attributes Model attributes in the form of hash
85
+ # @return [Object] Returns the model itself
86
+ def build_from_hash(attributes)
87
+ return nil unless attributes.is_a?(Hash)
88
+ self.class.swagger_types.each_pair do |key, type|
89
+ if type =~ /\AArray<(.*)>/i
90
+ # check to ensure the input is an array given that the the attribute
91
+ # is documented as an array but the input is not
92
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
93
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
94
+ end
95
+ elsif !attributes[self.class.attribute_map[key]].nil?
96
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
97
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
98
+ end
99
+
100
+ self
101
+ end
102
+
103
+ # Deserializes the data based on type
104
+ # @param string type Data type
105
+ # @param string value Value to be deserialized
106
+ # @return [Object] Deserialized data
107
+ def _deserialize(type, value)
108
+ case type.to_sym
109
+ when :DateTime
110
+ DateTime.parse(value)
111
+ when :Date
112
+ Date.parse(value)
113
+ when :String
114
+ value.to_s
115
+ when :Integer
116
+ value.to_i
117
+ when :Float
118
+ value.to_f
119
+ when :BOOLEAN
120
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
121
+ true
122
+ else
123
+ false
124
+ end
125
+ when :Object
126
+ # generic object (usually a Hash), return directly
127
+ value
128
+ when /\AArray<(?<inner_type>.+)>\z/
129
+ inner_type = Regexp.last_match[:inner_type]
130
+ value.map { |v| _deserialize(inner_type, v) }
131
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
132
+ k_type = Regexp.last_match[:k_type]
133
+ v_type = Regexp.last_match[:v_type]
134
+ {}.tap do |hash|
135
+ value.each do |k, v|
136
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
137
+ end
138
+ end
139
+ else # model
140
+ temp_model = CloudmersiveNlpApiClient.const_get(type).new
141
+ temp_model.build_from_hash(value)
142
+ end
143
+ end
144
+
145
+ # Returns the string representation of the object
146
+ # @return [String] String presentation of the object
147
+ def to_s
148
+ to_hash.to_s
149
+ end
150
+
151
+ # to_body is an alias to to_hash (backward compatibility)
152
+ # @return [Hash] Returns the object in the form of hash
153
+ def to_body
154
+ to_hash
155
+ end
156
+
157
+ # Returns the object in the form of hash
158
+ # @return [Hash] Returns the object in the form of hash
159
+ def to_hash
160
+ hash = {}
161
+ self.class.attribute_map.each_pair do |attr, param|
162
+ value = self.send(attr)
163
+ next if value.nil?
164
+ hash[param] = _to_hash(value)
165
+ end
166
+ hash
167
+ end
168
+
169
+ # Outputs non-array value in the form of hash
170
+ # For object, use to_hash. Otherwise, just return the value
171
+ # @param [Object] value Any valid value
172
+ # @return [Hash] Returns the value in the form of hash
173
+ def _to_hash(value)
174
+ if value.is_a?(Array)
175
+ value.compact.map{ |v| _to_hash(v) }
176
+ elsif value.is_a?(Hash)
177
+ {}.tap do |hash|
178
+ value.each { |k, v| hash[k] = _to_hash(v) }
179
+ end
180
+ elsif value.respond_to? :to_hash
181
+ value.to_hash
182
+ else
183
+ value
184
+ end
185
+ end
186
+
187
+ end
188
+
189
+ end
@@ -0,0 +1,209 @@
1
+ =begin
2
+ #nlpapiv2
3
+
4
+ #The powerful Natural Language Processing APIs (v2) let you perform part of speech tagging, entity identification, sentence parsing, and much more to help you understand the meaning of unstructured text.
5
+
6
+ OpenAPI spec version: v1
7
+
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.3.1
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module CloudmersiveNlpApiClient
16
+ # Output of a subjectivity analysis operation
17
+ class SubjectivityAnalysisResponse
18
+ # True if the subjectivity analysis operation was successful, false otherwise
19
+ attr_accessor :successful
20
+
21
+ # Subjectivity vs. objectivity classification score between 0.0 and 1.0 where scores closer to zero have a high probability of objectivity, while scores close to 1.0 have a high probability of subjectivity.
22
+ attr_accessor :subjectivity_score_result
23
+
24
+ # Number of sentences in input text
25
+ attr_accessor :sentence_count
26
+
27
+
28
+ # Attribute mapping from ruby-style variable name to JSON key.
29
+ def self.attribute_map
30
+ {
31
+ :'successful' => :'Successful',
32
+ :'subjectivity_score_result' => :'SubjectivityScoreResult',
33
+ :'sentence_count' => :'SentenceCount'
34
+ }
35
+ end
36
+
37
+ # Attribute type mapping.
38
+ def self.swagger_types
39
+ {
40
+ :'successful' => :'BOOLEAN',
41
+ :'subjectivity_score_result' => :'Float',
42
+ :'sentence_count' => :'Integer'
43
+ }
44
+ end
45
+
46
+ # Initializes the object
47
+ # @param [Hash] attributes Model attributes in the form of hash
48
+ def initialize(attributes = {})
49
+ return unless attributes.is_a?(Hash)
50
+
51
+ # convert string to symbol for hash key
52
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
53
+
54
+ if attributes.has_key?(:'Successful')
55
+ self.successful = attributes[:'Successful']
56
+ end
57
+
58
+ if attributes.has_key?(:'SubjectivityScoreResult')
59
+ self.subjectivity_score_result = attributes[:'SubjectivityScoreResult']
60
+ end
61
+
62
+ if attributes.has_key?(:'SentenceCount')
63
+ self.sentence_count = attributes[:'SentenceCount']
64
+ end
65
+
66
+ end
67
+
68
+ # Show invalid properties with the reasons. Usually used together with valid?
69
+ # @return Array for valid properties with the reasons
70
+ def list_invalid_properties
71
+ invalid_properties = Array.new
72
+ return invalid_properties
73
+ end
74
+
75
+ # Check to see if the all the properties in the model are valid
76
+ # @return true if the model is valid
77
+ def valid?
78
+ return true
79
+ end
80
+
81
+ # Checks equality by comparing each attribute.
82
+ # @param [Object] Object to be compared
83
+ def ==(o)
84
+ return true if self.equal?(o)
85
+ self.class == o.class &&
86
+ successful == o.successful &&
87
+ subjectivity_score_result == o.subjectivity_score_result &&
88
+ sentence_count == o.sentence_count
89
+ end
90
+
91
+ # @see the `==` method
92
+ # @param [Object] Object to be compared
93
+ def eql?(o)
94
+ self == o
95
+ end
96
+
97
+ # Calculates hash code according to all attributes.
98
+ # @return [Fixnum] Hash code
99
+ def hash
100
+ [successful, subjectivity_score_result, sentence_count].hash
101
+ end
102
+
103
+ # Builds the object from hash
104
+ # @param [Hash] attributes Model attributes in the form of hash
105
+ # @return [Object] Returns the model itself
106
+ def build_from_hash(attributes)
107
+ return nil unless attributes.is_a?(Hash)
108
+ self.class.swagger_types.each_pair do |key, type|
109
+ if type =~ /\AArray<(.*)>/i
110
+ # check to ensure the input is an array given that the the attribute
111
+ # is documented as an array but the input is not
112
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
113
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
114
+ end
115
+ elsif !attributes[self.class.attribute_map[key]].nil?
116
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
117
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
118
+ end
119
+
120
+ self
121
+ end
122
+
123
+ # Deserializes the data based on type
124
+ # @param string type Data type
125
+ # @param string value Value to be deserialized
126
+ # @return [Object] Deserialized data
127
+ def _deserialize(type, value)
128
+ case type.to_sym
129
+ when :DateTime
130
+ DateTime.parse(value)
131
+ when :Date
132
+ Date.parse(value)
133
+ when :String
134
+ value.to_s
135
+ when :Integer
136
+ value.to_i
137
+ when :Float
138
+ value.to_f
139
+ when :BOOLEAN
140
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
141
+ true
142
+ else
143
+ false
144
+ end
145
+ when :Object
146
+ # generic object (usually a Hash), return directly
147
+ value
148
+ when /\AArray<(?<inner_type>.+)>\z/
149
+ inner_type = Regexp.last_match[:inner_type]
150
+ value.map { |v| _deserialize(inner_type, v) }
151
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
152
+ k_type = Regexp.last_match[:k_type]
153
+ v_type = Regexp.last_match[:v_type]
154
+ {}.tap do |hash|
155
+ value.each do |k, v|
156
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
157
+ end
158
+ end
159
+ else # model
160
+ temp_model = CloudmersiveNlpApiClient.const_get(type).new
161
+ temp_model.build_from_hash(value)
162
+ end
163
+ end
164
+
165
+ # Returns the string representation of the object
166
+ # @return [String] String presentation of the object
167
+ def to_s
168
+ to_hash.to_s
169
+ end
170
+
171
+ # to_body is an alias to to_hash (backward compatibility)
172
+ # @return [Hash] Returns the object in the form of hash
173
+ def to_body
174
+ to_hash
175
+ end
176
+
177
+ # Returns the object in the form of hash
178
+ # @return [Hash] Returns the object in the form of hash
179
+ def to_hash
180
+ hash = {}
181
+ self.class.attribute_map.each_pair do |attr, param|
182
+ value = self.send(attr)
183
+ next if value.nil?
184
+ hash[param] = _to_hash(value)
185
+ end
186
+ hash
187
+ end
188
+
189
+ # Outputs non-array value in the form of hash
190
+ # For object, use to_hash. Otherwise, just return the value
191
+ # @param [Object] value Any valid value
192
+ # @return [Hash] Returns the value in the form of hash
193
+ def _to_hash(value)
194
+ if value.is_a?(Array)
195
+ value.compact.map{ |v| _to_hash(v) }
196
+ elsif value.is_a?(Hash)
197
+ {}.tap do |hash|
198
+ value.each { |k, v| hash[k] = _to_hash(v) }
199
+ end
200
+ elsif value.respond_to? :to_hash
201
+ value.to_hash
202
+ else
203
+ value
204
+ end
205
+ end
206
+
207
+ end
208
+
209
+ end
@@ -11,5 +11,5 @@ Swagger Codegen version: 2.3.1
11
11
  =end
12
12
 
13
13
  module CloudmersiveNlpApiClient
14
- VERSION = "2.0.6"
14
+ VERSION = "2.0.7"
15
15
  end
@@ -56,4 +56,16 @@ describe 'AnalyticsApi' do
56
56
  end
57
57
  end
58
58
 
59
+ # unit tests for analytics_subjectivity
60
+ # Perform Subjectivity and Objectivity Analysis on Text
61
+ # Analyze input text using advanced Subjectivity and Objectivity Language Analysis to determine if the input text is objective or subjective, and how much. Supports English language input. Consumes 1-2 API calls per sentence.
62
+ # @param input Input subjectivity analysis request
63
+ # @param [Hash] opts the optional parameters
64
+ # @return [SubjectivityAnalysisResponse]
65
+ describe 'analytics_subjectivity test' do
66
+ it "should work" do
67
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
68
+ end
69
+ end
70
+
59
71
  end
@@ -32,13 +32,13 @@ describe 'RephraseApi' do
32
32
  end
33
33
  end
34
34
 
35
- # unit tests for rephrase_translate_deu_to_eng
35
+ # unit tests for rephrase_english_rephrase_sentence_by_sentence
36
36
  # Rephrase, paraphrase English text sentence-by-sentence using Deep Learning AI
37
37
  # Automatically rephrases or paraphrases input text in English sentence by sentence using advanced Deep Learning and Neural NLP. Creates multiple reprhasing candidates per input sentence, from 1 to 10 possible rephrasings of the original sentence. Seeks to preserve original semantic meaning in rephrased output candidates. Consumes 1-2 API calls per output rephrasing option generated, per sentence.
38
38
  # @param input Input rephrase request
39
39
  # @param [Hash] opts the optional parameters
40
40
  # @return [RephraseResponse]
41
- describe 'rephrase_translate_deu_to_eng test' do
41
+ describe 'rephrase_english_rephrase_sentence_by_sentence test' do
42
42
  it "should work" do
43
43
  # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
44
44
  end
@@ -0,0 +1,42 @@
1
+ =begin
2
+ #nlpapiv2
3
+
4
+ #The powerful Natural Language Processing APIs (v2) let you perform part of speech tagging, entity identification, sentence parsing, and much more to help you understand the meaning of unstructured text.
5
+
6
+ OpenAPI spec version: v1
7
+
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.3.1
10
+
11
+ =end
12
+
13
+ require 'spec_helper'
14
+ require 'json'
15
+ require 'date'
16
+
17
+ # Unit tests for CloudmersiveNlpApiClient::SubjectivityAnalysisRequest
18
+ # Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen)
19
+ # Please update as you see appropriate
20
+ describe 'SubjectivityAnalysisRequest' do
21
+ before do
22
+ # run before each test
23
+ @instance = CloudmersiveNlpApiClient::SubjectivityAnalysisRequest.new
24
+ end
25
+
26
+ after do
27
+ # run after each test
28
+ end
29
+
30
+ describe 'test an instance of SubjectivityAnalysisRequest' do
31
+ it 'should create an instance of SubjectivityAnalysisRequest' do
32
+ expect(@instance).to be_instance_of(CloudmersiveNlpApiClient::SubjectivityAnalysisRequest)
33
+ end
34
+ end
35
+ describe 'test attribute "text_to_analyze"' do
36
+ it 'should work' do
37
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
38
+ end
39
+ end
40
+
41
+ end
42
+
@@ -0,0 +1,54 @@
1
+ =begin
2
+ #nlpapiv2
3
+
4
+ #The powerful Natural Language Processing APIs (v2) let you perform part of speech tagging, entity identification, sentence parsing, and much more to help you understand the meaning of unstructured text.
5
+
6
+ OpenAPI spec version: v1
7
+
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.3.1
10
+
11
+ =end
12
+
13
+ require 'spec_helper'
14
+ require 'json'
15
+ require 'date'
16
+
17
+ # Unit tests for CloudmersiveNlpApiClient::SubjectivityAnalysisResponse
18
+ # Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen)
19
+ # Please update as you see appropriate
20
+ describe 'SubjectivityAnalysisResponse' do
21
+ before do
22
+ # run before each test
23
+ @instance = CloudmersiveNlpApiClient::SubjectivityAnalysisResponse.new
24
+ end
25
+
26
+ after do
27
+ # run after each test
28
+ end
29
+
30
+ describe 'test an instance of SubjectivityAnalysisResponse' do
31
+ it 'should create an instance of SubjectivityAnalysisResponse' do
32
+ expect(@instance).to be_instance_of(CloudmersiveNlpApiClient::SubjectivityAnalysisResponse)
33
+ end
34
+ end
35
+ describe 'test attribute "successful"' do
36
+ it 'should work' do
37
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
38
+ end
39
+ end
40
+
41
+ describe 'test attribute "subjectivity_score_result"' do
42
+ it 'should work' do
43
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
44
+ end
45
+ end
46
+
47
+ describe 'test attribute "sentence_count"' do
48
+ it 'should work' do
49
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
50
+ end
51
+ end
52
+
53
+ end
54
+
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cloudmersive-nlp-api-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.6
4
+ version: 2.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cloudmersive
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-05-07 00:00:00.000000000 Z
11
+ date: 2020-05-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: typhoeus
@@ -242,6 +242,8 @@ files:
242
242
  - "./docs/SentimentAnalysisRequest.md"
243
243
  - "./docs/SentimentAnalysisResponse.md"
244
244
  - "./docs/SpellcheckApi.md"
245
+ - "./docs/SubjectivityAnalysisRequest.md"
246
+ - "./docs/SubjectivityAnalysisResponse.md"
245
247
  - "./docs/WordPosition.md"
246
248
  - "./git_push.sh"
247
249
  - "./lib/cloudmersive-nlp-api-client.rb"
@@ -287,6 +289,8 @@ files:
287
289
  - "./lib/cloudmersive-nlp-api-client/models/sentence_segmentation_response.rb"
288
290
  - "./lib/cloudmersive-nlp-api-client/models/sentiment_analysis_request.rb"
289
291
  - "./lib/cloudmersive-nlp-api-client/models/sentiment_analysis_response.rb"
292
+ - "./lib/cloudmersive-nlp-api-client/models/subjectivity_analysis_request.rb"
293
+ - "./lib/cloudmersive-nlp-api-client/models/subjectivity_analysis_response.rb"
290
294
  - "./lib/cloudmersive-nlp-api-client/models/word_position.rb"
291
295
  - "./lib/cloudmersive-nlp-api-client/version.rb"
292
296
  - "./spec/api/analytics_api_spec.rb"
@@ -330,6 +334,8 @@ files:
330
334
  - "./spec/models/sentence_segmentation_response_spec.rb"
331
335
  - "./spec/models/sentiment_analysis_request_spec.rb"
332
336
  - "./spec/models/sentiment_analysis_response_spec.rb"
337
+ - "./spec/models/subjectivity_analysis_request_spec.rb"
338
+ - "./spec/models/subjectivity_analysis_response_spec.rb"
333
339
  - "./spec/models/word_position_spec.rb"
334
340
  - "./spec/spec_helper.rb"
335
341
  homepage: https://www.cloudmersive.com/nlp-api