cloudmersive-nlp-api-client 2.0.7 → 3.0.3

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.
Files changed (118) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +1 -1
  3. data/README.md +16 -8
  4. data/cloudmersive-nlp-api-client.gemspec +3 -3
  5. data/docs/AnalyticsApi.md +113 -3
  6. data/docs/ExtractEntitiesApi.md +1 -1
  7. data/docs/HateSpeechAnalysisRequest.md +8 -0
  8. data/docs/HateSpeechAnalysisResponse.md +10 -0
  9. data/docs/LanguageDetectionApi.md +1 -1
  10. data/docs/LanguageTranslationApi.md +114 -4
  11. data/docs/ParseApi.md +1 -1
  12. data/docs/PosTaggerApi.md +6 -6
  13. data/docs/RephraseApi.md +1 -1
  14. data/docs/SegmentationApi.md +2 -2
  15. data/docs/SimilarityAnalysisRequest.md +9 -0
  16. data/docs/SimilarityAnalysisResponse.md +10 -0
  17. data/docs/SpellcheckApi.md +2 -2
  18. data/lib/cloudmersive-nlp-api-client.rb +5 -1
  19. data/lib/cloudmersive-nlp-api-client/api/analytics_api.rb +120 -15
  20. data/lib/cloudmersive-nlp-api-client/api/extract_entities_api.rb +6 -7
  21. data/lib/cloudmersive-nlp-api-client/api/language_detection_api.rb +6 -7
  22. data/lib/cloudmersive-nlp-api-client/api/language_translation_api.rb +124 -20
  23. data/lib/cloudmersive-nlp-api-client/api/parse_api.rb +6 -7
  24. data/lib/cloudmersive-nlp-api-client/api/pos_tagger_api.rb +26 -32
  25. data/lib/cloudmersive-nlp-api-client/api/rephrase_api.rb +6 -7
  26. data/lib/cloudmersive-nlp-api-client/api/segmentation_api.rb +10 -12
  27. data/lib/cloudmersive-nlp-api-client/api/spellcheck_api.rb +10 -12
  28. data/lib/cloudmersive-nlp-api-client/api_client.rb +11 -9
  29. data/lib/cloudmersive-nlp-api-client/api_error.rb +1 -1
  30. data/lib/cloudmersive-nlp-api-client/configuration.rb +2 -2
  31. data/lib/cloudmersive-nlp-api-client/models/check_sentence_request.rb +7 -10
  32. data/lib/cloudmersive-nlp-api-client/models/check_sentence_response.rb +7 -10
  33. data/lib/cloudmersive-nlp-api-client/models/check_word_request.rb +7 -11
  34. data/lib/cloudmersive-nlp-api-client/models/check_word_response.rb +7 -10
  35. data/lib/cloudmersive-nlp-api-client/models/correct_word_in_sentence.rb +7 -10
  36. data/lib/cloudmersive-nlp-api-client/models/entity.rb +7 -11
  37. data/lib/cloudmersive-nlp-api-client/models/extract_entities_request.rb +7 -10
  38. data/lib/cloudmersive-nlp-api-client/models/extract_entities_response.rb +7 -10
  39. data/lib/cloudmersive-nlp-api-client/models/get_words_request.rb +7 -11
  40. data/lib/cloudmersive-nlp-api-client/models/get_words_response.rb +7 -10
  41. data/lib/cloudmersive-nlp-api-client/models/hate_speech_analysis_request.rb +186 -0
  42. data/lib/cloudmersive-nlp-api-client/models/hate_speech_analysis_response.rb +206 -0
  43. data/lib/cloudmersive-nlp-api-client/models/language_detection_request.rb +7 -10
  44. data/lib/cloudmersive-nlp-api-client/models/language_detection_response.rb +7 -10
  45. data/lib/cloudmersive-nlp-api-client/models/language_translation_request.rb +7 -10
  46. data/lib/cloudmersive-nlp-api-client/models/language_translation_response.rb +7 -10
  47. data/lib/cloudmersive-nlp-api-client/models/parse_request.rb +7 -10
  48. data/lib/cloudmersive-nlp-api-client/models/parse_response.rb +7 -10
  49. data/lib/cloudmersive-nlp-api-client/models/pos_request.rb +7 -10
  50. data/lib/cloudmersive-nlp-api-client/models/pos_response.rb +7 -10
  51. data/lib/cloudmersive-nlp-api-client/models/pos_sentence.rb +7 -10
  52. data/lib/cloudmersive-nlp-api-client/models/pos_tagged_word.rb +7 -10
  53. data/lib/cloudmersive-nlp-api-client/models/profanity_analysis_request.rb +7 -10
  54. data/lib/cloudmersive-nlp-api-client/models/profanity_analysis_response.rb +7 -10
  55. data/lib/cloudmersive-nlp-api-client/models/rephrase_request.rb +7 -10
  56. data/lib/cloudmersive-nlp-api-client/models/rephrase_response.rb +7 -10
  57. data/lib/cloudmersive-nlp-api-client/models/rephrased_sentence.rb +7 -10
  58. data/lib/cloudmersive-nlp-api-client/models/rephrased_sentence_option.rb +7 -10
  59. data/lib/cloudmersive-nlp-api-client/models/sentence_segmentation_request.rb +7 -11
  60. data/lib/cloudmersive-nlp-api-client/models/sentence_segmentation_response.rb +7 -11
  61. data/lib/cloudmersive-nlp-api-client/models/sentiment_analysis_request.rb +7 -10
  62. data/lib/cloudmersive-nlp-api-client/models/sentiment_analysis_response.rb +7 -10
  63. data/lib/cloudmersive-nlp-api-client/models/similarity_analysis_request.rb +196 -0
  64. data/lib/cloudmersive-nlp-api-client/models/similarity_analysis_response.rb +206 -0
  65. data/lib/cloudmersive-nlp-api-client/models/subjectivity_analysis_request.rb +7 -10
  66. data/lib/cloudmersive-nlp-api-client/models/subjectivity_analysis_response.rb +7 -10
  67. data/lib/cloudmersive-nlp-api-client/models/word_position.rb +7 -11
  68. data/lib/cloudmersive-nlp-api-client/version.rb +2 -2
  69. data/spec/api/analytics_api_spec.rb +28 -4
  70. data/spec/api/extract_entities_api_spec.rb +2 -2
  71. data/spec/api/language_detection_api_spec.rb +2 -2
  72. data/spec/api/language_translation_api_spec.rb +29 -5
  73. data/spec/api/parse_api_spec.rb +2 -2
  74. data/spec/api/pos_tagger_api_spec.rb +7 -7
  75. data/spec/api/rephrase_api_spec.rb +2 -2
  76. data/spec/api/segmentation_api_spec.rb +3 -3
  77. data/spec/api/spellcheck_api_spec.rb +3 -3
  78. data/spec/api_client_spec.rb +52 -35
  79. data/spec/configuration_spec.rb +9 -9
  80. data/spec/models/check_sentence_request_spec.rb +2 -3
  81. data/spec/models/check_sentence_response_spec.rb +3 -4
  82. data/spec/models/check_word_request_spec.rb +2 -3
  83. data/spec/models/check_word_response_spec.rb +3 -4
  84. data/spec/models/correct_word_in_sentence_spec.rb +4 -5
  85. data/spec/models/entity_spec.rb +3 -4
  86. data/spec/models/extract_entities_request_spec.rb +2 -3
  87. data/spec/models/extract_entities_response_spec.rb +3 -4
  88. data/spec/models/get_words_request_spec.rb +2 -3
  89. data/spec/models/get_words_response_spec.rb +2 -3
  90. data/spec/models/hate_speech_analysis_request_spec.rb +41 -0
  91. data/spec/models/hate_speech_analysis_response_spec.rb +53 -0
  92. data/spec/models/language_detection_request_spec.rb +2 -3
  93. data/spec/models/language_detection_response_spec.rb +4 -5
  94. data/spec/models/language_translation_request_spec.rb +2 -3
  95. data/spec/models/language_translation_response_spec.rb +4 -5
  96. data/spec/models/parse_request_spec.rb +2 -3
  97. data/spec/models/parse_response_spec.rb +2 -3
  98. data/spec/models/pos_request_spec.rb +2 -3
  99. data/spec/models/pos_response_spec.rb +2 -3
  100. data/spec/models/pos_sentence_spec.rb +2 -3
  101. data/spec/models/pos_tagged_word_spec.rb +3 -4
  102. data/spec/models/profanity_analysis_request_spec.rb +2 -3
  103. data/spec/models/profanity_analysis_response_spec.rb +4 -5
  104. data/spec/models/rephrase_request_spec.rb +3 -4
  105. data/spec/models/rephrase_response_spec.rb +4 -5
  106. data/spec/models/rephrased_sentence_option_spec.rb +3 -4
  107. data/spec/models/rephrased_sentence_spec.rb +4 -5
  108. data/spec/models/sentence_segmentation_request_spec.rb +2 -3
  109. data/spec/models/sentence_segmentation_response_spec.rb +4 -5
  110. data/spec/models/sentiment_analysis_request_spec.rb +2 -3
  111. data/spec/models/sentiment_analysis_response_spec.rb +5 -6
  112. data/spec/models/similarity_analysis_request_spec.rb +47 -0
  113. data/spec/models/similarity_analysis_response_spec.rb +53 -0
  114. data/spec/models/subjectivity_analysis_request_spec.rb +2 -3
  115. data/spec/models/subjectivity_analysis_response_spec.rb +4 -5
  116. data/spec/models/word_position_spec.rb +5 -6
  117. data/spec/spec_helper.rb +1 -1
  118. metadata +14 -2
