aspose_html_cloud 19.5.0 → 19.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b985c4678fd31b9d1161ef1f330f7c946ede7b0730228022836ecd37b2d45539
4
- data.tar.gz: 7dc2cb8fc31f81717273a70c9de37a166f4725c8d2b44487f1bf5f5682ff1238
3
+ metadata.gz: 546e783723c252bceef52e6aebe5c15a80abd3c4c87a2fc9d9b1794dc5f01809
4
+ data.tar.gz: 1dd4b393b71ed0b7673ec3f0567c72ad6d06f82699cd73a44496ba128d28515e
5
5
  SHA512:
6
- metadata.gz: 8f6ff4c3161881a4bf64e456a50c461c3be3566e0dc827fbce6845605fdb69a1626c5de27ec3516bba3a86005a683d0b9dd02d89250789af2867604f3f6061b8
7
- data.tar.gz: 40c5f49f269f187e485a51cd234afae71356b0b2632ced0aeb68eab597f2636b00211084a0b5c59660ad8054bc787d7c319a0d5138880fd7f4172411a9ef93f6
6
+ metadata.gz: 4aa8b61bce0825826798072783524348514ce002ac5cd875447a0c97d23aaab64366885cedd7a9e484b9c8a998c18393f16479dc4894ecdf526063c940e48541
7
+ data.tar.gz: eaac3edbc89deedc87c85f378e9c83211327e4b336fe286ab156bf275979e2f204d6bfb0b6dc9bcc7248c5a8a53f173d9cfb946c845191390d2cb18a38134fe8
@@ -1923,412 +1923,6 @@ module AsposeHtml
1923
1923
  return data, status_code, headers
1924
1924
  end
1925
1925
 
