cloudmersive-nlp-api-client 3.0.2 → 3.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (153) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +7 -0
  3. data/README.md +162 -0
  4. data/Rakefile +8 -0
  5. data/cloudmersive-nlp-api-client.gemspec +45 -0
  6. data/docs/AnalyticsApi.md +283 -0
  7. data/docs/CheckSentenceRequest.md +8 -0
  8. data/docs/CheckSentenceResponse.md +9 -0
  9. data/docs/CheckWordRequest.md +8 -0
  10. data/docs/CheckWordResponse.md +9 -0
  11. data/docs/CorrectWordInSentence.md +10 -0
  12. data/docs/Entity.md +9 -0
  13. data/docs/ExtractEntitiesApi.md +63 -0
  14. data/docs/ExtractEntitiesRequest.md +8 -0
  15. data/docs/ExtractEntitiesResponse.md +9 -0
  16. data/docs/GetWordsRequest.md +8 -0
  17. data/docs/GetWordsResponse.md +8 -0
  18. data/docs/HateSpeechAnalysisRequest.md +8 -0
  19. data/docs/HateSpeechAnalysisResponse.md +10 -0
  20. data/docs/LanguageDetectionApi.md +63 -0
  21. data/docs/LanguageDetectionRequest.md +8 -0
  22. data/docs/LanguageDetectionResponse.md +10 -0
  23. data/docs/LanguageTranslationApi.md +338 -0
  24. data/docs/LanguageTranslationRequest.md +8 -0
  25. data/docs/LanguageTranslationResponse.md +10 -0
  26. data/docs/ParseApi.md +63 -0
  27. data/docs/ParseRequest.md +8 -0
  28. data/docs/ParseResponse.md +8 -0
  29. data/docs/PosRequest.md +8 -0
  30. data/docs/PosResponse.md +8 -0
  31. data/docs/PosSentence.md +8 -0
  32. data/docs/PosTaggedWord.md +9 -0
  33. data/docs/PosTaggerApi.md +338 -0
  34. data/docs/ProfanityAnalysisRequest.md +8 -0
  35. data/docs/ProfanityAnalysisResponse.md +10 -0
  36. data/docs/RephraseApi.md +63 -0
  37. data/docs/RephraseRequest.md +9 -0
  38. data/docs/RephraseResponse.md +10 -0
  39. data/docs/RephrasedSentence.md +10 -0
  40. data/docs/RephrasedSentenceOption.md +9 -0
  41. data/docs/SegmentationApi.md +118 -0
  42. data/docs/SentenceSegmentationRequest.md +8 -0
  43. data/docs/SentenceSegmentationResponse.md +10 -0
  44. data/docs/SentimentAnalysisRequest.md +8 -0
  45. data/docs/SentimentAnalysisResponse.md +11 -0
  46. data/docs/SimilarityAnalysisRequest.md +9 -0
  47. data/docs/SimilarityAnalysisResponse.md +10 -0
  48. data/docs/SpellcheckApi.md +118 -0
  49. data/docs/SubjectivityAnalysisRequest.md +8 -0
  50. data/docs/SubjectivityAnalysisResponse.md +10 -0
  51. data/docs/WordPosition.md +11 -0
  52. data/git_push.sh +55 -0
  53. data/lib/cloudmersive-nlp-api-client.rb +85 -0
  54. data/lib/cloudmersive-nlp-api-client/api/analytics_api.rb +293 -0
  55. data/lib/cloudmersive-nlp-api-client/api/extract_entities_api.rb +77 -0
  56. data/lib/cloudmersive-nlp-api-client/api/language_detection_api.rb +77 -0
  57. data/lib/cloudmersive-nlp-api-client/api/language_translation_api.rb +347 -0
  58. data/lib/cloudmersive-nlp-api-client/api/parse_api.rb +77 -0
  59. data/lib/cloudmersive-nlp-api-client/api/pos_tagger_api.rb +347 -0
  60. data/lib/cloudmersive-nlp-api-client/api/rephrase_api.rb +77 -0
  61. data/lib/cloudmersive-nlp-api-client/api/segmentation_api.rb +131 -0
  62. data/lib/cloudmersive-nlp-api-client/api/spellcheck_api.rb +131 -0
  63. data/lib/cloudmersive-nlp-api-client/api_client.rb +391 -0
  64. data/lib/cloudmersive-nlp-api-client/api_error.rb +38 -0
  65. data/lib/cloudmersive-nlp-api-client/configuration.rb +209 -0
  66. data/lib/cloudmersive-nlp-api-client/models/check_sentence_request.rb +186 -0
  67. data/lib/cloudmersive-nlp-api-client/models/check_sentence_response.rb +198 -0
  68. data/lib/cloudmersive-nlp-api-client/models/check_word_request.rb +184 -0
  69. data/lib/cloudmersive-nlp-api-client/models/check_word_response.rb +198 -0
  70. data/lib/cloudmersive-nlp-api-client/models/correct_word_in_sentence.rb +208 -0
  71. data/lib/cloudmersive-nlp-api-client/models/entity.rb +193 -0
  72. data/lib/cloudmersive-nlp-api-client/models/extract_entities_request.rb +186 -0
  73. data/lib/cloudmersive-nlp-api-client/models/extract_entities_response.rb +197 -0
  74. data/lib/cloudmersive-nlp-api-client/models/get_words_request.rb +184 -0
  75. data/lib/cloudmersive-nlp-api-client/models/get_words_response.rb +188 -0
  76. data/lib/cloudmersive-nlp-api-client/models/hate_speech_analysis_request.rb +186 -0
  77. data/lib/cloudmersive-nlp-api-client/models/hate_speech_analysis_response.rb +206 -0
  78. data/lib/cloudmersive-nlp-api-client/models/language_detection_request.rb +186 -0
  79. data/lib/cloudmersive-nlp-api-client/models/language_detection_response.rb +206 -0
  80. data/lib/cloudmersive-nlp-api-client/models/language_translation_request.rb +186 -0
  81. data/lib/cloudmersive-nlp-api-client/models/language_translation_response.rb +206 -0
  82. data/lib/cloudmersive-nlp-api-client/models/parse_request.rb +186 -0
  83. data/lib/cloudmersive-nlp-api-client/models/parse_response.rb +186 -0
  84. data/lib/cloudmersive-nlp-api-client/models/pos_request.rb +186 -0
  85. data/lib/cloudmersive-nlp-api-client/models/pos_response.rb +188 -0
  86. data/lib/cloudmersive-nlp-api-client/models/pos_sentence.rb +188 -0
  87. data/lib/cloudmersive-nlp-api-client/models/pos_tagged_word.rb +196 -0
  88. data/lib/cloudmersive-nlp-api-client/models/profanity_analysis_request.rb +186 -0
  89. data/lib/cloudmersive-nlp-api-client/models/profanity_analysis_response.rb +206 -0
  90. data/lib/cloudmersive-nlp-api-client/models/rephrase_request.rb +196 -0
  91. data/lib/cloudmersive-nlp-api-client/models/rephrase_response.rb +208 -0
  92. data/lib/cloudmersive-nlp-api-client/models/rephrased_sentence.rb +208 -0
  93. data/lib/cloudmersive-nlp-api-client/models/rephrased_sentence_option.rb +196 -0
  94. data/lib/cloudmersive-nlp-api-client/models/sentence_segmentation_request.rb +184 -0
  95. data/lib/cloudmersive-nlp-api-client/models/sentence_segmentation_response.rb +204 -0
  96. data/lib/cloudmersive-nlp-api-client/models/sentiment_analysis_request.rb +186 -0
  97. data/lib/cloudmersive-nlp-api-client/models/sentiment_analysis_response.rb +216 -0
  98. data/lib/cloudmersive-nlp-api-client/models/similarity_analysis_request.rb +196 -0
  99. data/lib/cloudmersive-nlp-api-client/models/similarity_analysis_response.rb +206 -0
  100. data/lib/cloudmersive-nlp-api-client/models/subjectivity_analysis_request.rb +186 -0
  101. data/lib/cloudmersive-nlp-api-client/models/subjectivity_analysis_response.rb +206 -0
  102. data/lib/cloudmersive-nlp-api-client/models/word_position.rb +215 -0
  103. data/lib/cloudmersive-nlp-api-client/version.rb +15 -0
  104. data/spec/api/analytics_api_spec.rb +95 -0
  105. data/spec/api/extract_entities_api_spec.rb +47 -0
  106. data/spec/api/language_detection_api_spec.rb +47 -0
  107. data/spec/api/language_translation_api_spec.rb +107 -0
  108. data/spec/api/parse_api_spec.rb +47 -0
  109. data/spec/api/pos_tagger_api_spec.rb +107 -0
  110. data/spec/api/rephrase_api_spec.rb +47 -0
  111. data/spec/api/segmentation_api_spec.rb +59 -0
  112. data/spec/api/spellcheck_api_spec.rb +59 -0
  113. data/spec/api_client_spec.rb +243 -0
  114. data/spec/configuration_spec.rb +42 -0
  115. data/spec/models/check_sentence_request_spec.rb +41 -0
  116. data/spec/models/check_sentence_response_spec.rb +47 -0
  117. data/spec/models/check_word_request_spec.rb +41 -0
  118. data/spec/models/check_word_response_spec.rb +47 -0
  119. data/spec/models/correct_word_in_sentence_spec.rb +53 -0
  120. data/spec/models/entity_spec.rb +47 -0
  121. data/spec/models/extract_entities_request_spec.rb +41 -0
  122. data/spec/models/extract_entities_response_spec.rb +47 -0
  123. data/spec/models/get_words_request_spec.rb +41 -0
  124. data/spec/models/get_words_response_spec.rb +41 -0
  125. data/spec/models/hate_speech_analysis_request_spec.rb +41 -0
  126. data/spec/models/hate_speech_analysis_response_spec.rb +53 -0
  127. data/spec/models/language_detection_request_spec.rb +41 -0
  128. data/spec/models/language_detection_response_spec.rb +53 -0
  129. data/spec/models/language_translation_request_spec.rb +41 -0
  130. data/spec/models/language_translation_response_spec.rb +53 -0
  131. data/spec/models/parse_request_spec.rb +41 -0
  132. data/spec/models/parse_response_spec.rb +41 -0
  133. data/spec/models/pos_request_spec.rb +41 -0
  134. data/spec/models/pos_response_spec.rb +41 -0
  135. data/spec/models/pos_sentence_spec.rb +41 -0
  136. data/spec/models/pos_tagged_word_spec.rb +47 -0
  137. data/spec/models/profanity_analysis_request_spec.rb +41 -0
  138. data/spec/models/profanity_analysis_response_spec.rb +53 -0
  139. data/spec/models/rephrase_request_spec.rb +47 -0
  140. data/spec/models/rephrase_response_spec.rb +53 -0
  141. data/spec/models/rephrased_sentence_option_spec.rb +47 -0
  142. data/spec/models/rephrased_sentence_spec.rb +53 -0
  143. data/spec/models/sentence_segmentation_request_spec.rb +41 -0
  144. data/spec/models/sentence_segmentation_response_spec.rb +53 -0
  145. data/spec/models/sentiment_analysis_request_spec.rb +41 -0
  146. data/spec/models/sentiment_analysis_response_spec.rb +59 -0
  147. data/spec/models/similarity_analysis_request_spec.rb +47 -0
  148. data/spec/models/similarity_analysis_response_spec.rb +53 -0
  149. data/spec/models/subjectivity_analysis_request_spec.rb +41 -0
  150. data/spec/models/subjectivity_analysis_response_spec.rb +53 -0
  151. data/spec/models/word_position_spec.rb +59 -0
  152. data/spec/spec_helper.rb +111 -0
  153. metadata +154 -3