@@ -6,11 +6,11 @@
6
6
  OpenAPI spec version: v1
7
7
 
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
- Swagger Codegen version: 2.3.1
9
+ Swagger Codegen version: 2.4.14
10
10
 
11
11
  =end
12
12
 
13
- require "uri"
13
+ require 'uri'
14
14
 
15
15
  module CloudmersiveNlpApiClient
16
16
  class RephraseApi
@@ -19,7 +19,6 @@ module CloudmersiveNlpApiClient
19
19
  def initialize(api_client = ApiClient.default)
20
20
  @api_client = api_client
21
21
  end
22
-
23
22
  # Rephrase, paraphrase English text sentence-by-sentence using Deep Learning AI
24
23
  # 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.
25
24
  # @param input Input rephrase request
@@ -27,7 +26,7 @@ module CloudmersiveNlpApiClient
27
26
  # @return [RephraseResponse]
28
27
  def rephrase_english_rephrase_sentence_by_sentence(input, opts = {})
29
28
  data, _status_code, _headers = rephrase_english_rephrase_sentence_by_sentence_with_http_info(input, opts)
30
- return data
29
+ data
31
30
  end
32
31
 
33
32
  # Rephrase, paraphrase English text sentence-by-sentence using Deep Learning AI
@@ -37,14 +36,14 @@ module CloudmersiveNlpApiClient
37
36
  # @return [Array<(RephraseResponse, Fixnum, Hash)>] RephraseResponse data, response status code and response headers
