paralleldots 1.0.13 → 1.0.14
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 +4 -4
- data/lib/paralleldots.rb +12 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1602685466929704b6c8cd10ef8902b39429889c
|
4
|
+
data.tar.gz: f9f1cf3c5c97a1a6fd8aa471b2b28b6ef9410d39
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: daae5173f10a8064e3f596dc017aa6bb1327dc86366b95525511b0623ed3e02f6dc75c18b50f6e531bfabf9a265b918d80a90d4cc079f9108825240454eaf513
|
7
|
+
data.tar.gz: c7cc85a015bd1b69fc664ac8eb0377f8b02c916a732f50ec564c08904afe20594a1e444d6faf3a74cc02df176967b3a36cc8e7dc996e0bd4ef5b9c0ca2c5b25b
|
data/lib/paralleldots.rb
CHANGED
@@ -139,6 +139,18 @@ def sentiment_social( text )
|
|
139
139
|
return response
|
140
140
|
end
|
141
141
|
|
142
|
+
def custom_classifier( text, id )
|
143
|
+
api_key = get_api_key
|
144
|
+
valid = check( api_key, text )
|
145
|
+
if valid != true then
|
146
|
+
return valid
|
147
|
+
end
|
148
|
+
response = RestClient.post "http://apis.paralleldots.com/v2/custom_classifier", { api_key: api_key, text: text, id: id }
|
149
|
+
response = JSON.parse( response )
|
150
|
+
response[ "usage" ] = "By accessing ParallelDots API or using information generated by ParallelDots API, you are agreeing to be bound by the ParallelDots API Terms of Use: http://www.paralleldots.com/terms-and-conditions"
|
151
|
+
return response
|
152
|
+
end
|
153
|
+
|
142
154
|
def usage()
|
143
155
|
api_key = get_api_key
|
144
156
|
if api_key == nil or api_key == "" then
|