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.
- checksums.yaml +4 -4
- data/Gemfile +7 -0
- data/README.md +162 -0
- data/Rakefile +8 -0
- data/cloudmersive-nlp-api-client.gemspec +45 -0
- data/docs/AnalyticsApi.md +283 -0
- data/docs/CheckSentenceRequest.md +8 -0
- data/docs/CheckSentenceResponse.md +9 -0
- data/docs/CheckWordRequest.md +8 -0
- data/docs/CheckWordResponse.md +9 -0
- data/docs/CorrectWordInSentence.md +10 -0
- data/docs/Entity.md +9 -0
- data/docs/ExtractEntitiesApi.md +63 -0
- data/docs/ExtractEntitiesRequest.md +8 -0
- data/docs/ExtractEntitiesResponse.md +9 -0
- data/docs/GetWordsRequest.md +8 -0
- data/docs/GetWordsResponse.md +8 -0
- data/docs/HateSpeechAnalysisRequest.md +8 -0
- data/docs/HateSpeechAnalysisResponse.md +10 -0
- data/docs/LanguageDetectionApi.md +63 -0
- data/docs/LanguageDetectionRequest.md +8 -0
- data/docs/LanguageDetectionResponse.md +10 -0
- data/docs/LanguageTranslationApi.md +338 -0
- data/docs/LanguageTranslationRequest.md +8 -0
- data/docs/LanguageTranslationResponse.md +10 -0
- data/docs/ParseApi.md +63 -0
- data/docs/ParseRequest.md +8 -0
- data/docs/ParseResponse.md +8 -0
- data/docs/PosRequest.md +8 -0
- data/docs/PosResponse.md +8 -0
- data/docs/PosSentence.md +8 -0
- data/docs/PosTaggedWord.md +9 -0
- data/docs/PosTaggerApi.md +338 -0
- data/docs/ProfanityAnalysisRequest.md +8 -0
- data/docs/ProfanityAnalysisResponse.md +10 -0
- data/docs/RephraseApi.md +63 -0
- data/docs/RephraseRequest.md +9 -0
- data/docs/RephraseResponse.md +10 -0
- data/docs/RephrasedSentence.md +10 -0
- data/docs/RephrasedSentenceOption.md +9 -0
- data/docs/SegmentationApi.md +118 -0
- data/docs/SentenceSegmentationRequest.md +8 -0
- data/docs/SentenceSegmentationResponse.md +10 -0
- data/docs/SentimentAnalysisRequest.md +8 -0
- data/docs/SentimentAnalysisResponse.md +11 -0
- data/docs/SimilarityAnalysisRequest.md +9 -0
- data/docs/SimilarityAnalysisResponse.md +10 -0
- data/docs/SpellcheckApi.md +118 -0
- data/docs/SubjectivityAnalysisRequest.md +8 -0
- data/docs/SubjectivityAnalysisResponse.md +10 -0
- data/docs/WordPosition.md +11 -0
- data/git_push.sh +55 -0
- data/lib/cloudmersive-nlp-api-client.rb +85 -0
- data/lib/cloudmersive-nlp-api-client/api/analytics_api.rb +293 -0
- data/lib/cloudmersive-nlp-api-client/api/extract_entities_api.rb +77 -0
- data/lib/cloudmersive-nlp-api-client/api/language_detection_api.rb +77 -0
- data/lib/cloudmersive-nlp-api-client/api/language_translation_api.rb +347 -0
- data/lib/cloudmersive-nlp-api-client/api/parse_api.rb +77 -0
- data/lib/cloudmersive-nlp-api-client/api/pos_tagger_api.rb +347 -0
- data/lib/cloudmersive-nlp-api-client/api/rephrase_api.rb +77 -0
- data/lib/cloudmersive-nlp-api-client/api/segmentation_api.rb +131 -0
- data/lib/cloudmersive-nlp-api-client/api/spellcheck_api.rb +131 -0
- data/lib/cloudmersive-nlp-api-client/api_client.rb +391 -0
- data/lib/cloudmersive-nlp-api-client/api_error.rb +38 -0
- data/lib/cloudmersive-nlp-api-client/configuration.rb +209 -0
- data/lib/cloudmersive-nlp-api-client/models/check_sentence_request.rb +186 -0
- data/lib/cloudmersive-nlp-api-client/models/check_sentence_response.rb +198 -0
- data/lib/cloudmersive-nlp-api-client/models/check_word_request.rb +184 -0
- data/lib/cloudmersive-nlp-api-client/models/check_word_response.rb +198 -0
- data/lib/cloudmersive-nlp-api-client/models/correct_word_in_sentence.rb +208 -0
- data/lib/cloudmersive-nlp-api-client/models/entity.rb +193 -0
- data/lib/cloudmersive-nlp-api-client/models/extract_entities_request.rb +186 -0
- data/lib/cloudmersive-nlp-api-client/models/extract_entities_response.rb +197 -0
- data/lib/cloudmersive-nlp-api-client/models/get_words_request.rb +184 -0
- data/lib/cloudmersive-nlp-api-client/models/get_words_response.rb +188 -0
- data/lib/cloudmersive-nlp-api-client/models/hate_speech_analysis_request.rb +186 -0
- data/lib/cloudmersive-nlp-api-client/models/hate_speech_analysis_response.rb +206 -0
- data/lib/cloudmersive-nlp-api-client/models/language_detection_request.rb +186 -0
- data/lib/cloudmersive-nlp-api-client/models/language_detection_response.rb +206 -0
- data/lib/cloudmersive-nlp-api-client/models/language_translation_request.rb +186 -0
- data/lib/cloudmersive-nlp-api-client/models/language_translation_response.rb +206 -0
- data/lib/cloudmersive-nlp-api-client/models/parse_request.rb +186 -0
- data/lib/cloudmersive-nlp-api-client/models/parse_response.rb +186 -0
- data/lib/cloudmersive-nlp-api-client/models/pos_request.rb +186 -0
- data/lib/cloudmersive-nlp-api-client/models/pos_response.rb +188 -0
- data/lib/cloudmersive-nlp-api-client/models/pos_sentence.rb +188 -0
- data/lib/cloudmersive-nlp-api-client/models/pos_tagged_word.rb +196 -0
- data/lib/cloudmersive-nlp-api-client/models/profanity_analysis_request.rb +186 -0
- data/lib/cloudmersive-nlp-api-client/models/profanity_analysis_response.rb +206 -0
- data/lib/cloudmersive-nlp-api-client/models/rephrase_request.rb +196 -0
- data/lib/cloudmersive-nlp-api-client/models/rephrase_response.rb +208 -0
- data/lib/cloudmersive-nlp-api-client/models/rephrased_sentence.rb +208 -0
- data/lib/cloudmersive-nlp-api-client/models/rephrased_sentence_option.rb +196 -0
- data/lib/cloudmersive-nlp-api-client/models/sentence_segmentation_request.rb +184 -0
- data/lib/cloudmersive-nlp-api-client/models/sentence_segmentation_response.rb +204 -0
- data/lib/cloudmersive-nlp-api-client/models/sentiment_analysis_request.rb +186 -0
- data/lib/cloudmersive-nlp-api-client/models/sentiment_analysis_response.rb +216 -0
- data/lib/cloudmersive-nlp-api-client/models/similarity_analysis_request.rb +196 -0
- data/lib/cloudmersive-nlp-api-client/models/similarity_analysis_response.rb +206 -0
- data/lib/cloudmersive-nlp-api-client/models/subjectivity_analysis_request.rb +186 -0
- data/lib/cloudmersive-nlp-api-client/models/subjectivity_analysis_response.rb +206 -0
- data/lib/cloudmersive-nlp-api-client/models/word_position.rb +215 -0
- data/lib/cloudmersive-nlp-api-client/version.rb +15 -0
- data/spec/api/analytics_api_spec.rb +95 -0
- data/spec/api/extract_entities_api_spec.rb +47 -0
- data/spec/api/language_detection_api_spec.rb +47 -0
- data/spec/api/language_translation_api_spec.rb +107 -0
- data/spec/api/parse_api_spec.rb +47 -0
- data/spec/api/pos_tagger_api_spec.rb +107 -0
- data/spec/api/rephrase_api_spec.rb +47 -0
- data/spec/api/segmentation_api_spec.rb +59 -0
- data/spec/api/spellcheck_api_spec.rb +59 -0
- data/spec/api_client_spec.rb +243 -0
- data/spec/configuration_spec.rb +42 -0
- data/spec/models/check_sentence_request_spec.rb +41 -0
- data/spec/models/check_sentence_response_spec.rb +47 -0
- data/spec/models/check_word_request_spec.rb +41 -0
- data/spec/models/check_word_response_spec.rb +47 -0
- data/spec/models/correct_word_in_sentence_spec.rb +53 -0
- data/spec/models/entity_spec.rb +47 -0
- data/spec/models/extract_entities_request_spec.rb +41 -0
- data/spec/models/extract_entities_response_spec.rb +47 -0
- data/spec/models/get_words_request_spec.rb +41 -0
- data/spec/models/get_words_response_spec.rb +41 -0
- data/spec/models/hate_speech_analysis_request_spec.rb +41 -0
- data/spec/models/hate_speech_analysis_response_spec.rb +53 -0
- data/spec/models/language_detection_request_spec.rb +41 -0
- data/spec/models/language_detection_response_spec.rb +53 -0
- data/spec/models/language_translation_request_spec.rb +41 -0
- data/spec/models/language_translation_response_spec.rb +53 -0
- data/spec/models/parse_request_spec.rb +41 -0
- data/spec/models/parse_response_spec.rb +41 -0
- data/spec/models/pos_request_spec.rb +41 -0
- data/spec/models/pos_response_spec.rb +41 -0
- data/spec/models/pos_sentence_spec.rb +41 -0
- data/spec/models/pos_tagged_word_spec.rb +47 -0
- data/spec/models/profanity_analysis_request_spec.rb +41 -0
- data/spec/models/profanity_analysis_response_spec.rb +53 -0
- data/spec/models/rephrase_request_spec.rb +47 -0
- data/spec/models/rephrase_response_spec.rb +53 -0
- data/spec/models/rephrased_sentence_option_spec.rb +47 -0
- data/spec/models/rephrased_sentence_spec.rb +53 -0
- data/spec/models/sentence_segmentation_request_spec.rb +41 -0
- data/spec/models/sentence_segmentation_response_spec.rb +53 -0
- data/spec/models/sentiment_analysis_request_spec.rb +41 -0
- data/spec/models/sentiment_analysis_response_spec.rb +59 -0
- data/spec/models/similarity_analysis_request_spec.rb +47 -0
- data/spec/models/similarity_analysis_response_spec.rb +53 -0
- data/spec/models/subjectivity_analysis_request_spec.rb +41 -0
- data/spec/models/subjectivity_analysis_response_spec.rb +53 -0
- data/spec/models/word_position_spec.rb +59 -0
- data/spec/spec_helper.rb +111 -0
- metadata +154 -3
@@ -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 LanguageDetectionApi
|
17
|
+
attr_accessor :api_client
|
18
|
+
|
19
|
+
def initialize(api_client = ApiClient.default)
|
20
|
+
@api_client = api_client
|
21
|
+
end
|
22
|
+
# Detect language of text
|
23
|
+
# Automatically determine which language a text string is written in. Supports Danish (DAN), German (DEU), English (ENG), French (FRA), Italian (ITA), Japanese (JPN), Korean (KOR), Dutch (NLD), Norwegian (NOR), Portuguese (POR), Russian (RUS), Spanish (SPA), Swedish (SWE), Chinese (ZHO).
|
24
|
+
# @param input
|
25
|
+
# @param [Hash] opts the optional parameters
|
26
|
+
# @return [LanguageDetectionResponse]
|
27
|
+
def language_detection_get_language(input, opts = {})
|
28
|
+
data, _status_code, _headers = language_detection_get_language_with_http_info(input, opts)
|
29
|
+
data
|
30
|
+
end
|
31
|
+
|
32
|
+
# Detect language of text
|
33
|
+
# Automatically determine which language a text string is written in. Supports Danish (DAN), German (DEU), English (ENG), French (FRA), Italian (ITA), Japanese (JPN), Korean (KOR), Dutch (NLD), Norwegian (NOR), Portuguese (POR), Russian (RUS), Spanish (SPA), Swedish (SWE), Chinese (ZHO).
|
34
|
+
# @param input
|
35
|
+
# @param [Hash] opts the optional parameters
|
36
|
+
# @return [Array<(LanguageDetectionResponse, Fixnum, Hash)>] LanguageDetectionResponse data, response status code and response headers
|
37
|
+
def language_detection_get_language_with_http_info(input, opts = {})
|
38
|
+
if @api_client.config.debugging
|
39
|
+
@api_client.config.logger.debug 'Calling API: LanguageDetectionApi.language_detection_get_language ...'
|
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 LanguageDetectionApi.language_detection_get_language"
|
44
|
+
end
|
45
|
+
# resource path
|
46
|
+
local_var_path = '/nlp-v2/language/detect'
|
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 => 'LanguageDetectionResponse')
|
71
|
+
if @api_client.config.debugging
|
72
|
+
@api_client.config.logger.debug "API called: LanguageDetectionApi#language_detection_get_language\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
73
|
+
end
|
74
|
+
return data, status_code, headers
|
75
|
+
end
|
76
|
+
end
|
77
|
+
end
|
@@ -0,0 +1,347 @@
|
|
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 LanguageTranslationApi
|
17
|
+
attr_accessor :api_client
|
18
|
+
|
19
|
+
def initialize(api_client = ApiClient.default)
|
20
|
+
@api_client = api_client
|
21
|
+
end
|
22
|
+
# Translate German to English text with Deep Learning AI
|
23
|
+
# Automatically translates input text in German to output text in English using advanced Deep Learning and Neural NLP. Consumes 1-2 API calls per input sentence.
|
24
|
+
# @param input Input translation request
|
25
|
+
# @param [Hash] opts the optional parameters
|
26
|
+
# @return [LanguageTranslationResponse]
|
27
|
+
def language_translation_translate_deu_to_eng(input, opts = {})
|
28
|
+
data, _status_code, _headers = language_translation_translate_deu_to_eng_with_http_info(input, opts)
|
29
|
+
data
|
30
|
+
end
|
31
|
+
|
32
|
+
# Translate German to English text with Deep Learning AI
|
33
|
+
# Automatically translates input text in German to output text in English using advanced Deep Learning and Neural NLP. Consumes 1-2 API calls per input sentence.
|
34
|
+
# @param input Input translation request
|
35
|
+
# @param [Hash] opts the optional parameters
|
36
|
+
# @return [Array<(LanguageTranslationResponse, Fixnum, Hash)>] LanguageTranslationResponse data, response status code and response headers
|
37
|
+
def language_translation_translate_deu_to_eng_with_http_info(input, opts = {})
|
38
|
+
if @api_client.config.debugging
|
39
|
+
@api_client.config.logger.debug 'Calling API: LanguageTranslationApi.language_translation_translate_deu_to_eng ...'
|
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 LanguageTranslationApi.language_translation_translate_deu_to_eng"
|
44
|
+
end
|
45
|
+
# resource path
|
46
|
+
local_var_path = '/nlp-v2/translate/language/deu/to/eng'
|
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 => 'LanguageTranslationResponse')
|
71
|
+
if @api_client.config.debugging
|
72
|
+
@api_client.config.logger.debug "API called: LanguageTranslationApi#language_translation_translate_deu_to_eng\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
73
|
+
end
|
74
|
+
return data, status_code, headers
|
75
|
+
end
|
76
|
+
# Translate English to German text with Deep Learning AI
|
77
|
+
# Automatically translates input text in English to output text in German using advanced Deep Learning and Neural NLP. Consumes 1-2 API calls per input sentence.
|
78
|
+
# @param input Input translation request
|
79
|
+
# @param [Hash] opts the optional parameters
|
80
|
+
# @return [LanguageTranslationResponse]
|
81
|
+
def language_translation_translate_eng_to_deu(input, opts = {})
|
82
|
+
data, _status_code, _headers = language_translation_translate_eng_to_deu_with_http_info(input, opts)
|
83
|
+
data
|
84
|
+
end
|
85
|
+
|
86
|
+
# Translate English to German text with Deep Learning AI
|
87
|
+
# Automatically translates input text in English to output text in German using advanced Deep Learning and Neural NLP. Consumes 1-2 API calls per input sentence.
|
88
|
+
# @param input Input translation request
|
89
|
+
# @param [Hash] opts the optional parameters
|
90
|
+
# @return [Array<(LanguageTranslationResponse, Fixnum, Hash)>] LanguageTranslationResponse data, response status code and response headers
|
91
|
+
def language_translation_translate_eng_to_deu_with_http_info(input, opts = {})
|
92
|
+
if @api_client.config.debugging
|
93
|
+
@api_client.config.logger.debug 'Calling API: LanguageTranslationApi.language_translation_translate_eng_to_deu ...'
|
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 LanguageTranslationApi.language_translation_translate_eng_to_deu"
|
98
|
+
end
|
99
|
+
# resource path
|
100
|
+
local_var_path = '/nlp-v2/translate/language/eng/to/deu'
|
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 => 'LanguageTranslationResponse')
|
125
|
+
if @api_client.config.debugging
|
126
|
+
@api_client.config.logger.debug "API called: LanguageTranslationApi#language_translation_translate_eng_to_deu\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
127
|
+
end
|
128
|
+
return data, status_code, headers
|
129
|
+
end
|
130
|
+
# Translate English to French text with Deep Learning AI
|
131
|
+
# Automatically translates input text in English to output text in French using advanced Deep Learning and Neural NLP. Consumes 1-2 API calls per input sentence.
|
132
|
+
# @param input Input translation request
|
133
|
+
# @param [Hash] opts the optional parameters
|
134
|
+
# @return [LanguageTranslationResponse]
|
135
|
+
def language_translation_translate_eng_to_fra(input, opts = {})
|
136
|
+
data, _status_code, _headers = language_translation_translate_eng_to_fra_with_http_info(input, opts)
|
137
|
+
data
|
138
|
+
end
|
139
|
+
|
140
|
+
# Translate English to French text with Deep Learning AI
|
141
|
+
# Automatically translates input text in English to output text in French using advanced Deep Learning and Neural NLP. Consumes 1-2 API calls per input sentence.
|
142
|
+
# @param input Input translation request
|
143
|
+
# @param [Hash] opts the optional parameters
|
144
|
+
# @return [Array<(LanguageTranslationResponse, Fixnum, Hash)>] LanguageTranslationResponse data, response status code and response headers
|
145
|
+
def language_translation_translate_eng_to_fra_with_http_info(input, opts = {})
|
146
|
+
if @api_client.config.debugging
|
147
|
+
@api_client.config.logger.debug 'Calling API: LanguageTranslationApi.language_translation_translate_eng_to_fra ...'
|
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 LanguageTranslationApi.language_translation_translate_eng_to_fra"
|
152
|
+
end
|
153
|
+
# resource path
|
154
|
+
local_var_path = '/nlp-v2/translate/language/eng/to/fra'
|
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 => 'LanguageTranslationResponse')
|
179
|
+
if @api_client.config.debugging
|
180
|
+
@api_client.config.logger.debug "API called: LanguageTranslationApi#language_translation_translate_eng_to_fra\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
181
|
+
end
|
182
|
+
return data, status_code, headers
|
183
|
+
end
|
184
|
+
# Translate English to Russian text with Deep Learning AI
|
185
|
+
# Automatically translates input text in English to output text in Russian using advanced Deep Learning and Neural NLP. Consumes 1-2 API calls per input sentence.
|
186
|
+
# @param input Input translation request
|
187
|
+
# @param [Hash] opts the optional parameters
|
188
|
+
# @return [LanguageTranslationResponse]
|
189
|
+
def language_translation_translate_eng_to_rus(input, opts = {})
|
190
|
+
data, _status_code, _headers = language_translation_translate_eng_to_rus_with_http_info(input, opts)
|
191
|
+
data
|
192
|
+
end
|
193
|
+
|
194
|
+
# Translate English to Russian text with Deep Learning AI
|
195
|
+
# Automatically translates input text in English to output text in Russian using advanced Deep Learning and Neural NLP. Consumes 1-2 API calls per input sentence.
|
196
|
+
# @param input Input translation request
|
197
|
+
# @param [Hash] opts the optional parameters
|
198
|
+
# @return [Array<(LanguageTranslationResponse, Fixnum, Hash)>] LanguageTranslationResponse data, response status code and response headers
|
199
|
+
def language_translation_translate_eng_to_rus_with_http_info(input, opts = {})
|
200
|
+
if @api_client.config.debugging
|
201
|
+
@api_client.config.logger.debug 'Calling API: LanguageTranslationApi.language_translation_translate_eng_to_rus ...'
|
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 LanguageTranslationApi.language_translation_translate_eng_to_rus"
|
206
|
+
end
|
207
|
+
# resource path
|
208
|
+
local_var_path = '/nlp-v2/translate/language/eng/to/rus'
|
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 => 'LanguageTranslationResponse')
|
233
|
+
if @api_client.config.debugging
|
234
|
+
@api_client.config.logger.debug "API called: LanguageTranslationApi#language_translation_translate_eng_to_rus\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
235
|
+
end
|
236
|
+
return data, status_code, headers
|
237
|
+
end
|
238
|
+
# Translate French to English text with Deep Learning AI
|
239
|
+
# Automatically translates input text in French to output text in English using advanced Deep Learning and Neural NLP. Consumes 1-2 API calls per input sentence.
|
240
|
+
# @param input Input translation request
|
241
|
+
# @param [Hash] opts the optional parameters
|
242
|
+
# @return [LanguageTranslationResponse]
|
243
|
+
def language_translation_translate_fra_to_eng(input, opts = {})
|
244
|
+
data, _status_code, _headers = language_translation_translate_fra_to_eng_with_http_info(input, opts)
|
245
|
+
data
|
246
|
+
end
|
247
|
+
|
248
|
+
# Translate French to English text with Deep Learning AI
|
249
|
+
# Automatically translates input text in French to output text in English using advanced Deep Learning and Neural NLP. Consumes 1-2 API calls per input sentence.
|
250
|
+
# @param input Input translation request
|
251
|
+
# @param [Hash] opts the optional parameters
|
252
|
+
# @return [Array<(LanguageTranslationResponse, Fixnum, Hash)>] LanguageTranslationResponse data, response status code and response headers
|
253
|
+
def language_translation_translate_fra_to_eng_with_http_info(input, opts = {})
|
254
|
+
if @api_client.config.debugging
|
255
|
+
@api_client.config.logger.debug 'Calling API: LanguageTranslationApi.language_translation_translate_fra_to_eng ...'
|
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 LanguageTranslationApi.language_translation_translate_fra_to_eng"
|
260
|
+
end
|
261
|
+
# resource path
|
262
|
+
local_var_path = '/nlp-v2/translate/language/fra/to/eng'
|
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 => 'LanguageTranslationResponse')
|
287
|
+
if @api_client.config.debugging
|
288
|
+
@api_client.config.logger.debug "API called: LanguageTranslationApi#language_translation_translate_fra_to_eng\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
289
|
+
end
|
290
|
+
return data, status_code, headers
|
291
|
+
end
|
292
|
+
# Translate Russian to English text with Deep Learning AI
|
293
|
+
# Automatically translates input text in Russian to output text in English using advanced Deep Learning and Neural NLP. Consumes 1-2 API calls per input sentence.
|
294
|
+
# @param input Input translation request
|
295
|
+
# @param [Hash] opts the optional parameters
|
296
|
+
# @return [LanguageTranslationResponse]
|
297
|
+
def language_translation_translate_rus_to_eng(input, opts = {})
|
298
|
+
data, _status_code, _headers = language_translation_translate_rus_to_eng_with_http_info(input, opts)
|
299
|
+
data
|
300
|
+
end
|
301
|
+
|
302
|
+
# Translate Russian to English text with Deep Learning AI
|
303
|
+
# Automatically translates input text in Russian to output text in English using advanced Deep Learning and Neural NLP. Consumes 1-2 API calls per input sentence.
|
304
|
+
# @param input Input translation request
|
305
|
+
# @param [Hash] opts the optional parameters
|
306
|
+
# @return [Array<(LanguageTranslationResponse, Fixnum, Hash)>] LanguageTranslationResponse data, response status code and response headers
|
307
|
+
def language_translation_translate_rus_to_eng_with_http_info(input, opts = {})
|
308
|
+
if @api_client.config.debugging
|
309
|
+
@api_client.config.logger.debug 'Calling API: LanguageTranslationApi.language_translation_translate_rus_to_eng ...'
|
310
|
+
end
|
311
|
+
# verify the required parameter 'input' is set
|
312
|
+
if @api_client.config.client_side_validation && input.nil?
|
313
|
+
fail ArgumentError, "Missing the required parameter 'input' when calling LanguageTranslationApi.language_translation_translate_rus_to_eng"
|
314
|
+
end
|
315
|
+
# resource path
|
316
|
+
local_var_path = '/nlp-v2/translate/language/rus/to/eng'
|
317
|
+
|
318
|
+
# query parameters
|
319
|
+
query_params = {}
|
320
|
+
|
321
|
+
# header parameters
|
322
|
+
header_params = {}
|
323
|
+
# HTTP header 'Accept' (if needed)
|
324
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
325
|
+
# HTTP header 'Content-Type'
|
326
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'text/json', 'application/xml', 'text/xml', 'application/x-www-form-urlencoded'])
|
327
|
+
|
328
|
+
# form parameters
|
329
|
+
form_params = {}
|
330
|
+
|
331
|
+
# http body (model)
|
332
|
+
post_body = @api_client.object_to_http_body(input)
|
333
|
+
auth_names = ['Apikey']
|
334
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
335
|
+
:header_params => header_params,
|
336
|
+
:query_params => query_params,
|
337
|
+
:form_params => form_params,
|
338
|
+
:body => post_body,
|
339
|
+
:auth_names => auth_names,
|
340
|
+
:return_type => 'LanguageTranslationResponse')
|
341
|
+
if @api_client.config.debugging
|
342
|
+
@api_client.config.logger.debug "API called: LanguageTranslationApi#language_translation_translate_rus_to_eng\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
343
|
+
end
|
344
|
+
return data, status_code, headers
|
345
|
+
end
|
346
|
+
end
|
347
|
+
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 ParseApi
|
17
|
+
attr_accessor :api_client
|
18
|
+
|
19
|
+
def initialize(api_client = ApiClient.default)
|
20
|
+
@api_client = api_client
|
21
|
+
end
|
22
|
+
# Parse string to syntax tree
|
23
|
+
# Parses the input string into a Penn Treebank syntax tree
|
24
|
+
# @param input Input string
|
25
|
+
# @param [Hash] opts the optional parameters
|
26
|
+
# @return [ParseResponse]
|
27
|
+
def parse_parse_string(input, opts = {})
|
28
|
+
data, _status_code, _headers = parse_parse_string_with_http_info(input, opts)
|
29
|
+
data
|
30
|
+
end
|
31
|
+
|
32
|
+
# Parse string to syntax tree
|
33
|
+
# Parses the input string into a Penn Treebank syntax tree
|
34
|
+
# @param input Input string
|
35
|
+
# @param [Hash] opts the optional parameters
|
36
|
+
# @return [Array<(ParseResponse, Fixnum, Hash)>] ParseResponse data, response status code and response headers
|
37
|
+
def parse_parse_string_with_http_info(input, opts = {})
|
38
|
+
if @api_client.config.debugging
|
39
|
+
@api_client.config.logger.debug 'Calling API: ParseApi.parse_parse_string ...'
|
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 ParseApi.parse_parse_string"
|
44
|
+
end
|
45
|
+
# resource path
|
46
|
+
local_var_path = '/nlp-v2/parse/tree'
|
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 => 'ParseResponse')
|
71
|
+
if @api_client.config.debugging
|
72
|
+
@api_client.config.logger.debug "API called: ParseApi#parse_parse_string\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
73
|
+
end
|
74
|
+
return data, status_code, headers
|
75
|
+
end
|
76
|
+
end
|
77
|
+
end
|