38
37
  def rephrase_english_rephrase_sentence_by_sentence_with_http_info(input, opts = {})
39
38
  if @api_client.config.debugging
40
- @api_client.config.logger.debug "Calling API: RephraseApi.rephrase_english_rephrase_sentence_by_sentence ..."
39
+ @api_client.config.logger.debug 'Calling API: RephraseApi.rephrase_english_rephrase_sentence_by_sentence ...'
41
40
  end
42
41
  # verify the required parameter 'input' is set
43
42
  if @api_client.config.client_side_validation && input.nil?
44
43
  fail ArgumentError, "Missing the required parameter 'input' when calling RephraseApi.rephrase_english_rephrase_sentence_by_sentence"
45
44
  end
46
45
  # resource path
47
- local_var_path = "/nlp-v2/rephrase/rephrase/eng/by-sentence"
46
+ local_var_path = '/nlp-v2/rephrase/rephrase/eng/by-sentence'
48
47
 
49
48
  # query parameters
50
49
  query_params = {}
@@ -52,7 +51,7 @@ module CloudmersiveNlpApiClient
52
51
  # header parameters
53
52
  header_params = {}
54
53
  # HTTP header 'Accept' (if needed)
55
- header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/json', 'application/xml', 'text/xml'])
54
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
56
55
  # HTTP header 'Content-Type'
