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,11 @@
1
+ # CloudmersiveNlpApiClient::WordPosition
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **word** | **String** | Word as a string | [optional]
7
+ **word_index** | **Integer** | Zero-based index of the word; first word has index 0, second word has index 1 and so on | [optional]
8
+ **start_position** | **Integer** | Zero-based character offset at which the word begins in the input string | [optional]
9
+ **end_position** | **Integer** | Zero-based character offset at which the word ends in the input string | [optional]
10
+
11
+
@@ -0,0 +1,55 @@
1
+ #!/bin/sh
2
+ #
3
+ # Generated by: https://github.com/swagger-api/swagger-codegen.git
4
+ #
5
+ # ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
6
+ #
7
+ # Usage example: /bin/sh ./git_push.sh wing328 swagger-petstore-perl "minor update"
8
+
9
+ git_user_id=$1
10
+ git_repo_id=$2
11
+ release_note=$3
12
+
13
+ if [ "$git_user_id" = "" ]; then
14
+ git_user_id="GIT_USER_ID"
15
+ echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id"
16
+ fi
17
+
18
+ if [ "$git_repo_id" = "" ]; then
19
+ git_repo_id="GIT_REPO_ID"
20
+ echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id"
21
+ fi
22
+
23
+ if [ "$release_note" = "" ]; then
24
+ release_note="Minor update"
25
+ echo "[INFO] No command line input provided. Set \$release_note to $release_note"
26
+ fi
27
+
28
+ # Initialize the local directory as a Git repository
29
+ git init
30
+
31
+ # Adds the files in the local repository and stages them for commit.
32
+ git add .
33
+
34
+ # Commits the tracked changes and prepares them to be pushed to a remote repository.
35
+ git commit -m "$release_note"
36
+
37
+ # Sets the new remote
38
+ git_remote=`git remote`
39
+ if [ "$git_remote" = "" ]; then # git remote not defined
40
+
41
+ if [ "$GIT_TOKEN" = "" ]; then
42
+ echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment."
43
+ git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git
44
+ else
45
+ git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git
46
+ fi
47
+
48
+ fi
49
+
50
+ git pull origin master
51
+
52
+ # Pushes (Forces) the changes in the local repository up to the remote repository
53
+ echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git"
54
+ git push origin master 2>&1 | grep -v 'To https'
55
+
@@ -0,0 +1,85 @@
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
+ # Common files
14
+ require 'cloudmersive-nlp-api-client/api_client'
15
+ require 'cloudmersive-nlp-api-client/api_error'
16
+ require 'cloudmersive-nlp-api-client/version'
17
+ require 'cloudmersive-nlp-api-client/configuration'
18
+
19
+ # Models
20
+ require 'cloudmersive-nlp-api-client/models/check_sentence_request'
21
+ require 'cloudmersive-nlp-api-client/models/check_sentence_response'
22
+ require 'cloudmersive-nlp-api-client/models/check_word_request'
23
+ require 'cloudmersive-nlp-api-client/models/check_word_response'
24
+ require 'cloudmersive-nlp-api-client/models/correct_word_in_sentence'
25
+ require 'cloudmersive-nlp-api-client/models/entity'
26
+ require 'cloudmersive-nlp-api-client/models/extract_entities_request'
27
+ require 'cloudmersive-nlp-api-client/models/extract_entities_response'
28
+ require 'cloudmersive-nlp-api-client/models/get_words_request'
29
+ require 'cloudmersive-nlp-api-client/models/get_words_response'
30
+ require 'cloudmersive-nlp-api-client/models/hate_speech_analysis_request'
31
+ require 'cloudmersive-nlp-api-client/models/hate_speech_analysis_response'
32
+ require 'cloudmersive-nlp-api-client/models/language_detection_request'
33
+ require 'cloudmersive-nlp-api-client/models/language_detection_response'
34
+ require 'cloudmersive-nlp-api-client/models/language_translation_request'
35
+ require 'cloudmersive-nlp-api-client/models/language_translation_response'
36
+ require 'cloudmersive-nlp-api-client/models/parse_request'
37
+ require 'cloudmersive-nlp-api-client/models/parse_response'
38
+ require 'cloudmersive-nlp-api-client/models/pos_request'
39
+ require 'cloudmersive-nlp-api-client/models/pos_response'
40
+ require 'cloudmersive-nlp-api-client/models/pos_sentence'
41
+ require 'cloudmersive-nlp-api-client/models/pos_tagged_word'
42
+ require 'cloudmersive-nlp-api-client/models/profanity_analysis_request'
43
+ require 'cloudmersive-nlp-api-client/models/profanity_analysis_response'
44
+ require 'cloudmersive-nlp-api-client/models/rephrase_request'
45
+ require 'cloudmersive-nlp-api-client/models/rephrase_response'
46
+ require 'cloudmersive-nlp-api-client/models/rephrased_sentence'
47
+ require 'cloudmersive-nlp-api-client/models/rephrased_sentence_option'
48
+ require 'cloudmersive-nlp-api-client/models/sentence_segmentation_request'
49
+ require 'cloudmersive-nlp-api-client/models/sentence_segmentation_response'
50
+ require 'cloudmersive-nlp-api-client/models/sentiment_analysis_request'
51
+ require 'cloudmersive-nlp-api-client/models/sentiment_analysis_response'
52
+ require 'cloudmersive-nlp-api-client/models/similarity_analysis_request'
53
+ require 'cloudmersive-nlp-api-client/models/similarity_analysis_response'
54
+ require 'cloudmersive-nlp-api-client/models/subjectivity_analysis_request'
55
+ require 'cloudmersive-nlp-api-client/models/subjectivity_analysis_response'
56
+ require 'cloudmersive-nlp-api-client/models/word_position'
57
+
58
+ # APIs
59
+ require 'cloudmersive-nlp-api-client/api/analytics_api'
60
+ require 'cloudmersive-nlp-api-client/api/extract_entities_api'
61
+ require 'cloudmersive-nlp-api-client/api/language_detection_api'
62
+ require 'cloudmersive-nlp-api-client/api/language_translation_api'
63
+ require 'cloudmersive-nlp-api-client/api/parse_api'
64
+ require 'cloudmersive-nlp-api-client/api/pos_tagger_api'
65
+ require 'cloudmersive-nlp-api-client/api/rephrase_api'
66
+ require 'cloudmersive-nlp-api-client/api/segmentation_api'
67
+ require 'cloudmersive-nlp-api-client/api/spellcheck_api'
68
+
69
+ module CloudmersiveNlpApiClient
70
+ class << self
71
+ # Customize default settings for the SDK using block.
72
+ # CloudmersiveNlpApiClient.configure do |config|
73
+ # config.username = "xxx"
74
+ # config.password = "xxx"
75
+ # end
76
+ # If no block given, return the default Configuration object.
77
+ def configure
78
+ if block_given?
79
+ yield(Configuration.default)
80
+ else
81
+ Configuration.default
82
+ end
83
+ end
84
+ end
85
+ end
@@ -0,0 +1,293 @@
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 'uri'
14
+
15
+ module CloudmersiveNlpApiClient
16
+ class AnalyticsApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Perform Hate Speech Analysis and Detection on Text
23
+ # 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.
24
+ # @param input Input hate speech analysis request
25
+ # @param [Hash] opts the optional parameters
26
+ # @return [HateSpeechAnalysisResponse]
27
+ def analytics_hate_speech(input, opts = {})
28
+ data, _status_code, _headers = analytics_hate_speech_with_http_info(input, opts)
29
+ data
30
+ end
31
+
32
+ # Perform Hate Speech Analysis and Detection on Text
33
+ # 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.
34
+ # @param input Input hate speech analysis request
35
+ # @param [Hash] opts the optional parameters
36
+ # @return [Array<(HateSpeechAnalysisResponse, Fixnum, Hash)>] HateSpeechAnalysisResponse data, response status code and response headers
37
+ def analytics_hate_speech_with_http_info(input, opts = {})
38
+ if @api_client.config.debugging
39
+ @api_client.config.logger.debug 'Calling API: AnalyticsApi.analytics_hate_speech ...'
40
+ end
41
+ # verify the required parameter 'input' is set
42
+ if @api_client.config.client_side_validation && input.nil?
43
+ fail ArgumentError, "Missing the required parameter 'input' when calling AnalyticsApi.analytics_hate_speech"
44
+ end
45
+ # resource path
46
+ local_var_path = '/nlp-v2/analytics/hate-speech'
47
+
48
+ # query parameters
49
+ query_params = {}
50
+
51
+ # header parameters
52
+ header_params = {}
53
+ # HTTP header 'Accept' (if needed)
54
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
55
+ # HTTP header 'Content-Type'
56
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'text/json', 'application/xml', 'text/xml', 'application/x-www-form-urlencoded'])
57
+
58
+ # form parameters
59
+ form_params = {}
60
+
61
+ # http body (model)
62
+ post_body = @api_client.object_to_http_body(input)
63
+ auth_names = ['Apikey']
64
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
65
+ :header_params => header_params,
66
+ :query_params => query_params,
67
+ :form_params => form_params,
68
+ :body => post_body,
69
+ :auth_names => auth_names,
70
+ :return_type => 'HateSpeechAnalysisResponse')
71
+ if @api_client.config.debugging
72
+ @api_client.config.logger.debug "API called: AnalyticsApi#analytics_hate_speech\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
73
+ end
74
+ return data, status_code, headers
75
+ end
76
+ # Perform Profanity and Obscene Language Analysis and Detection on Text
77
+ # 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.
78
+ # @param input Input profanity analysis request
79
+ # @param [Hash] opts the optional parameters
80
+ # @return [ProfanityAnalysisResponse]
81
+ def analytics_profanity(input, opts = {})
82
+ data, _status_code, _headers = analytics_profanity_with_http_info(input, opts)
83
+ data
84
+ end
85
+
86
+ # Perform Profanity and Obscene Language Analysis and Detection on Text
87
+ # 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.
88
+ # @param input Input profanity analysis request
89
+ # @param [Hash] opts the optional parameters
90
+ # @return [Array<(ProfanityAnalysisResponse, Fixnum, Hash)>] ProfanityAnalysisResponse data, response status code and response headers
91
+ def analytics_profanity_with_http_info(input, opts = {})
92
+ if @api_client.config.debugging
93
+ @api_client.config.logger.debug 'Calling API: AnalyticsApi.analytics_profanity ...'
94
+ end
95
+ # verify the required parameter 'input' is set
96
+ if @api_client.config.client_side_validation && input.nil?
97
+ fail ArgumentError, "Missing the required parameter 'input' when calling AnalyticsApi.analytics_profanity"
98
+ end
99
+ # resource path
100
+ local_var_path = '/nlp-v2/analytics/profanity'
101
+
102
+ # query parameters
103
+ query_params = {}
104
+
105
+ # header parameters
106
+ header_params = {}
107
+ # HTTP header 'Accept' (if needed)
108
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
109
+ # HTTP header 'Content-Type'
110
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'text/json', 'application/xml', 'text/xml', 'application/x-www-form-urlencoded'])
111
+
112
+ # form parameters
113
+ form_params = {}
114
+
115
+ # http body (model)
116
+ post_body = @api_client.object_to_http_body(input)
117
+ auth_names = ['Apikey']
118
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
119
+ :header_params => header_params,
120
+ :query_params => query_params,
121
+ :form_params => form_params,
122
+ :body => post_body,
123
+ :auth_names => auth_names,
124
+ :return_type => 'ProfanityAnalysisResponse')
125
+ if @api_client.config.debugging
126
+ @api_client.config.logger.debug "API called: AnalyticsApi#analytics_profanity\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
127
+ end
128
+ return data, status_code, headers
129
+ end
130
+ # Perform Sentiment Analysis and Classification on Text
131
+ # 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.
132
+ # @param input Input sentiment analysis request
133
+ # @param [Hash] opts the optional parameters
134
+ # @return [SentimentAnalysisResponse]
135
+ def analytics_sentiment(input, opts = {})
136
+ data, _status_code, _headers = analytics_sentiment_with_http_info(input, opts)
137
+ data
138
+ end
139
+
140
+ # Perform Sentiment Analysis and Classification on Text
141
+ # 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.
142
+ # @param input Input sentiment analysis request
143
+ # @param [Hash] opts the optional parameters
144
+ # @return [Array<(SentimentAnalysisResponse, Fixnum, Hash)>] SentimentAnalysisResponse data, response status code and response headers
145
+ def analytics_sentiment_with_http_info(input, opts = {})
146
+ if @api_client.config.debugging
147
+ @api_client.config.logger.debug 'Calling API: AnalyticsApi.analytics_sentiment ...'
148
+ end
149
+ # verify the required parameter 'input' is set
150
+ if @api_client.config.client_side_validation && input.nil?
151
+ fail ArgumentError, "Missing the required parameter 'input' when calling AnalyticsApi.analytics_sentiment"
152
+ end
153
+ # resource path
154
+ local_var_path = '/nlp-v2/analytics/sentiment'
155
+
156
+ # query parameters
157
+ query_params = {}
158
+
159
+ # header parameters
160
+ header_params = {}
161
+ # HTTP header 'Accept' (if needed)
162
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
163
+ # HTTP header 'Content-Type'
164
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'text/json', 'application/xml', 'text/xml', 'application/x-www-form-urlencoded'])
165
+
166
+ # form parameters
167
+ form_params = {}
168
+
169
+ # http body (model)
170
+ post_body = @api_client.object_to_http_body(input)
171
+ auth_names = ['Apikey']
172
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
173
+ :header_params => header_params,
174
+ :query_params => query_params,
175
+ :form_params => form_params,
176
+ :body => post_body,
177
+ :auth_names => auth_names,
178
+ :return_type => 'SentimentAnalysisResponse')
179
+ if @api_client.config.debugging
180
+ @api_client.config.logger.debug "API called: AnalyticsApi#analytics_sentiment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
181
+ end
182
+ return data, status_code, headers
183
+ end
184
+ # Perform Semantic Similarity Comparison of Two Strings
185
+ # 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.
186
+ # @param input Input similarity analysis request
187
+ # @param [Hash] opts the optional parameters
188
+ # @return [SimilarityAnalysisResponse]
189
+ def analytics_similarity(input, opts = {})
190
+ data, _status_code, _headers = analytics_similarity_with_http_info(input, opts)
191
+ data
192
+ end
193
+
194
+ # Perform Semantic Similarity Comparison of Two Strings
195
+ # 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.
196
+ # @param input Input similarity analysis request
197
+ # @param [Hash] opts the optional parameters
198
+ # @return [Array<(SimilarityAnalysisResponse, Fixnum, Hash)>] SimilarityAnalysisResponse data, response status code and response headers
199
+ def analytics_similarity_with_http_info(input, opts = {})
200
+ if @api_client.config.debugging
201
+ @api_client.config.logger.debug 'Calling API: AnalyticsApi.analytics_similarity ...'
202
+ end
203
+ # verify the required parameter 'input' is set
204
+ if @api_client.config.client_side_validation && input.nil?
205
+ fail ArgumentError, "Missing the required parameter 'input' when calling AnalyticsApi.analytics_similarity"
206
+ end
207
+ # resource path
208
+ local_var_path = '/nlp-v2/analytics/similarity'
209
+
210
+ # query parameters
211
+ query_params = {}
212
+
213
+ # header parameters
214
+ header_params = {}
215
+ # HTTP header 'Accept' (if needed)
216
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
217
+ # HTTP header 'Content-Type'
218
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'text/json', 'application/xml', 'text/xml', 'application/x-www-form-urlencoded'])
219
+
220
+ # form parameters
221
+ form_params = {}
222
+
223
+ # http body (model)
224
+ post_body = @api_client.object_to_http_body(input)
225
+ auth_names = ['Apikey']
226
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
227
+ :header_params => header_params,
228
+ :query_params => query_params,
229
+ :form_params => form_params,
230
+ :body => post_body,
231
+ :auth_names => auth_names,
232
+ :return_type => 'SimilarityAnalysisResponse')
233
+ if @api_client.config.debugging
234
+ @api_client.config.logger.debug "API called: AnalyticsApi#analytics_similarity\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
235
+ end
236
+ return data, status_code, headers
237
+ end
238
+ # Perform Subjectivity and Objectivity Analysis on Text
239
+ # 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.
240
+ # @param input Input subjectivity analysis request
241
+ # @param [Hash] opts the optional parameters
242
+ # @return [SubjectivityAnalysisResponse]
243
+ def analytics_subjectivity(input, opts = {})
244
+ data, _status_code, _headers = analytics_subjectivity_with_http_info(input, opts)
245
+ data
246
+ end
247
+
248
+ # Perform Subjectivity and Objectivity Analysis on Text
249
+ # 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.
250
+ # @param input Input subjectivity analysis request
251
+ # @param [Hash] opts the optional parameters
252
+ # @return [Array<(SubjectivityAnalysisResponse, Fixnum, Hash)>] SubjectivityAnalysisResponse data, response status code and response headers
253
+ def analytics_subjectivity_with_http_info(input, opts = {})
254
+ if @api_client.config.debugging
255
+ @api_client.config.logger.debug 'Calling API: AnalyticsApi.analytics_subjectivity ...'
256
+ end
257
+ # verify the required parameter 'input' is set
258
+ if @api_client.config.client_side_validation && input.nil?
259
+ fail ArgumentError, "Missing the required parameter 'input' when calling AnalyticsApi.analytics_subjectivity"
260
+ end
261
+ # resource path
262
+ local_var_path = '/nlp-v2/analytics/subjectivity'
263
+
264
+ # query parameters
265
+ query_params = {}
266
+
267
+ # header parameters
268
+ header_params = {}
269
+ # HTTP header 'Accept' (if needed)
270
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
271
+ # HTTP header 'Content-Type'
272
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'text/json', 'application/xml', 'text/xml', 'application/x-www-form-urlencoded'])
273
+
274
+ # form parameters
275
+ form_params = {}
276
+
277
+ # http body (model)
278
+ post_body = @api_client.object_to_http_body(input)
279
+ auth_names = ['Apikey']
280
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
281
+ :header_params => header_params,
282
+ :query_params => query_params,
283
+ :form_params => form_params,
284
+ :body => post_body,
285
+ :auth_names => auth_names,
286
+ :return_type => 'SubjectivityAnalysisResponse')
287
+ if @api_client.config.debugging
288
+ @api_client.config.logger.debug "API called: AnalyticsApi#analytics_subjectivity\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
289
+ end
290
+ return data, status_code, headers
291
+ end
292
+ end
293
+ end
@@ -0,0 +1,77 @@
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 'uri'
14
+
15
+ module CloudmersiveNlpApiClient
16
+ class ExtractEntitiesApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Extract entities from string
23
+ # Extract the named entitites from an input string.
24
+ # @param value Input string
25
+ # @param [Hash] opts the optional parameters
26
+ # @return [ExtractEntitiesResponse]
27
+ def extract_entities_post(value, opts = {})
28
+ data, _status_code, _headers = extract_entities_post_with_http_info(value, opts)
29
+ data
30
+ end
31
+
32
+ # Extract entities from string
33
+ # Extract the named entitites from an input string.
34
+ # @param value Input string
35
+ # @param [Hash] opts the optional parameters
36
+ # @return [Array<(ExtractEntitiesResponse, Fixnum, Hash)>] ExtractEntitiesResponse data, response status code and response headers
37
+ def extract_entities_post_with_http_info(value, opts = {})
38
+ if @api_client.config.debugging
39
+ @api_client.config.logger.debug 'Calling API: ExtractEntitiesApi.extract_entities_post ...'
40
+ end
41
+ # verify the required parameter 'value' is set
42
+ if @api_client.config.client_side_validation && value.nil?
43
+ fail ArgumentError, "Missing the required parameter 'value' when calling ExtractEntitiesApi.extract_entities_post"
44
+ end
45
+ # resource path
46
+ local_var_path = '/nlp-v2/extract-entities'
47
+
48
+ # query parameters
49
+ query_params = {}
50
+
51
+ # header parameters
52
+ header_params = {}
53
+ # HTTP header 'Accept' (if needed)
54
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
55
+ # HTTP header 'Content-Type'
56
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'text/json', 'application/xml', 'text/xml', 'application/x-www-form-urlencoded'])
57
+
58
+ # form parameters
59
+ form_params = {}
60
+
61
+ # http body (model)
62
+ post_body = @api_client.object_to_http_body(value)
63
+ auth_names = ['Apikey']
64
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
65
+ :header_params => header_params,
66
+ :query_params => query_params,
67
+ :form_params => form_params,
68
+ :body => post_body,
69
+ :auth_names => auth_names,
70
+ :return_type => 'ExtractEntitiesResponse')
71
+ if @api_client.config.debugging
72
+ @api_client.config.logger.debug "API called: ExtractEntitiesApi#extract_entities_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
73
+ end
74
+ return data, status_code, headers
75
+ end
76
+ end
77
+ end