nlpcloud 1.0.21 → 1.0.24

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/nlpcloud.rb +8 -2
  3. metadata +3 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: daea21690d482c9ee35fad3cb642d9ee5ac7664382cc967ab72c0c028d7a97ec
4
- data.tar.gz: 7e219ff198f0000cd94e8c56cae5ba72f0c8be5c74463fde980a9264f40f1a9f
3
+ metadata.gz: bc0da7199ea326f3bb8806a3aad379a0bb83dfa18009649430520cbd360924a4
4
+ data.tar.gz: 9a31c0ad59d36dc359dbacf22c2adebf0c1c92e84bd37511e372e6d9a4fa8838
5
5
  SHA512:
6
- metadata.gz: 8aa67c69f359eef5084f305e417670bd39735774c9c13a9c220488495ced061d298a4d31ad0f22f1e234d4405cd2ac9361610174e93f895af9b14723cf5b1909
7
- data.tar.gz: d7d8b654c74b05b3abf2f5eb50e423c98f6c474fb896a2359125734c5f30d2b11311922fd682cdf46db8257016f9b826d0003e2f13452f8ec99ac6f65519b2c0
6
+ metadata.gz: 948776a34d14055118b712ce899a6cff957b8966221e82cdd62ba6cc8fa051c37758fa830b4c3ab0d47d0413fdc8ad4f3b17628633bc456fdc2a69c8208eccbb
7
+ data.tar.gz: ef59d43f673255e527e1e2cada38070a7a24b9115facf7b7342ce2ef695961e768209d74bb867e9445483983d22dc74960749871493acb596cc87f3f2f6a4ced
data/lib/nlpcloud.rb CHANGED
@@ -16,6 +16,10 @@ module NLPCloud
16
16
  'User-Agent' => 'nlpcloud-ruby-client'
17
17
  }
18
18
 
19
+ if lang == 'en'
20
+ lang = ''
21
+ end
22
+
19
23
  @root_url = if gpu && (lang != '')
20
24
  "#{BASE_URL}/#{API_VERSION}/gpu/#{lang}/#{model}"
21
25
  elsif gpu && (lang == '')
@@ -200,9 +204,11 @@ module NLPCloud
200
204
  JSON.parse(response.body)
201
205
  end
202
206
 
203
- def translation(text)
207
+ def translation(text, source, target)
204
208
  payload = {
205
- 'text' => text
209
+ 'text' => text,
210
+ 'source' => source,
211
+ 'target' => target
206
212
  }
207
213
  response = RestClient.post("#{@root_url}/translation", payload.to_json, @headers)
208
214
  JSON.parse(response.body)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nlpcloud
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.21
4
+ version: 1.0.24
5
5
  platform: ruby
6
6
  authors:
7
7
  - Julien Salinas
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-03-22 00:00:00.000000000 Z
11
+ date: 2022-06-13 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: 'NLP Cloud serves high performance pre-trained or custom models for NER,
14
14
  sentiment-analysis, classification, summarization, paraphrasing, grammar and spelling
@@ -46,7 +46,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
46
46
  - !ruby/object:Gem::Version
47
47
  version: '0'
48
48
  requirements: []
49
- rubygems_version: 3.1.4
49
+ rubygems_version: 3.3.5
50
50
  signing_key:
51
51
  specification_version: 4
52
52
  summary: Ruby client for the NLP Cloud API