57
56
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'text/json', 'application/xml', 'text/xml', 'application/x-www-form-urlencoded'])
58
57
 
@@ -6,11 +6,11 @@
6
6
  OpenAPI spec version: v1
7
7
 
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
- Swagger Codegen version: 2.3.1
9
+ Swagger Codegen version: 2.4.14
10
10
 
11
11
  =end
12
12
 
13
- require "uri"
13
+ require 'uri'
14
14
 
15
15
  module CloudmersiveNlpApiClient
16
16
  class SegmentationApi
@@ -19,7 +19,6 @@ module CloudmersiveNlpApiClient
19
19
  def initialize(api_client = ApiClient.default)
20
20
  @api_client = api_client
21
21
  end
22
-
23
22
  # Extract sentences from string
24
23
  # Segment an input string into separate sentences, output result as a string.
25
24
  # @param input Input string
@@ -27,7 +26,7 @@ module CloudmersiveNlpApiClient
27
26
  # @return [SentenceSegmentationResponse]
28
27
  def segmentation_get_sentences(input, opts = {})
29
28
  data, _status_code, _headers = segmentation_get_sentences_with_http_info(input, opts)
30
- return data
29
+ data
31
30
  end
32
31
 
33
32
  # Extract sentences from string
@@ -37,14 +36,14 @@ module CloudmersiveNlpApiClient
37
36
  # @return [Array<(SentenceSegmentationResponse, Fixnum, Hash)>] SentenceSegmentationResponse data, response status code and response headers
38
37
  def segmentation_get_sentences_with_http_info(input, opts = {})
39
38
  if @api_client.config.debugging
40
- @api_client.config.logger.debug "Calling API: SegmentationApi.segmentation_get_sentences ..."
39
+ @api_client.config.logger.debug 'Calling API: SegmentationApi.segmentation_get_sentences ...'
41
40
  end
42
41
  # verify the required parameter 'input' is set
43
42
  if @api_client.config.client_side_validation && input.nil?
44
43
  fail ArgumentError, "Missing the required parameter 'input' when calling SegmentationApi.segmentation_get_sentences"
45
44
  end
46
45
  # resource path
47
- local_var_path = "/nlp-v2/segmentation/sentences"
46
+ local_var_path = '/nlp-v2/segmentation/sentences'
48
47
 
49
48
  # query parameters
50
49
  query_params = {}
@@ -52,7 +51,7 @@ module CloudmersiveNlpApiClient
52
51
  # header parameters
53
52
  header_params = {}
54
53
  # HTTP header 'Accept' (if needed)
55
- header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/json', 'application/xml', 'text/xml'])
54
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
56
55
  # HTTP header 'Content-Type'
57
56
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'text/json', 'application/xml', 'text/xml', 'application/x-www-form-urlencoded'])
58
57
 
@@ -74,7 +73,6 @@ module CloudmersiveNlpApiClient
74
73
  end
75
74
  return data, status_code, headers
76
75
  end
77
-
78
76
  # Get words in input string
79
77
  # Get the component words in an input string
80
78
  # @param input String to process
@@ -82,7 +80,7 @@ module CloudmersiveNlpApiClient
82
80
  # @return [GetWordsResponse]
83
81
  def segmentation_get_words(input, opts = {})
84
82
  data, _status_code, _headers = segmentation_get_words_with_http_info(input, opts)
85
- return data
83
+ data
86
84
  end
87
85
 
88
86
  # Get words in input string
@@ -92,14 +90,14 @@ module CloudmersiveNlpApiClient
92
90
  # @return [Array<(GetWordsResponse, Fixnum, Hash)>] GetWordsResponse data, response status code and response headers
93
91
  def segmentation_get_words_with_http_info(input, opts = {})
94
92
  if @api_client.config.debugging
95
- @api_client.config.logger.debug "Calling API: SegmentationApi.segmentation_get_words ..."
93
+ @api_client.config.logger.debug 'Calling API: SegmentationApi.segmentation_get_words ...'
96
94
  end
97
95
  # verify the required parameter 'input' is set