1926
- ################################################################################
1927
- # OCR Api
1928
- ################################################################################
1929
-
1930
-
1931
- # Recognize text from the image file in the storage and import it to HTML format.
1932
- #
1933
- # @param name The image file name.
1934
- # @param [Hash] opts the optional parameters
1935
- # @option opts [String] :ocr_engine_lang OCR engine language - language (default to en)
1936
- # @option opts [String] :folder The source image folder.
1937
- # @option opts [String] :storage The source image storage.
1938
- # @return [Hash] {file: data, status: _status_code, headers: _headers}
1939
- def get_recognize_and_import_to_html(name, opts = {})
1940
- data, _status_code, _headers = get_recognize_and_import_to_html_with_http_info(name, opts)
1941
- return {file: data, status: _status_code, headers: _headers}
1942
- end
1943
-
1944
- # Recognize text from the image file in the storage and import it to HTML format.
1945
- #
1946
- # @param name The image file name.
1947
- # @param [Hash] opts the optional parameters
1948
- # @option opts [String] :ocr_engine_lang OCR engine language - language default "en"
1949
- # @option opts [String] :folder The source image folder.
1950
- # @option opts [String] :storage The source image storage.
1951
- # @return [Array<(File, Fixnum, Hash)>] File data, response status code and response headers
1952
- def get_recognize_and_import_to_html_with_http_info(name, opts = {})
1953
- if @api_client.config.debug
1954
- @api_client.config.logger.debug "Calling API: HtmlApi.get_recognize_and_import_to_html ..."
1955
- end
1956
- # verify the required parameter 'name' is set
1957
- if @api_client.config.client_side_validation && name.nil?
1958
- fail ArgumentError, "Missing the required parameter 'name' when calling HtmlApi.get_recognize_and_import_to_html"
1959
- end
1960
- # resource path
1961
- local_var_path = "/html/{name}/ocr/import".sub('{' + 'name' + '}', name.to_s)
1962
-
1963
- # query parameters
1964
- query_params = {}
1965
- if opts[:'ocr_engine_lang'].nil?
1966
- query_params[:'ocrEngineLang'] = "en"
1967
- else
1968
- query_params[:'ocrEngineLang'] = opts[:'ocr_engine_lang']
1969
- end
1970
-
1971
- query_params[:'folder'] = opts[:'folder'] if !opts[:'folder'].nil?
1972
- query_params[:'storage'] = opts[:'storage'] if !opts[:'storage'].nil?
1973
-
1974
- # header parameters
1975
- header_params = {}
1976
- # HTTP header 'Accept' (if needed)
1977
- header_params['Accept'] = @api_client.select_header_accept(['multipart/form-data'])
1978
- # HTTP header 'Content-Type'
1979
- header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
1980
-
1981
- # form parameters
1982
- form_params = {}
1983
-
1984
- # http body (model)
1985
- post_body = nil
1986
- data, status_code, headers = @api_client.call_api(:GET, local_var_path,
1987
- :header_params => header_params,
1988
- :query_params => query_params,
1989
- :form_params => form_params,
1990
- :body => post_body,
1991
- :return_type => 'File')
1992
- if @api_client.config.debug
1993
- @api_client.config.logger.debug "API called: HtmlApi#get_recognize_and_import_to_html\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1994
- end
1995
- return data, status_code, headers
1996
- end
1997
-
1998
- # Recognize text from the image file in the storage, import it to HTML format and translate to specified language.
1999
- #
2000
- # @param name The image file name.
2001
- # @param src_lang Source language - also supposed as the OCR engine language.
2002
- # @param res_lang Result language.
2003
- # @param [Hash] opts the optional parameters
2004
- # @option opts [String] :folder The source image folder.
2005
- # @option opts [String] :storage The source image storage.
2006
- # @return [Hash] {file: data, status: _status_code, headers: _headers}
2007
- def get_recognize_and_translate_to_html(name, src_lang, res_lang, opts = {})
2008
- data, _status_code, _headers = get_recognize_and_translate_to_html_with_http_info(name, src_lang, res_lang, opts)
2009
- return {file: data, status: _status_code, headers: _headers}
2010
- end
2011
-
2012
- # Recognize text from the image file in the storage, import it to HTML format and translate to specified language.
2013
- #
2014
- # @param name The image file name.
2015
- # @param src_lang Source language - also supposed as the OCR engine language.
2016
- # @param res_lang Result language.
2017
- # @param [Hash] opts the optional parameters
2018
- # @option opts [String] :folder The source image folder.
2019
- # @option opts [String] :storage The source image storage.
2020
- # @return [Array<(File, Fixnum, Hash)>] File data, response status code and response headers
2021
- def get_recognize_and_translate_to_html_with_http_info(name, src_lang, res_lang, opts = {})
2022
- if @api_client.config.debug
2023
- @api_client.config.logger.debug "Calling API: HtmlApi.get_recognize_and_translate_to_html ..."
2024
- end
2025
- # verify the required parameter 'name' is set
2026
- if @api_client.config.client_side_validation && name.nil?
2027
- fail ArgumentError, "Missing the required parameter 'name' when calling HtmlApi.get_recognize_and_translate_to_html"
2028
- end
2029
- # verify the required parameter 'src_lang' is set
2030
- if @api_client.config.client_side_validation && src_lang.nil?
2031
- fail ArgumentError, "Missing the required parameter 'src_lang' when calling HtmlApi.get_recognize_and_translate_to_html"
2032
- end
2033
- # verify the required parameter 'res_lang' is set
2034
- if @api_client.config.client_side_validation && res_lang.nil?
2035
- fail ArgumentError, "Missing the required parameter 'res_lang' when calling HtmlApi.get_recognize_and_translate_to_html"
2036
- end
2037
- # resource path
2038
- local_var_path = "/html/{name}/ocr/translate/{srcLang}/{resLang}"
2039
- .sub('{' + 'name' + '}', name.to_s)
2040
- .sub('{' + 'srcLang' + '}', src_lang.to_s)
2041
- .sub('{' + 'resLang' + '}', res_lang.to_s)
2042
-
2043
- # query parameters
2044
- query_params = {}
2045
- query_params[:'folder'] = opts[:'folder'] if !opts[:'folder'].nil?
2046
- query_params[:'storage'] = opts[:'storage'] if !opts[:'storage'].nil?
2047
-
2048
- # header parameters
2049
- header_params = {}
2050
- # HTTP header 'Accept' (if needed)
2051
- header_params['Accept'] = @api_client.select_header_accept(['multipart/form-data'])
2052
- # HTTP header 'Content-Type'
2053
- header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
2054
-
2055
- # form parameters
2056
- form_params = {}
2057
-
2058
- # http body (model)
2059
- post_body = nil
2060
- data, status_code, headers = @api_client.call_api(:GET, local_var_path,
2061
- :header_params => header_params,
2062
- :query_params => query_params,
2063
- :form_params => form_params,
2064
- :body => post_body,
2065
- :return_type => 'File')
2066
- if @api_client.config.debug
2067
- @api_client.config.logger.debug "API called: HtmlApi#get_recognize_and_translate_to_html\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
2068
- end
2069
- return data, status_code, headers
2070
- end
2071
-
2072
-
2073
- ################################################################################
2074
- # Translation Api
2075
- ################################################################################
2076
-
2077
-
2078
- # Translate the HTML document specified by the name from default or specified storage.
2079
- #
2080
- # @param name Document name.
2081
- # @param src_lang Source language.
2082
- # @param res_lang Result language.
2083
- # @param [Hash] opts the optional parameters
2084
- # @option opts [String] :storage The source document storage.
2085
- # @option opts [String] :folder The source document folder.
2086
- # @return [Hash] {file: data, status: _status_code, headers: _headers}
2087
- def get_translate_document(name, src_lang, res_lang, opts = {})
2088
- data, _status_code, _headers = get_translate_document_with_http_info(name, src_lang, res_lang, opts)
2089
- return {file: data, status: _status_code, headers: _headers}
2090
- end
2091
-
2092
- # Translate the HTML document specified by the name from default or specified storage.
2093
- #
2094
- # @param name Document name.
2095
- # @param src_lang Source language.
2096
- # @param res_lang Result language.
2097
- # @param [Hash] opts the optional parameters
2098
- # @option opts [String] :storage The source document storage.
2099
- # @option opts [String] :folder The source document folder.
2100
- # @return [Array<(File, Fixnum, Hash)>] File data, response status code and response headers
2101
- def get_translate_document_with_http_info(name, src_lang, res_lang, opts = {})
2102
- if @api_client.config.debug
2103
- @api_client.config.logger.debug "Calling API: HtmlApi.get_translate_document ..."
2104
- end
2105
- # verify the required parameter 'name' is set
2106
- if @api_client.config.client_side_validation && name.nil?
2107
- fail ArgumentError, "Missing the required parameter 'name' when calling HtmlApi.get_translate_document"
2108
- end
2109
- # verify the required parameter 'src_lang' is set
2110
- if @api_client.config.client_side_validation && src_lang.nil?
2111
- fail ArgumentError, "Missing the required parameter 'src_lang' when calling HtmlApi.get_translate_document"
2112
- end
2113
- # verify the required parameter 'res_lang' is set
2114
- if @api_client.config.client_side_validation && res_lang.nil?
2115
- fail ArgumentError, "Missing the required parameter 'res_lang' when calling HtmlApi.get_translate_document"
2116
- end
2117
- # resource path
2118
- local_var_path = "/html/{name}/translate/{srcLang}/{resLang}".sub('{' + 'name' + '}', name.to_s).sub('{' + 'srcLang' + '}', src_lang.to_s).sub('{' + 'resLang' + '}', res_lang.to_s)
2119
-
2120
- # query parameters
2121
- query_params = {}
2122
- query_params[:'storage'] = opts[:'storage'] if !opts[:'storage'].nil?
2123
- query_params[:'folder'] = opts[:'folder'] if !opts[:'folder'].nil?
2124
-
2125
- # header parameters
2126
- header_params = {}
2127
- # HTTP header 'Accept' (if needed)
2128
- header_params['Accept'] = @api_client.select_header_accept(['multipart/form-data'])
2129
- # HTTP header 'Content-Type'
2130
- header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
2131
-
2132
- # form parameters
2133
- form_params = {}
2134
-
2135
- # http body (model)
2136
- post_body = nil
2137
- data, status_code, headers = @api_client.call_api(:GET, local_var_path,
2138
- :header_params => header_params,
2139
- :query_params => query_params,
2140
- :form_params => form_params,
2141
- :body => post_body,
2142
- :return_type => 'File')
2143
- if @api_client.config.debug
2144
- @api_client.config.logger.debug "API called: HtmlApi#get_translate_document\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
2145
- end
2146
- return data, status_code, headers
2147
- end
2148
-
2149
- # Translate the HTML document from Web specified by its URL.
2150
- #
2151
- # @param source_url Source document URL.
2152
- # @param src_lang Source language.
2153
- # @param res_lang Result language.
2154
- # @return [Hash] {file: data, status: _status_code, headers: _headers}
2155
- def get_translate_document_by_url(source_url, src_lang, res_lang)
2156
- data, _status_code, _headers = get_translate_document_by_url_with_http_info(source_url, src_lang, res_lang)
2157
- return {file: data, status: _status_code, headers: _headers}
2158
- end
2159
-
2160
- # Translate the HTML document from Web specified by its URL.
2161
- #
2162
- # @param source_url Source document URL.
2163
- # @param src_lang Source language.
2164
- # @param res_lang Result language.
2165
- # @return [Array<(File, Fixnum, Hash)>] File data, response status code and response headers
2166
- def get_translate_document_by_url_with_http_info(source_url, src_lang, res_lang)
2167
- if @api_client.config.debug
2168
- @api_client.config.logger.debug "Calling API: HtmlApi.get_translate_document_by_url ..."
2169
- end
2170
- # verify the required parameter 'source_url' is set
2171
- if @api_client.config.client_side_validation && source_url.nil?
2172
- fail ArgumentError, "Missing the required parameter 'source_url' when calling HtmlApi.get_translate_document_by_url"
2173
- end
2174
- # verify the required parameter 'src_lang' is set
2175
- if @api_client.config.client_side_validation && src_lang.nil?
2176
- fail ArgumentError, "Missing the required parameter 'src_lang' when calling HtmlApi.get_translate_document_by_url"
2177
- end
2178
- # verify the required parameter 'res_lang' is set
2179
- if @api_client.config.client_side_validation && res_lang.nil?
2180
- fail ArgumentError, "Missing the required parameter 'res_lang' when calling HtmlApi.get_translate_document_by_url"
2181
- end
2182
- # resource path
2183
- local_var_path = "/html/translate/{srcLang}/{resLang}".sub('{' + 'srcLang' + '}', src_lang.to_s).sub('{' + 'resLang' + '}', res_lang.to_s)
2184
-
2185
- # query parameters
2186
- query_params = {}
2187
- query_params[:'sourceUrl'] = source_url
2188
-
2189
- # header parameters
2190
- header_params = {}
2191
- # HTTP header 'Accept' (if needed)
2192
- header_params['Accept'] = @api_client.select_header_accept(['multipart/form-data'])
2193
- # HTTP header 'Content-Type'
2194
- header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
2195
-
2196
- # form parameters
2197
- form_params = {}
2198
-
2199
- # http body (model)
2200
- post_body = nil
2201
- data, status_code, headers = @api_client.call_api(:GET, local_var_path,
2202
- :header_params => header_params,
2203
- :query_params => query_params,
2204
- :form_params => form_params,
2205
- :body => post_body,
2206
- :return_type => 'File')
2207
- if @api_client.config.debug
2208
- @api_client.config.logger.debug "API called: HtmlApi#get_translate_document_by_url\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
2209
- end
2210
- return data, status_code, headers
2211
- end
2212
-
2213
-
2214
- ################################################################################
2215
- # Summarization Api
2216
- ################################################################################
2217
-
2218
-
2219
- # Get the HTML document keywords using the keyword detection service.
2220
- #
2221
- # @param name Document name.
2222
- # @param [Hash] opts the optional parameters
2223
- # @option opts [String] :folder Document folder.
2224
- # @option opts [String] :storage Document storage.
2225
- # @return [Hash] {file: data, status: _status_code, headers: _headers}
2226
- def get_detect_html_keywords(name, opts = {})
2227
- data, _status_code, _headers = get_detect_html_keywords_with_http_info(name, opts)
2228
- return {file: data, status: _status_code, headers: _headers}
2229
- end
2230
-
2231
- # Get the HTML document keywords using the keyword detection service.
2232
- #
2233
- # @param name Document name.
2234
- # @param [Hash] opts the optional parameters
2235
- # @option opts [String] :folder Document folder.
2236
- # @option opts [String] :storage Document storage.
2237
- # @return [Array<(File, Fixnum, Hash)>] File data, response status code and response headers
2238
- def get_detect_html_keywords_with_http_info(name, opts = {})
2239
- if @api_client.config.debug
2240
- @api_client.config.logger.debug "Calling API: HtmlApi.get_detect_html_keywords ..."
2241
- end
2242
- # verify the required parameter 'name' is set
2243
- if @api_client.config.client_side_validation && name.nil?
2244
- fail ArgumentError, "Missing the required parameter 'name' when calling HtmlApi.get_detect_html_keywords"
2245
- end
2246
- # resource path
2247
- local_var_path = "/html/{name}/summ/keywords".sub('{' + 'name' + '}', name.to_s)
2248
-
2249
- # query parameters
2250
- query_params = {}
2251
- query_params[:'folder'] = opts[:'folder'] if !opts[:'folder'].nil?
2252
- query_params[:'storage'] = opts[:'storage'] if !opts[:'storage'].nil?
2253
-
2254
- # header parameters
2255
- header_params = {}
2256
- # HTTP header 'Accept' (if needed)
2257
- header_params['Accept'] = @api_client.select_header_accept(['application/json'])
2258
- # HTTP header 'Content-Type'
2259
- header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
2260
-
2261
- # form parameters
2262
- form_params = {}
2263
-
2264
- # http body (model)
2265
- post_body = nil
2266
- data, status_code, headers = @api_client.call_api(:GET, local_var_path,
2267
- :header_params => header_params,
2268
- :query_params => query_params,
2269
- :form_params => form_params,
2270
- :body => post_body,
2271
- :return_type => 'File')
2272
- if @api_client.config.debug
2273
- @api_client.config.logger.debug "API called: HtmlApi#get_detect_html_keywords\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
2274
- end
2275
- return data, status_code, headers
2276
- end
2277
-
2278
- # Get the keywords from HTML document from Web specified by its URL using the keyword detection service
2279
- #
2280
- # @param source_url Source document URL.
2281
- # @param [Hash] opts the optional parameters
2282
- # @return [Hash] {file: data, status: _status_code, headers: _headers}
2283
- def get_detect_html_keywords_by_url(source_url, opts = {})
2284
- data, _status_code, _headers = get_detect_html_keywords_by_url_with_http_info(source_url, opts)
2285
- return {file: data, status: _status_code, headers: _headers}
2286
- end
2287
-
2288
- # Get the keywords from HTML document from Web specified by its URL using the keyword detection service
2289
- #
2290
- # @param source_url Source document URL.
2291
- # @param [Hash] opts the optional parameters
2292
- # @return [Array<(File, Fixnum, Hash)>] File data, response status code and response headers
2293
- def get_detect_html_keywords_by_url_with_http_info(source_url, opts = {})
2294
- if @api_client.config.debug
2295
- @api_client.config.logger.debug "Calling API: HtmlApi.get_detect_html_keywords_by_url ..."
2296
- end
2297
- # verify the required parameter 'source_url' is set
2298
- if @api_client.config.client_side_validation && source_url.nil?
2299
- fail ArgumentError, "Missing the required parameter 'source_url' when calling HtmlApi.get_detect_html_keywords_by_url"
2300
- end
2301
- # resource path
2302
- local_var_path = "/html/summ/keywords"
2303
-
2304
- # query parameters
2305
- query_params = {}
2306
- query_params[:'sourceUrl'] = source_url
2307
-
2308
- # header parameters
2309
- header_params = {}
2310
- # HTTP header 'Accept' (if needed)
2311
- header_params['Accept'] = @api_client.select_header_accept(['application/json'])
2312
- # HTTP header 'Content-Type'
2313
- header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
2314
-
2315
- # form parameters
2316
- form_params = {}
2317
-
2318
- # http body (model)
2319
- post_body = nil
2320
- data, status_code, headers = @api_client.call_api(:GET, local_var_path,
2321
- :header_params => header_params,
2322
- :query_params => query_params,
2323
- :form_params => form_params,
2324
- :body => post_body,
2325
- :return_type => 'File')
2326
- if @api_client.config.debug
2327
- @api_client.config.logger.debug "API called: HtmlApi#get_detect_html_keywords_by_url\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
2328
- end
2329
- return data, status_code, headers
2330
- end
2331
-
2332
1926
  # Populate HTML document template with data located as a file in the storage.
