aliyun_nlp_ruby 0.0.1 → 0.0.2

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: c216d17cec9544aa3e0085491221754634a678215147a5d079955e5e28ad1ea7
4
- data.tar.gz: 89a5b7918c0e07089165c7c6ef3b2ac526ec558e07c63e016527d22c225612f4
3
+ metadata.gz: 4ad73c6e33bb319b5b5f344d93e518d7419446637e07655ab9e6a74fb92a29f7
4
+ data.tar.gz: 0ace559a57b1fe96e6cf941d2f182b97977a23e380755a98f4c36d176b5cb7f5
5
5
  SHA512:
6
- metadata.gz: 36b6f204a6ce048658af6f037352dc9341ea07834bb676ba9beefabe3073d4e347c46e318567b0939d7c9da2c2cd2dd15c22addf0458242dc5bf47e4c6dfcf7a
7
- data.tar.gz: 770df4b84fbd235e09e2a241a5ad1033a77d7876c095284fec574c2f817c30d39cb4e2a0c883c69c7413090a2ff3399f7dc7c00dd9450dbdb3b108756bb711e0
6
+ metadata.gz: 440bdbf5c7dd7b6af1b1bb900b2f989c0b9f141839c7e84abaad06dd53171273b6c52314c3e8739620c6c0dbbce866fac02ef98aaedd50845d8aa6db66dec6cb
7
+ data.tar.gz: eae1233fdbf7f63d55860048314d57190bd8809f2e920ad6ff285b4904503b16aa43caac33ad927b9b35de8024509a0b0f18df1df0234bcda9a9612c9846de06
@@ -13,11 +13,12 @@ module AliyunNlpRuby
13
13
  params_without_sig = build_params(params.merge(intrinsic_params))
14
14
  params_full= "Signature=#{sign(params_without_sig)}&#{params_without_sig}"
15
15
 
16
- response = Faraday.get "#{SERVICE_URL}?#{params_full}",
16
+ response = Faraday.get "#{SERVICE_URL}?#{params_full}"
17
17
  if response != 200 && defined? Rails
18
18
  Rails.logger.error(response.body)
19
19
  end
20
- JSON.parse(response.body)
20
+ data = JSON.parse(response.body).dig('Data') || ''
21
+ JSON.parse(data).dig('result')
21
22
  end
22
23
 
23
24
  private
@@ -1,3 +1,3 @@
1
1
  module AliyunNlpRuby
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aliyun_nlp_ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Zkun