98
96
  if @api_client.config.client_side_validation && input.nil?
99
97
  fail ArgumentError, "Missing the required parameter 'input' when calling SegmentationApi.segmentation_get_words"
100
98
  end
101
99
  # resource path
102
- local_var_path = "/nlp-v2/segmentation/words"
100
+ local_var_path = '/nlp-v2/segmentation/words'
103
101
 
104
102
  # query parameters
105
103
  query_params = {}
@@ -107,7 +105,7 @@ module CloudmersiveNlpApiClient
107
105
  # header parameters
108
106
  header_params = {}
109
107
  # HTTP header 'Accept' (if needed)
110
- header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/json', 'application/xml', 'text/xml'])
108
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
111
109
  # HTTP header 'Content-Type'
112
110
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'text/json', 'application/xml', 'text/xml', 'application/x-www-form-urlencoded'])
113
111
 
@@ -6,11 +6,11 @@
6
6
  OpenAPI spec version: v1
7
7
 
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
- Swagger Codegen version: 2.3.1
9
+ Swagger Codegen version: 2.4.14
10
10
 
11
11
  =end
12
12
 
13
- require "uri"
13
+ require 'uri'
14
14
 
15
15
  module CloudmersiveNlpApiClient
16
16
  class SpellcheckApi
@@ -19,7 +19,6 @@ module CloudmersiveNlpApiClient
19
19
  def initialize(api_client = ApiClient.default)
20
20
  @api_client = api_client
21
21
  end
22
-
23
22
  # Check if sentence is spelled correctly
24
23
  # Checks whether the sentence is spelled correctly and returns the result as JSON
25
24
  # @param value Input sentence
@@ -27,7 +26,7 @@ module CloudmersiveNlpApiClient
27
26
  # @return [CheckSentenceResponse]
28
27
  def spellcheck_check_sentence(value, opts = {})
29
28
  data, _status_code, _headers = spellcheck_check_sentence_with_http_info(value, opts)
30
- return data
29
+ data
31
30
  end
32
31
 
33
32
  # Check if sentence is spelled correctly
@@ -37,14 +36,14 @@ module CloudmersiveNlpApiClient
37
36
  # @return [Array<(CheckSentenceResponse, Fixnum, Hash)>] CheckSentenceResponse data, response status code and response headers
38
37
  def spellcheck_check_sentence_with_http_info(value, opts = {})
39
38
  if @api_client.config.debugging
40
- @api_client.config.logger.debug "Calling API: SpellcheckApi.spellcheck_check_sentence ..."
39
+ @api_client.config.logger.debug 'Calling API: SpellcheckApi.spellcheck_check_sentence ...'
41
40
  end
42
41
  # verify the required parameter 'value' is set
43
42
  if @api_client.config.client_side_validation && value.nil?
44
43
  fail ArgumentError, "Missing the required parameter 'value' when calling SpellcheckApi.spellcheck_check_sentence"
45
44
  end
46
45
  # resource path
47
- local_var_path = "/nlp-v2/spellcheck/check/sentence"
46
+ local_var_path = '/nlp-v2/spellcheck/check/sentence'
48
47
 
49
48
  # query parameters
50
49
  query_params = {}
@@ -52,7 +51,7 @@ module CloudmersiveNlpApiClient
52
51
  # header parameters
53
52
  header_params = {}
54
53
  # HTTP header 'Accept' (if needed)
55
- header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/json', 'application/xml', 'text/xml'])
54
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
56
55
  # HTTP header 'Content-Type'
57
56
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'text/json', 'application/xml', 'text/xml', 'application/x-www-form-urlencoded'])
58
57
 
@@ -74,7 +73,6 @@ module CloudmersiveNlpApiClient
74
73
  end
75
74
  return data, status_code, headers
76
75
  end
77
-
78
76
  # Find spelling corrections
79
77
  # Find spelling correction suggestions and return result as JSON
80
78
  # @param value Input string
@@ -82,7 +80,7 @@ module CloudmersiveNlpApiClient
82
80
  # @return [CheckWordResponse]
83
81
  def spellcheck_correct_json(value, opts = {})
84
82
  data, _status_code, _headers = spellcheck_correct_json_with_http_info(value, opts)
