paralleldots 1.0.1 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +0 -8
  3. data/lib/paralleldots.rb +11 -13
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 341ed69342047f61fd7f0b41e968490d07bb51fb
4
- data.tar.gz: e83155d8742c95d4c67b778f62632436bda6b41c
3
+ metadata.gz: bb0c99a7ea0a26d048f21330d2a1535075bc9de4
4
+ data.tar.gz: fec48245a19cab49eac17129c6d16112d27ae742
5
5
  SHA512:
6
- metadata.gz: 88775cc70415c8811e21aee6b9a6402f2729a649e2a57b147bf7f6e526f8f978b2b279884b754c4c8d862c7a70667fa06ec68a75ca8267de944c1c70585eb0ce
7
- data.tar.gz: 8a2c13475dba7a0da0c082e6c85cbe1bea61e2185fab958707498b9570029b83b6a4af9c10d03604622adcb574906c9ac1c42718ee86c061dc0a8ed52bb8fb01
6
+ metadata.gz: 3d00551b5b7693825dad7b62ae32d973568aec2c94284a313732517d50b0dff1802d16f509dc315004040498dc86463a24b579c131a08925434522c9feeca87c
7
+ data.tar.gz: f8b67a07f3507d561fee924e72956a8dc5c49e029fcd812dea23bcc0d56a61ce96a090160d3c8f992c20d503aae2e423b5076bfbe25fdeb4c63b6c3a3b6390e7
data/README.md CHANGED
@@ -27,14 +27,6 @@ Configuration:
27
27
  # Viewing your API key
28
28
  > get_api_key()
29
29
 
30
- Usage:
31
-
32
- # View the number of API hits made and hits remaining
33
- > hit_count()
34
-
35
- # View the number of hits made for a specific API by using function name as a String
36
- > specific_hit_count( "multilang_sentiment" )
37
-
38
30
 
39
31
  Supported APIs:
40
32
  ---------------
@@ -2,8 +2,6 @@ require_relative 'config'
2
2
  require 'rest-client'
3
3
  require 'json'
4
4
 
5
- url = "35.202.76.177"
6
-
7
5
  def check( api_key, text )
8
6
  if api_key == nil or api_key == "" then
9
7
  return { "error": "API Key cannot be nil or an empty String." }
@@ -23,7 +21,7 @@ def sentiment( text )
23
21
  if valid != true then
24
22
  return valid
25
23
  end
26
- response = RestClient.post "http://%s/sentiment"%url, { api_key: api_key, text: text }
24
+ response = RestClient.post "http://35.202.76.177/sentiment", { api_key: api_key, text: text }
27
25
  response = JSON.parse( response )
28
26
  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"
29
27
  return response
@@ -35,7 +33,7 @@ def ner( text )
35
33
  if valid != true then
36
34
  return valid
37
35
  end
38
- response = RestClient.post "http://%s/ner"%url, { api_key: api_key, text: text }
36
+ response = RestClient.post "http://35.202.76.177/ner", { api_key: api_key, text: text }
39
37
  response = JSON.parse( response )
40
38
  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"
41
39
  return response
@@ -47,7 +45,7 @@ def keywords( text )
47
45
  if valid != true then
48
46
  return valid
49
47
  end
50
- response = RestClient.post "http://%s/keywords"%url, { api_key: api_key, text: text }
48
+ response = RestClient.post "http://35.202.76.177/keywords", { api_key: api_key, text: text }
51
49
  response = JSON.parse( response )
52
50
  response = { "keywords": 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" }
53
51
  return response
@@ -59,7 +57,7 @@ def intent( text )
59
57
  if valid != true then
60
58
  return valid
61
59
  end
62
- response = RestClient.post "http://%s/intent"%url, { api_key: api_key, text: text }
60
+ response = RestClient.post "http://35.202.76.177/intent", { api_key: api_key, text: text }
63
61
  response = JSON.parse( response )
64
62
  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"
65
63
  return response
@@ -71,7 +69,7 @@ def emotion( text )
71
69
  if valid != true then
72
70
  return valid
73
71
  end
74
- response = RestClient.post "http://%s/emotion"%url, { api_key: api_key, text: text }
72
+ response = RestClient.post "http://35.202.76.177/emotion", { api_key: api_key, text: text }
75
73
  response = JSON.parse( response )
76
74
  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"
77
75
  return response
@@ -83,7 +81,7 @@ def abuse( text )
83
81
  if valid != true then
84
82
  return valid
85
83
  end
86
- response = RestClient.post "http://%s/abuse"%url, { api_key: api_key, text: text }
84
+ response = RestClient.post "http://35.202.76.177/abuse", { api_key: api_key, text: text }
87
85
  response = JSON.parse( response )
88
86
  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"
89
87
  return response
@@ -95,7 +93,7 @@ def taxonomy( text )
95
93
  if valid != true then
96
94
  return valid
97
95
  end
98
- response = RestClient.post "http://%s/taxonomy"%url, { api_key: api_key, text: text }
96
+ response = RestClient.post "http://35.202.76.177/taxonomy", { api_key: api_key, text: text }
99
97
  response = JSON.parse( response )
100
98
  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"
101
99
  return response
@@ -108,7 +106,7 @@ def similarity( text_1, text_2 )
108
106
  if valid_1 != true or valid_2 != true then
109
107
  return { "text_1": valid_1, "text_2": valid_2 }
110
108
  end
111
- response = RestClient.post "http://%s/semanticsimilarity"%url, { api_key: api_key, text_1: text_1, text_2: text_2 }
109
+ response = RestClient.post "http://35.202.76.177/semanticsimilarity", { api_key: api_key, text_1: text_1, text_2: text_2 }
112
110
  response = JSON.parse( response )
113
111
  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"
114
112
  return response
@@ -121,7 +119,7 @@ def multilang_sentiment( text, lang )
121
119
  if valid_1 != true or valid_2 != true then
122
120
  return { "text": valid_1, "lang": valid_2 }
123
121
  end
124
- response = RestClient.post "http://%s/multilang_sentiment"%url, { api_key: api_key, text: text, lang: lang }
122
+ response = RestClient.post "http://35.202.76.177/multilang_sentiment", { api_key: api_key, text: text, lang: lang }
125
123
  response = JSON.parse( response )
126
124
  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"
127
125
  return response
@@ -132,7 +130,7 @@ end
132
130
  # if api_key == nil or api_key == "" then
133
131
  # return { "error": "API Key cannot be nil or an empty String." }
134
132
  # end
135
- # response = RestClient.post "http://%s/hit_count"%url, { api_key: api_key }
133
+ # response = RestClient.post "http://35.202.76.177/hit_count", { api_key: api_key }
136
134
  # response = JSON.parse( response )
137
135
  # 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"
138
136
  # return response
@@ -143,7 +141,7 @@ end
143
141
  # if api_key == nil or api_key == "" then
144
142
  # return { "error": "API Key cannot be nil or an empty String." }
145
143
  # end
146
- # response = RestClient.post "http://%s/specific_hit_count"%url, { api_key: api_key, end_point: end_point }
144
+ # response = RestClient.post "http://35.202.76.177/specific_hit_count", { api_key: api_key, end_point: end_point }
147
145
  # response = JSON.parse( response )
148
146
  # 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"
149
147
  # return response
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: paralleldots
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Meghdeep Ray