@@ -0,0 +1,206 @@
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.4.14
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
+ # Attribute mapping from ruby-style variable name to JSON key.
28
+ def self.attribute_map
29
+ {
30
+ :'successful' => :'Successful',
31
+ :'subjectivity_score_result' => :'SubjectivityScoreResult',
32
+ :'sentence_count' => :'SentenceCount'
33
+ }
34
+ end
35
+
36
+ # Attribute type mapping.
37
+ def self.swagger_types
38
+ {
39
+ :'successful' => :'BOOLEAN',
40
+ :'subjectivity_score_result' => :'Float',
41
+ :'sentence_count' => :'Integer'
42
+ }
43
+ end
44
+
45
+ # Initializes the object
46
+ # @param [Hash] attributes Model attributes in the form of hash
47
+ def initialize(attributes = {})
48
+ return unless attributes.is_a?(Hash)
49
+
50
+ # convert string to symbol for hash key
51
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
52
+
53
+ if attributes.has_key?(:'Successful')
54
+ self.successful = attributes[:'Successful']
55
+ end
56
+
57
+ if attributes.has_key?(:'SubjectivityScoreResult')
58
+ self.subjectivity_score_result = attributes[:'SubjectivityScoreResult']
59
+ end
60
+
61
+ if attributes.has_key?(:'SentenceCount')
62
+ self.sentence_count = attributes[:'SentenceCount']
63
+ end
64
+ end
65
+
66
+ # Show invalid properties with the reasons. Usually used together with valid?
67
+ # @return Array for valid properties with the reasons
68
+ def list_invalid_properties
69
+ invalid_properties = Array.new
70
+ invalid_properties
71
+ end
72
+
73
+ # Check to see if the all the properties in the model are valid
74
+ # @return true if the model is valid
75
+ def valid?
76
+ true
77
+ end
78
+
79
+ # Checks equality by comparing each attribute.
80
+ # @param [Object] Object to be compared
81
+ def ==(o)
82
+ return true if self.equal?(o)
83
+ self.class == o.class &&
84
+ successful == o.successful &&
85
+ subjectivity_score_result == o.subjectivity_score_result &&
86
+ sentence_count == o.sentence_count
87
+ end
88
+
89
+ # @see the `==` method
90
+ # @param [Object] Object to be compared
91
+ def eql?(o)
92
+ self == o
93
+ end
94
+
95
+ # Calculates hash code according to all attributes.
96
+ # @return [Fixnum] Hash code
97
+ def hash
98
+ [successful, subjectivity_score_result, sentence_count].hash
99
+ end
100
+
101
+ # Builds the object from hash
102
+ # @param [Hash] attributes Model attributes in the form of hash
103
+ # @return [Object] Returns the model itself
104
+ def build_from_hash(attributes)
105
+ return nil unless attributes.is_a?(Hash)
106
+ self.class.swagger_types.each_pair do |key, type|
107
+ if type =~ /\AArray<(.*)>/i
108
+ # check to ensure the input is an array given that the attribute
109
+ # is documented as an array but the input is not
110
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
111
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
112
+ end
113
+ elsif !attributes[self.class.attribute_map[key]].nil?
114
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
115
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
116
+ end
117
+
118
+ self
119
+ end
120
+
121
+ # Deserializes the data based on type
122
+ # @param string type Data type
123
+ # @param string value Value to be deserialized
124
+ # @return [Object] Deserialized data
125
+ def _deserialize(type, value)
126
+ case type.to_sym
127
+ when :DateTime
128
+ DateTime.parse(value)
129
+ when :Date
130
+ Date.parse(value)
131
+ when :String
132
+ value.to_s
133
+ when :Integer
134
+ value.to_i
135
+ when :Float
136
+ value.to_f
137
+ when :BOOLEAN
138
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
139
+ true
140
+ else
141
+ false
142
+ end
143
+ when :Object
144
+ # generic object (usually a Hash), return directly
145
+ value
146
+ when /\AArray<(?<inner_type>.+)>\z/
147
+ inner_type = Regexp.last_match[:inner_type]
148
+ value.map { |v| _deserialize(inner_type, v) }
149
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
150
+ k_type = Regexp.last_match[:k_type]
151
+ v_type = Regexp.last_match[:v_type]
152
+ {}.tap do |hash|
153
+ value.each do |k, v|
154
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
155
+ end
156
+ end
157
+ else # model
158
+ temp_model = CloudmersiveNlpApiClient.const_get(type).new
159
+ temp_model.build_from_hash(value)
160
+ end
161
+ end
162
+
163
+ # Returns the string representation of the object
164
+ # @return [String] String presentation of the object
165
+ def to_s
166
+ to_hash.to_s
167
+ end
168
+
169
+ # to_body is an alias to to_hash (backward compatibility)
170
+ # @return [Hash] Returns the object in the form of hash
171
+ def to_body
172
+ to_hash
173
+ end
174
+
175
+ # Returns the object in the form of hash
176
+ # @return [Hash] Returns the object in the form of hash
177
+ def to_hash
178
+ hash = {}
179
+ self.class.attribute_map.each_pair do |attr, param|
180
+ value = self.send(attr)
181
+ next if value.nil?
182
+ hash[param] = _to_hash(value)
183
+ end
184
+ hash
185
+ end
186
+
187
+ # Outputs non-array value in the form of hash
188
+ # For object, use to_hash. Otherwise, just return the value
189
+ # @param [Object] value Any valid value
190
+ # @return [Hash] Returns the value in the form of hash
191
+ def _to_hash(value)
192
+ if value.is_a?(Array)
193
+ value.compact.map { |v| _to_hash(v) }
194
+ elsif value.is_a?(Hash)
195
+ {}.tap do |hash|
196
+ value.each { |k, v| hash[k] = _to_hash(v) }
197
+ end
198
+ elsif value.respond_to? :to_hash
199
+ value.to_hash
200
+ else
201
+ value
202
+ end
203
+ end
204
+
205
+ end
206
+ end
@@ -0,0 +1,215 @@
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.4.14
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module CloudmersiveNlpApiClient
16
+ class WordPosition
17
+ # Word as a string
18
+ attr_accessor :word
19
+
20
+ # Zero-based index of the word; first word has index 0, second word has index 1 and so on
21
+ attr_accessor :word_index
22
+
23
+ # Zero-based character offset at which the word begins in the input string
24
+ attr_accessor :start_position
25
+
26
+ # Zero-based character offset at which the word ends in the input string
27
+ attr_accessor :end_position
28
+
29
+ # Attribute mapping from ruby-style variable name to JSON key.
30
+ def self.attribute_map
31
+ {
32
+ :'word' => :'Word',
33
+ :'word_index' => :'WordIndex',
34
+ :'start_position' => :'StartPosition',
35
+ :'end_position' => :'EndPosition'
36
+ }
37
+ end
38
+
39
+ # Attribute type mapping.
40
+ def self.swagger_types
41
+ {
42
+ :'word' => :'String',
43
+ :'word_index' => :'Integer',
44
+ :'start_position' => :'Integer',
45
+ :'end_position' => :'Integer'
46
+ }
47
+ end
48
+
49
+ # Initializes the object
50
+ # @param [Hash] attributes Model attributes in the form of hash
51
+ def initialize(attributes = {})
52
+ return unless attributes.is_a?(Hash)
53
+
54
+ # convert string to symbol for hash key
55
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
56
+
57
+ if attributes.has_key?(:'Word')
58
+ self.word = attributes[:'Word']
59
+ end
60
+
61
+ if attributes.has_key?(:'WordIndex')
62
+ self.word_index = attributes[:'WordIndex']
63
+ end
64
+
65
+ if attributes.has_key?(:'StartPosition')
66
+ self.start_position = attributes[:'StartPosition']
67
+ end
68
+
69
+ if attributes.has_key?(:'EndPosition')
70
+ self.end_position = attributes[:'EndPosition']
71
+ end
72
+ end
73
+
74
+ # Show invalid properties with the reasons. Usually used together with valid?
75
+ # @return Array for valid properties with the reasons
76
+ def list_invalid_properties
77
+ invalid_properties = Array.new
78
+ invalid_properties
79
+ end
80
+
81
+ # Check to see if the all the properties in the model are valid
82
+ # @return true if the model is valid
83
+ def valid?
84
+ true
85
+ end
86
+
87
+ # Checks equality by comparing each attribute.
88
+ # @param [Object] Object to be compared
89
+ def ==(o)
90
+ return true if self.equal?(o)
91
+ self.class == o.class &&
92
+ word == o.word &&
93
+ word_index == o.word_index &&
94
+ start_position == o.start_position &&
95
+ end_position == o.end_position
96
+ end
97
+
98
+ # @see the `==` method
99
+ # @param [Object] Object to be compared
100
+ def eql?(o)
101
+ self == o
102
+ end
103
+
104
+ # Calculates hash code according to all attributes.
105
+ # @return [Fixnum] Hash code
106
+ def hash
107
+ [word, word_index, start_position, end_position].hash
108
+ end
109
+
110
+ # Builds the object from hash
111
+ # @param [Hash] attributes Model attributes in the form of hash
112
+ # @return [Object] Returns the model itself
113
+ def build_from_hash(attributes)
114
+ return nil unless attributes.is_a?(Hash)
115
+ self.class.swagger_types.each_pair do |key, type|
116
+ if type =~ /\AArray<(.*)>/i
117
+ # check to ensure the input is an array given that the attribute
118
+ # is documented as an array but the input is not
119
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
120
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
121
+ end
122
+ elsif !attributes[self.class.attribute_map[key]].nil?
123
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
124
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
125
+ end
126
+
127
+ self
128
+ end
129
+
130
+ # Deserializes the data based on type
131
+ # @param string type Data type
132
+ # @param string value Value to be deserialized
133
+ # @return [Object] Deserialized data
134
+ def _deserialize(type, value)
135
+ case type.to_sym
136
+ when :DateTime
137
+ DateTime.parse(value)
138
+ when :Date
139
+ Date.parse(value)
140
+ when :String
141
+ value.to_s
142
+ when :Integer
143
+ value.to_i
144
+ when :Float
145
+ value.to_f
146
+ when :BOOLEAN
147
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
148
+ true
149
+ else
150
+ false
151
+ end
152
+ when :Object
153
+ # generic object (usually a Hash), return directly
154
+ value
155
+ when /\AArray<(?<inner_type>.+)>\z/
156
+ inner_type = Regexp.last_match[:inner_type]
157
+ value.map { |v| _deserialize(inner_type, v) }
158
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
159
+ k_type = Regexp.last_match[:k_type]
160
+ v_type = Regexp.last_match[:v_type]
161
+ {}.tap do |hash|
162
+ value.each do |k, v|
163
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
164
+ end
165
+ end
166
+ else # model
167
+ temp_model = CloudmersiveNlpApiClient.const_get(type).new
168
+ temp_model.build_from_hash(value)
169
+ end
170
+ end
171
+
172
+ # Returns the string representation of the object
173
+ # @return [String] String presentation of the object
174
+ def to_s
175
+ to_hash.to_s
176
+ end
177
+
178
+ # to_body is an alias to to_hash (backward compatibility)
179
+ # @return [Hash] Returns the object in the form of hash
180
+ def to_body
181
+ to_hash
182
+ end
183
+
184
+ # Returns the object in the form of hash
185
+ # @return [Hash] Returns the object in the form of hash
186
+ def to_hash
187
+ hash = {}
188
+ self.class.attribute_map.each_pair do |attr, param|
189
+ value = self.send(attr)
190
+ next if value.nil?
191
+ hash[param] = _to_hash(value)
192
+ end
193
+ hash
194
+ end
195
+
196
+ # Outputs non-array value in the form of hash
197
+ # For object, use to_hash. Otherwise, just return the value
198
+ # @param [Object] value Any valid value
199
+ # @return [Hash] Returns the value in the form of hash
200
+ def _to_hash(value)
201
+ if value.is_a?(Array)
202
+ value.compact.map { |v| _to_hash(v) }
203
+ elsif value.is_a?(Hash)
204
+ {}.tap do |hash|
205
+ value.each { |k, v| hash[k] = _to_hash(v) }
206
+ end
207
+ elsif value.respond_to? :to_hash
208
+ value.to_hash
209
+ else
210
+ value
211
+ end
212
+ end
213
+
214
+ end
215
+ end
@@ -0,0 +1,15 @@
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.4.14
10
+
11
+ =end
12
+
13
+ module CloudmersiveNlpApiClient
14
+ VERSION = '3.0.3'
15
+ end
@@ -0,0 +1,95 @@
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.4.14
10
+
11
+ =end
12
+
13
+ require 'spec_helper'
14
+ require 'json'
15
+
16
+ # Unit tests for CloudmersiveNlpApiClient::AnalyticsApi
17
+ # Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen)
18
+ # Please update as you see appropriate
19
+ describe 'AnalyticsApi' do
20
+ before do
21
+ # run before each test
22
+ @instance = CloudmersiveNlpApiClient::AnalyticsApi.new
23
+ end
24
+
25
+ after do
26
+ # run after each test
27
+ end
28
+
29
+ describe 'test an instance of AnalyticsApi' do
30
+ it 'should create an instance of AnalyticsApi' do
31
+ expect(@instance).to be_instance_of(CloudmersiveNlpApiClient::AnalyticsApi)
32
+ end
33
+ end
34
+
35
+ # unit tests for analytics_hate_speech
36
+ # Perform Hate Speech Analysis and Detection on Text
37
+ # Analyze input text using advanced Hate Speech Analysis to determine if the input contains hate speech language. Supports English language input. Consumes 1-2 API calls per sentence.
38
+ # @param input Input hate speech analysis request
39
+ # @param [Hash] opts the optional parameters
40
+ # @return [HateSpeechAnalysisResponse]
41
+ describe 'analytics_hate_speech test' 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
+ # unit tests for analytics_profanity
48
+ # Perform Profanity and Obscene Language Analysis and Detection on Text
49
+ # Analyze input text using advanced Profanity and Obscene Language Analysis to determine if the input contains profane language. Supports English language input. Consumes 1-2 API calls per sentence.
50
+ # @param input Input profanity analysis request
51
+ # @param [Hash] opts the optional parameters
52
+ # @return [ProfanityAnalysisResponse]
53
+ describe 'analytics_profanity test' do
54
+ it 'should work' do
55
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
56
+ end
57
+ end
58
+
59
+ # unit tests for analytics_sentiment
60
+ # Perform Sentiment Analysis and Classification on Text
61
+ # Analyze input text using advanced Sentiment Analysis to determine if the input is positive, negative, or neutral. Supports English language input. Consumes 1-2 API calls per sentence.
62
+ # @param input Input sentiment analysis request
63
+ # @param [Hash] opts the optional parameters
64
+ # @return [SentimentAnalysisResponse]
65
+ describe 'analytics_sentiment 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
+
71
+ # unit tests for analytics_similarity
72
+ # Perform Semantic Similarity Comparison of Two Strings
73
+ # Analyze two input text strings, typically sentences, and determine the semantic similarity of each. Semantic similarity refers to the degree to which two sentences mean the same thing semantically. Uses advanced Deep Learning to perform the semantic similarity comparison. Consumes 1-2 API calls per sentence.
74
+ # @param input Input similarity analysis request
75
+ # @param [Hash] opts the optional parameters
76
+ # @return [SimilarityAnalysisResponse]
77
+ describe 'analytics_similarity test' do
78
+ it 'should work' do
79
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
80
+ end
81
+ end
82
+
83
+ # unit tests for analytics_subjectivity
84
+ # Perform Subjectivity and Objectivity Analysis on Text
85
+ # 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.
86
+ # @param input Input subjectivity analysis request
87
+ # @param [Hash] opts the optional parameters
88
+ # @return [SubjectivityAnalysisResponse]
89
+ describe 'analytics_subjectivity test' do
90
+ it 'should work' do
91
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
92
+ end
93
+ end
94
+
95
+ end