85
- return data
83
+ data
86
84
  end
87
85
 
88
86
  # Find spelling corrections
@@ -92,14 +90,14 @@ module CloudmersiveNlpApiClient
92
90
  # @return [Array<(CheckWordResponse, Fixnum, Hash)>] CheckWordResponse data, response status code and response headers
93
91
  def spellcheck_correct_json_with_http_info(value, opts = {})
94
92
  if @api_client.config.debugging
95
- @api_client.config.logger.debug "Calling API: SpellcheckApi.spellcheck_correct_json ..."
93
+ @api_client.config.logger.debug 'Calling API: SpellcheckApi.spellcheck_correct_json ...'
96
94
  end
97
95
  # verify the required parameter 'value' is set
98
96
  if @api_client.config.client_side_validation && value.nil?
99
97
  fail ArgumentError, "Missing the required parameter 'value' when calling SpellcheckApi.spellcheck_correct_json"
100
98
  end
101
99
  # resource path
102
- local_var_path = "/nlp-v2/spellcheck/check/word"
100
+ local_var_path = '/nlp-v2/spellcheck/check/word'
103
101
 
104
102
  # query parameters
105
103
  query_params = {}
@@ -107,7 +105,7 @@ module CloudmersiveNlpApiClient
107
105
  # header parameters
108
106
  header_params = {}
109
107
  # HTTP header 'Accept' (if needed)
110
- header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/json', 'application/xml', 'text/xml'])
108
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
111
109
  # HTTP header 'Content-Type'
112
110
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'text/json', 'application/xml', 'text/xml', 'application/x-www-form-urlencoded'])
113
111
 
@@ -6,7 +6,7 @@
6
6
  OpenAPI spec version: v1
7
7
 
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
- Swagger Codegen version: 2.3.1
9
+ Swagger Codegen version: 2.4.14
10
10
 
11
11
  =end
12
12
 
@@ -33,7 +33,7 @@ module CloudmersiveNlpApiClient
33
33
  @config = config
34
34
  @user_agent = "Swagger-Codegen/#{VERSION}/ruby"
35
35
  @default_headers = {
36
- 'Content-Type' => "application/json",
36
+ 'Content-Type' => 'application/json',
37
37
  'User-Agent' => @user_agent
38
38
  }
39
39
  end
@@ -112,6 +112,8 @@ module CloudmersiveNlpApiClient
112
112
  :verbose => @config.debugging
113
113
  }
114
114
 
115
+ req_opts.merge!(multipart: true) if header_params['Content-Type'].start_with? "multipart/"
116
+
115
117
  # set custom cert, if provided
116
118
  req_opts[:cainfo] = @config.ssl_ca_cert if @config.ssl_ca_cert
117
119
 
@@ -137,7 +139,7 @@ module CloudmersiveNlpApiClient
137
139
  # @param [String] mime MIME
138
140
  # @return [Boolean] True if the MIME is application/json
139
141
  def json_mime?(mime)
140
- (mime == "*/*") || !(mime =~ /Application\/.*json(?!p)(;.*)?/i).nil?
142
+ (mime == '*/*') || !(mime =~ /Application\/.*json(?!p)(;.*)?/i).nil?
141
143
  end
142
144
 
143
145
  # Deserialize the response to the given return type.
@@ -201,12 +203,12 @@ module CloudmersiveNlpApiClient
201
203
  when /\AArray<(.+)>\z/
202
204
  # e.g. Array<Pet>
203
205
  sub_type = $1
204
- data.map {|item| convert_to_type(item, sub_type) }
206
+ data.map { |item| convert_to_type(item, sub_type) }
205
207
  when /\AHash\<String, (.+)\>\z/
206
208
  # e.g. Hash<String, Integer>
207
209
  sub_type = $1
208
210
  {}.tap do |hash|
209
- data.each {|k, v| hash[k] = convert_to_type(v, sub_type) }
211
+ data.each { |k, v| hash[k] = convert_to_type(v, sub_type) }
210
212
  end
211
213
  else
212
214
  # models, e.g. Pet
@@ -228,7 +230,7 @@ module CloudmersiveNlpApiClient
228
230
  encoding = nil