2333
1927
  #
2334
1928
  # @param template_name Template document name. Template document is HTML or zipped HTML.
@@ -2363,188 +2363,6 @@ describe 'Test html_api' do
2363
2363
  end
2364
2364
  end
2365
2365
 
2366
- #################################################
2367
- # OCR API
2368
- #################################################
2369
-
2370
- # unit tests for get_recognize_and_import_to_html
2371
- # Recognize text from the image file in the storage and import it to HTML format.
2372
- #
2373
- # @param name The image file name.
2374
- # @param [Hash] opts the optional parameters
2375
- # @option opts [String] :ocr_engine_lang OCR engine language - language
2376
- # @option opts [String] :folder The source image folder.
2377
- # @option opts [String] :storage The source image storage.
2378
- # @return [Hash] {file: data, status: _status_code, headers: _headers}
2379
- describe 'get_recognize_and_import_to_html test' do
2380
- it "Recognize png" do
2381
- file_name = "test_ocr.png"
2382
- opts = {ocr_engine_lang: "en", folder: "HtmlTestDoc", storage: nil}
2383
-
2384
- # Upload file to server
2385
- res = upload_file_helper(file_name)
2386
- expect(res.uploaded.length).to eql(1)
2387
- expect(res.errors.length).to eql(0)
2388
-
2389
- answer = @instance.get_recognize_and_import_to_html(file_name, opts)
2390
-
2391
- expect(answer).to be_an_instance_of Hash
2392
- expect(answer[:file]).to be_an_instance_of File
2393
- expect(answer[:status]).to eql(200)
2394
-
2395
- # Save to test dir
2396
- save_to_test_dir(answer[:file], "Recognize_en_png.html")
2397
- end
2398
- end
2399
-
2400
- # unit tests for get_recognize_and_translate_to_html
2401
- # Recognize text from the image file in the storage, import it to HTML format and translate to specified language.
2402
- #
2403
- # @param name The image file name.
2404
- # @param src_lang Source language - also supposed as the OCR engine language.
2405
- # @param res_lang Result language.
2406
- # @param [Hash] opts the optional parameters
2407
- # @option opts [String] :folder The source image folder.
2408
- # @option opts [String] :storage The source image storage.
2409
- # @return [Hash] {file: data, status: _status_code, headers: _headers}
2410
- describe 'get_recognize_and_translate_to_html test' do
2411
- it "Recognize and translate jpg" do
2412
- file_name = "test_ocr.jpg"
2413
- src_lang = "en"
2414
- res_lang = "de"
2415
- opts = {folder: "HtmlTestDoc", storage: nil}
2416
-
2417
- # Upload file to server
2418
- res = upload_file_helper(file_name)
2419
- expect(res.uploaded.length).to eql(1)
2420
- expect(res.errors.length).to eql(0)
2421
-
2422
- answer = @instance.get_recognize_and_translate_to_html(file_name, src_lang, res_lang, opts)
2423
-
2424
- expect(answer).to be_an_instance_of Hash
2425
- expect(answer[:file]).to be_an_instance_of File
2426
- expect(answer[:status]).to eql(200)
2427
-
2428
- # Save to test dir
2429
- save_to_test_dir(answer[:file], "Recognize_en_de_jpg.html")
2430
- end
2431
- end
2432
-
2433
- #################################################
2434
- # Translation API
2435
- #################################################
2436
-
2437
- # unit tests for get_translate_document
2438
- # Translate the HTML document specified by the name from default or specified storage.
2439
- #
2440
- # @param name Document name.
2441
- # @param src_lang Source language.
2442
- # @param res_lang Result language.
2443
- # @param [Hash] opts the optional parameters
2444
- # @option opts [String] :storage The source document storage.
2445
- # @option opts [String] :folder The source document folder.
2446
- # @return [Hash] {file: data, status: _status_code, headers: _headers}
2447
- describe 'get_translate_document test' do
2448
- it "Translate document" do
2449
- file_name = "test_en.html"
2450
- src_lang = "en"
2451
- res_lang = "de"
2452
- opts = {storage: nil, folder: "HtmlTestDoc"}
2453
-
2454
- # Upload file to server
2455
- res = upload_file_helper(file_name)
2456
- expect(res.uploaded.length).to eql(1)
2457
- expect(res.errors.length).to eql(0)
2458
-
2459
- answer = @instance.get_translate_document(file_name, src_lang, res_lang, opts)
2460
-
2461
- expect(answer).to be_an_instance_of Hash
2462
- expect(answer[:file]).to be_an_instance_of File
2463
- expect(answer[:status]).to eql(200)
2464
-
2465
- # Save to test dir
2466
- save_to_test_dir(answer[:file], "Translate_doc_en_de.html")
2467
- end
2468
- end
2469
-
2470
- # unit tests for get_translate_document_by_url
2471
- # Translate the HTML document from Web specified by its URL.
2472
- #
2473
- # @param source_url Source document URL.
2474
- # @param src_lang Source language.
2475
- # @param res_lang Result language.
2476
- # @return [Hash] {file: data, status: _status_code, headers: _headers}
2477
- describe 'get_translate_document_by_url test' do
2478
- it "Translate url" do
2479
-
2480
- source_url = "https://www.le.ac.uk/oerresources/bdra/html/page_01.htm"
2481
- src_lang = "en"
2482
- res_lang = "fr"
2483
-
2484
- answer = @instance.get_translate_document_by_url(source_url, src_lang,res_lang)
2485
-
2486
- expect(answer).to be_an_instance_of Hash
2487
- expect(answer[:file]).to be_an_instance_of File
2488
- expect(answer[:status]).to eql(200)
2489
-
2490
- # Save to test dir
2491
- save_to_test_dir(answer[:file], "Translate_url_en_fr.zip")
2492
- end
2493
- end
2494
-
2495
- #################################################
2496
- # Summarization API
2497
- #################################################
2498
-
2499
- # unit tests for get_detect_html_keywords
2500
- # Get the HTML document keywords using the keyword detection service.
2501
- #
2502
- # @param name Document name.
2503
- # @param [Hash] opts the optional parameters
2504
- # @option opts [String] :folder Document folder.
2505
- # @option opts [String] :storage Document storage.
2506
- # @return [Hash] {file: data, status: _status_code, headers: _headers}
2507
- describe 'get_detect_html_keywords test' do
2508
- it "Keyword by html document" do
2509
- name = "test_en.html"
2510
- opts = {storage: nil, folder: "HtmlTestDoc"}
2511
-
2512
- # Upload file to server
2513
- res = upload_file_helper(name)
2514
- expect(res.uploaded.length).to eql(1)
2515
- expect(res.errors.length).to eql(0)
2516
-
2517
- answer = @instance.get_detect_html_keywords(name, opts)
2518
-
2519
- expect(answer).to be_an_instance_of Hash
2520
- expect(answer[:file]).to be_an_instance_of File
2521
- expect(answer[:status]).to eql(200)
2522
-
2523
- # Save to test dir
2524
- save_to_test_dir(answer[:file], "Keyword_by_doc.json")
2525
- end
2526
- end
2527
-
2528
- # unit tests for get_detect_html_keywords_by_url
2529
- # Get the keywords from HTML document from Web specified by its URL using the keyword detection service
2530
- #
2531
- # @param source_url Source document URL.
2532
- # @return [Hash] {file: data, status: _status_code, headers: _headers}
2533
- describe 'get_detect_html_keywords_by_url test' do
2534
- it "Keyword by url" do
2535
- source_url = "https://www.le.ac.uk/oerresources/bdra/html/page_01.htm"
2536
-
2537
- answer = @instance.get_detect_html_keywords_by_url(source_url)
2538
-
2539
- expect(answer).to be_an_instance_of Hash
2540
- expect(answer[:file]).to be_an_instance_of File
2541
- expect(answer[:status]).to eql(200)
2542
-
2543
- # Save to test dir
2544
- save_to_test_dir(answer[:file], "Keyword_by_url.json")
2545
- end
2546
- end
2547
-
2548
2366
  # unit tests for get_merge_html_template
2549
2367
  # Populate HTML document template with data located as a file in the storage.
2550
2368
  #
@@ -30,7 +30,8 @@
30
30
  require 'aspose_html_cloud'
31
31
 
32
32
  CONFIG = {
33
- "basePath": "http://localhost:5000/v3.0",
33
+ "basePath": "https://api-qa.aspose.cloud/v3.0",
34
+ # "basePath": "http://localhost:5000/v3.0",
34
35
  "authPath": "https://api-qa.aspose.cloud/connect/token",
35
36
  "apiKey": "html.cloud",
36
37
  "appSID": "html.cloud",
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aspose_html_cloud
3
3
  version: !ruby/object:Gem::Version
4
- version: 19.5.0
4
+ version: 19.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexander Makogon
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-08-08 00:00:00.000000000 Z
11
+ date: 2019-10-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: typhoeus