229
231
  request.on_headers do |response|
230
232
  content_disposition = response.headers['Content-Disposition']
231
- if content_disposition and content_disposition =~ /filename=/i
233
+ if content_disposition && content_disposition =~ /filename=/i
232
234
  filename = content_disposition[/filename=['"]?([^'"\s]+)['"]?/, 1]
233
235
  prefix = sanitize_filename(filename)
234
236
  else
@@ -327,7 +329,7 @@ module CloudmersiveNlpApiClient
327
329
  return nil if accepts.nil? || accepts.empty?
328
330
  # use JSON when present, otherwise use all of the provided
329
331
  json_accept = accepts.find { |s| json_mime?(s) }
330
- return json_accept || accepts.join(',')
332
+ json_accept || accepts.join(',')
331
333
  end
332
334
 
333
335
  # Return Content-Type header based on an array of content types provided.
@@ -338,7 +340,7 @@ module CloudmersiveNlpApiClient
338
340
  return 'application/json' if content_types.nil? || content_types.empty?
339
341
  # use JSON when present, otherwise use the first one
340
342
  json_content_type = content_types.find { |s| json_mime?(s) }
341
- return json_content_type || content_types.first
343
+ json_content_type || content_types.first
342
344
  end
343
345
 
344
346
  # Convert object (array, hash, object, etc) to JSON string.
@@ -348,7 +350,7 @@ module CloudmersiveNlpApiClient
348
350
  return model if model.nil? || model.is_a?(String)
349
351
  local_body = nil
350
352
  if model.is_a?(Array)
351
- local_body = model.map{|m| object_to_hash(m) }
353
+ local_body = model.map { |m| object_to_hash(m) }
352
354
  else
353
355
  local_body = object_to_hash(model)
354
356
  end
@@ -6,7 +6,7 @@
6
6
  OpenAPI spec version: v1
7
7
 
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
- Swagger Codegen version: 2.3.1
9
+ Swagger Codegen version: 2.4.14
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  OpenAPI spec version: v1
7
7
 
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
- Swagger Codegen version: 2.3.1
9
+ Swagger Codegen version: 2.4.14
10
10
 
11
11
  =end
12
12
 
@@ -170,7 +170,7 @@ module CloudmersiveNlpApiClient
170
170
  def base_path=(base_path)
171
171
  # Add leading and trailing slashes to base_path
172
172
  @base_path = "/#{base_path}".gsub(/\/+/, '/')
173
- @base_path = "" if @base_path == "/"
173
+ @base_path = '' if @base_path == '/'
174
174
  end
175
175
 
176
176
  def base_url
@@ -6,7 +6,7 @@
6
6
  OpenAPI spec version: v1
7
7
 
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
- Swagger Codegen version: 2.3.1
9
+ Swagger Codegen version: 2.4.14
10
10
 
11
11
  =end
12
12
 
@@ -18,7 +18,6 @@ module CloudmersiveNlpApiClient
18
18
  # Input sentence for spell check
19
19
  attr_accessor :sentence
20
20
 
21
-
22
21
  # Attribute mapping from ruby-style variable name to JSON key.
23
22
  def self.attribute_map
24
23
  {
@@ -39,25 +38,24 @@ module CloudmersiveNlpApiClient
39
38
  return unless attributes.is_a?(Hash)
40
39
 
41
40
  # convert string to symbol for hash key
42
- attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
41
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
43
42
 
44
43
  if attributes.has_key?(:'Sentence')
45
44
  self.sentence = attributes[:'Sentence']
46
45
  end
47
-
48
46
  end
49
47
 
50
48
  # Show invalid properties with the reasons. Usually used together with valid?
51
49
  # @return Array for valid properties with the reasons
52
50
  def list_invalid_properties
53
51
  invalid_properties = Array.new
54
- return invalid_properties
52
+ invalid_properties
55
53
  end
56
54
 
57
55
  # Check to see if the all the properties in the model are valid
58
56
  # @return true if the model is valid
59
57
  def valid?
60
- return true
58
+ true
61
59
  end
62
60
 
63
61
  # Checks equality by comparing each attribute.
@@ -87,10 +85,10 @@ module CloudmersiveNlpApiClient
87
85
  return nil unless attributes.is_a?(Hash)
88
86
  self.class.swagger_types.each_pair do |key, type|
89
87
  if type =~ /\AArray<(.*)>/i
90
- # check to ensure the input is an array given that the the attribute
88
+ # check to ensure the input is an array given that the attribute
91
89
  # is documented as an array but the input is not
92
90
  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) } )
91
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
94
92
  end
95
93
  elsif !attributes[self.class.attribute_map[key]].nil?
96
94
  self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
@@ -172,7 +170,7 @@ module CloudmersiveNlpApiClient
172
170
  # @return [Hash] Returns the value in the form of hash
173
171
  def _to_hash(value)
174
172
  if value.is_a?(Array)
175
- value.compact.map{ |v| _to_hash(v) }
173
+ value.compact.map { |v| _to_hash(v) }
176
174
  elsif value.is_a?(Hash)
177
175
  {}.tap do |hash|
178
176
  value.each { |k, v| hash[k] = _to_hash(v) }
@@ -185,5 +183,4 @@ module CloudmersiveNlpApiClient
185
183
  end
186
184
 
187
185
  end
188
-
189
186
  end
@@ -6,7 +6,7 @@
6
6
  OpenAPI spec version: v1
7
7
 
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
- Swagger Codegen version: 2.3.1
9
+ Swagger Codegen version: 2.4.14
10
10
 
11
11
  =end
12
12
 
@@ -21,7 +21,6 @@ module CloudmersiveNlpApiClient
21
21
  # Words in the sentence, both correct and incorrect
22
22
  attr_accessor :words
23
23
 
24
-
25
24
  # Attribute mapping from ruby-style variable name to JSON key.
26
25
  def self.attribute_map
27
26
  {
@@ -44,7 +43,7 @@ module CloudmersiveNlpApiClient
44
43
  return unless attributes.is_a?(Hash)
45
44
 
46
45
  # convert string to symbol for hash key
47
- attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
46
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
48
47
 
49
48
  if attributes.has_key?(:'IncorrectCount')
50
49
  self.incorrect_count = attributes[:'IncorrectCount']
@@ -55,20 +54,19 @@ module CloudmersiveNlpApiClient
55
54
  self.words = value
56
55
  end
57
56
  end
58
-
59
57
  end
60
58
 
61
59
  # Show invalid properties with the reasons. Usually used together with valid?
62
60
  # @return Array for valid properties with the reasons
63
61
  def list_invalid_properties
64
62
  invalid_properties = Array.new
65
- return invalid_properties
63
+ invalid_properties
66
64
  end
67
65
 
68
66
  # Check to see if the all the properties in the model are valid
69
67
  # @return true if the model is valid
70
68
  def valid?
71
- return true
69
+ true
72
70
  end
73
71
 
74
72
  # Checks equality by comparing each attribute.
@@ -99,10 +97,10 @@ module CloudmersiveNlpApiClient
99
97
  return nil unless attributes.is_a?(Hash)
100
98
  self.class.swagger_types.each_pair do |key, type|
101
99
  if type =~ /\AArray<(.*)>/i
102
- # check to ensure the input is an array given that the the attribute
100
+ # check to ensure the input is an array given that the attribute
103
101
  # is documented as an array but the input is not
104
102
  if attributes[self.class.attribute_map[key]].is_a?(Array)
105
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
103
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
106
104
  end
107
105
  elsif !attributes[self.class.attribute_map[key]].nil?
108
106
  self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
@@ -184,7 +182,7 @@ module CloudmersiveNlpApiClient
184
182
  # @return [Hash] Returns the value in the form of hash
185
183
  def _to_hash(value)
186
184
  if value.is_a?(Array)
187
- value.compact.map{ |v| _to_hash(v) }
185
+ value.compact.map { |v| _to_hash(v) }
188
186
  elsif value.is_a?(Hash)
189
187
  {}.tap do |hash|
190
188
  value.each { |k, v| hash[k] = _to_hash(v) }
@@ -197,5 +195,4 @@ module CloudmersiveNlpApiClient
197
195
  end
198
196
 
199
197
  end
200
-
201
198
  end