wordnik 4.06.08 → 4.06.10
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +3 -3
- data/api_docs/account.json +1 -1
- data/api_docs/analytics.json +1 -1
- data/api_docs/corpus.json +1 -1
- data/api_docs/document.json +1 -1
- data/api_docs/glossary.json +1 -0
- data/api_docs/suggest.json +1 -1
- data/api_docs/system.json +1 -1
- data/api_docs/tag.json +1 -1
- data/api_docs/user.json +1 -1
- data/api_docs/users.json +1 -1
- data/api_docs/word.json +1 -1
- data/api_docs/wordList.json +1 -1
- data/api_docs/wordLists.json +1 -1
- data/api_docs/words.json +1 -1
- data/lib/wordnik/resource_modules/account.rb +0 -26
- data/lib/wordnik/resource_modules/corpus.rb +0 -53
- data/lib/wordnik/resource_modules/{partners.rb → glossary.rb} +43 -76
- data/lib/wordnik/resource_modules/system.rb +22 -22
- data/lib/wordnik/resource_modules/user.rb +1 -1
- data/lib/wordnik/resource_modules/word.rb +30 -3
- data/lib/wordnik/resource_modules/words.rb +3 -57
- data/lib/wordnik/version.rb +1 -1
- metadata +4 -6
- data/api_docs/partner.json +0 -1
- data/api_docs/partners.json +0 -1
- data/lib/wordnik/resource_modules/partner.rb +0 -140
@@ -384,11 +384,11 @@ module WordMethods
|
|
384
384
|
request_only ? request : request.response.body
|
385
385
|
end
|
386
386
|
|
387
|
-
#
|
387
|
+
# Given a word as a string, returns relationships from the Word Graph
|
388
388
|
#
|
389
|
-
def
|
389
|
+
def get_related_words(word, *args)
|
390
390
|
http_method = :get
|
391
|
-
path = '/word/{word}/
|
391
|
+
path = '/word/{word}/relatedWords'
|
392
392
|
path.sub!('{word}', word.to_s)
|
393
393
|
|
394
394
|
# Ruby turns all key-value arguments at the end into a single hash
|
@@ -627,6 +627,33 @@ module WordMethods
|
|
627
627
|
request_only ? request : request.response.body
|
628
628
|
end
|
629
629
|
|
630
|
+
# Returns citations for a word
|
631
|
+
#
|
632
|
+
def get_citations(word, *args)
|
633
|
+
http_method = :get
|
634
|
+
path = '/word/{word}/citations'
|
635
|
+
path.sub!('{word}', word.to_s)
|
636
|
+
|
637
|
+
# Ruby turns all key-value arguments at the end into a single hash
|
638
|
+
# e.g. Wordnik.word.get_examples('dingo', :limit => 10, :part_of_speech => 'verb')
|
639
|
+
# becomes {:limit => 10, :part_of_speech => 'verb'}
|
640
|
+
last_arg = args.pop if args.last.is_a?(Hash)
|
641
|
+
last_arg = args.pop if args.last.is_a?(Array)
|
642
|
+
last_arg ||= {}
|
643
|
+
|
644
|
+
# Look for a kwarg called :request_only, whose presence indicates
|
645
|
+
# that we want the request itself back, not the response body
|
646
|
+
if last_arg.is_a?(Hash) && last_arg[:request_only].present?
|
647
|
+
request_only = true
|
648
|
+
last_arg.delete(:request_only)
|
649
|
+
end
|
650
|
+
|
651
|
+
params = last_arg
|
652
|
+
body ||= {}
|
653
|
+
request = Wordnik::Request.new(http_method, path, :params => params, :body => body)
|
654
|
+
request_only ? request : request.response.body
|
655
|
+
end
|
656
|
+
|
630
657
|
# Returns syllable information for a word
|
631
658
|
#
|
632
659
|
def get_hyphenation(word, *args)
|
@@ -82,32 +82,6 @@ module WordsMethods
|
|
82
82
|
request_only ? request : request.response.body
|
83
83
|
end
|
84
84
|
|
85
|
-
# Searches definitions.
|
86
|
-
#
|
87
|
-
def search_definitions(*args)
|
88
|
-
http_method = :get
|
89
|
-
path = '/words/searchDefinitions'
|
90
|
-
|
91
|
-
# Ruby turns all key-value arguments at the end into a single hash
|
92
|
-
# e.g. Wordnik.word.get_examples('dingo', :limit => 10, :part_of_speech => 'verb')
|
93
|
-
# becomes {:limit => 10, :part_of_speech => 'verb'}
|
94
|
-
last_arg = args.pop if args.last.is_a?(Hash)
|
95
|
-
last_arg = args.pop if args.last.is_a?(Array)
|
96
|
-
last_arg ||= {}
|
97
|
-
|
98
|
-
# Look for a kwarg called :request_only, whose presence indicates
|
99
|
-
# that we want the request itself back, not the response body
|
100
|
-
if last_arg.is_a?(Hash) && last_arg[:request_only].present?
|
101
|
-
request_only = true
|
102
|
-
last_arg.delete(:request_only)
|
103
|
-
end
|
104
|
-
|
105
|
-
params = last_arg
|
106
|
-
body ||= {}
|
107
|
-
request = Wordnik::Request.new(http_method, path, :params => params, :body => body)
|
108
|
-
request_only ? request : request.response.body
|
109
|
-
end
|
110
|
-
|
111
85
|
# Searches dictionary entries.
|
112
86
|
#
|
113
87
|
def search_entries(*args)
|
@@ -134,11 +108,11 @@ module WordsMethods
|
|
134
108
|
request_only ? request : request.response.body
|
135
109
|
end
|
136
110
|
|
137
|
-
#
|
111
|
+
# Searches definitions.
|
138
112
|
#
|
139
|
-
def
|
113
|
+
def search_definitions(*args)
|
140
114
|
http_method = :get
|
141
|
-
path = '/words/
|
115
|
+
path = '/words/searchDefinitions'
|
142
116
|
|
143
117
|
# Ruby turns all key-value arguments at the end into a single hash
|
144
118
|
# e.g. Wordnik.word.get_examples('dingo', :limit => 10, :part_of_speech => 'verb')
|
@@ -186,34 +160,6 @@ module WordsMethods
|
|
186
160
|
request_only ? request : request.response.body
|
187
161
|
end
|
188
162
|
|
189
|
-
# Fetches a word by ID
|
190
|
-
# Deprecated.
|
191
|
-
#
|
192
|
-
def get_word_by_id(id, *args)
|
193
|
-
http_method = :get
|
194
|
-
path = '/words/id/{id}'
|
195
|
-
path.sub!('{id}', id.to_s)
|
196
|
-
|
197
|
-
# Ruby turns all key-value arguments at the end into a single hash
|
198
|
-
# e.g. Wordnik.word.get_examples('dingo', :limit => 10, :part_of_speech => 'verb')
|
199
|
-
# becomes {:limit => 10, :part_of_speech => 'verb'}
|
200
|
-
last_arg = args.pop if args.last.is_a?(Hash)
|
201
|
-
last_arg = args.pop if args.last.is_a?(Array)
|
202
|
-
last_arg ||= {}
|
203
|
-
|
204
|
-
# Look for a kwarg called :request_only, whose presence indicates
|
205
|
-
# that we want the request itself back, not the response body
|
206
|
-
if last_arg.is_a?(Hash) && last_arg[:request_only].present?
|
207
|
-
request_only = true
|
208
|
-
last_arg.delete(:request_only)
|
209
|
-
end
|
210
|
-
|
211
|
-
params = last_arg
|
212
|
-
body ||= {}
|
213
|
-
request = Wordnik::Request.new(http_method, path, :params => params, :body => body)
|
214
|
-
request_only ? request : request.response.body
|
215
|
-
end
|
216
|
-
|
217
163
|
# Returns a WordOfTheDay range
|
218
164
|
#
|
219
165
|
def get_word_of_the_day_range(*args)
|
data/lib/wordnik/version.rb
CHANGED
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: wordnik
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 4.06.
|
5
|
+
version: 4.06.10
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Zeke Sikelianos
|
@@ -11,7 +11,7 @@ autorequire:
|
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
13
|
|
14
|
-
date: 2011-
|
14
|
+
date: 2011-10-27 00:00:00 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: typhoeus
|
@@ -157,8 +157,7 @@ files:
|
|
157
157
|
- api_docs/analytics.json
|
158
158
|
- api_docs/corpus.json
|
159
159
|
- api_docs/document.json
|
160
|
-
- api_docs/
|
161
|
-
- api_docs/partners.json
|
160
|
+
- api_docs/glossary.json
|
162
161
|
- api_docs/suggest.json
|
163
162
|
- api_docs/system.json
|
164
163
|
- api_docs/tag.json
|
@@ -181,8 +180,7 @@ files:
|
|
181
180
|
- lib/wordnik/resource_modules/analytics.rb
|
182
181
|
- lib/wordnik/resource_modules/corpus.rb
|
183
182
|
- lib/wordnik/resource_modules/document.rb
|
184
|
-
- lib/wordnik/resource_modules/
|
185
|
-
- lib/wordnik/resource_modules/partners.rb
|
183
|
+
- lib/wordnik/resource_modules/glossary.rb
|
186
184
|
- lib/wordnik/resource_modules/suggest.rb
|
187
185
|
- lib/wordnik/resource_modules/system.rb
|
188
186
|
- lib/wordnik/resource_modules/tag.rb
|
data/api_docs/partner.json
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{"resourcePath":"/partner","models":{"glossaryStatus":{"properties":{"id":{"type":"int","required":false,"uniqueItems":false},"name":{"type":"string","required":false,"uniqueItems":false}},"id":"glossaryStatus","type":"any","required":false,"uniqueItems":false},"GlossaryEntry":{"properties":{"title":{"type":"string","required":false,"uniqueItems":false},"noteType":{"type":"string","required":false,"uniqueItems":false},"example":{"type":"string","required":false,"uniqueItems":false},"glossaryId":{"type":"long","required":false,"uniqueItems":false},"wordstring":{"type":"string","required":false,"uniqueItems":false},"note":{"type":"string","required":false,"uniqueItems":false},"url":{"type":"string","required":false,"uniqueItems":false}},"id":"GlossaryEntry","type":"any","required":false,"uniqueItems":false},"Glossary":{"properties":{"updatedAt":{"type":"Date","required":false,"uniqueItems":false},"id":{"type":"long","required":false,"uniqueItems":false},"permalinkId":{"type":"string","required":false,"uniqueItems":false},"status":{"type":"glossaryStatus","required":false,"uniqueItems":false},"createdAt":{"type":"Date","required":false,"uniqueItems":false},"description":{"type":"string","required":false,"uniqueItems":false},"contentProvider":{"type":"contentProvider","required":false,"uniqueItems":false},"name":{"type":"string","required":false,"uniqueItems":false},"totalEntries":{"type":"int","required":false,"uniqueItems":false},"publishedDate":{"type":"Date","required":false,"uniqueItems":false},"version":{"type":"double","required":false,"uniqueItems":false}},"id":"Glossary","type":"any","required":false,"uniqueItems":false},"contentProvider":{"properties":{"id":{"type":"int","required":false,"uniqueItems":false},"name":{"type":"string","required":false,"uniqueItems":false}},"id":"contentProvider","type":"any","required":false,"uniqueItems":false},"documentModelSearchResults":{"properties":{"author":{"type":"string","required":false,"uniqueItems":false},"title":{"type":"string","required":false,"uniqueItems":false},"sentences":{"type":"array","required":false,"items":{"type":"string","required":false,"uniqueItems":false},"uniqueItems":false},"date":{"type":"string","required":false,"uniqueItems":false},"url":{"type":"string","required":false,"uniqueItems":false}},"id":"documentModelSearchResults","type":"any","required":false,"uniqueItems":false}},"apis":[{"path":"/partner.{format}/{id}/result","description":"","operations":[{"parameters":[{"name":"id","description":"Document ID","required":false,"dataType":"string","allowableValues":[],"allowMultiple":false,"paramType":"path"},{"name":"searchTerms","description":"Comma separated search terms","required":false,"dataType":"string","allowableValues":[],"allowMultiple":false,"paramType":"query"},{"name":"skip","description":"Results to skip","required":false,"dataType":"string","allowableValues":[],"allowMultiple":false,"paramType":"query"},{"name":"limit","description":"Maximum number of results to return","required":false,"dataType":"string","allowableValues":[],"allowMultiple":false,"paramType":"query"}],"summary":"Fetches model search results.","httpMethod":"GET","errorResponses":[{"reason":"Invalid Content Provider code supplied.","code":404}],"nickname":"getResults","responseClass":"List[documentModelSearchResults]"}]},{"path":"/partner.{format}/glossaries","description":"","operations":[{"parameters":[{"name":"includeDrafts","description":"Includes unpublished Glossaries","required":false,"dataType":"string","allowableValues":[],"allowMultiple":false,"paramType":"query"},{"name":"skip","description":"Results to skip","required":false,"dataType":"string","allowableValues":[],"allowMultiple":false,"paramType":"query"},{"name":"limit","description":"Maximum number of results to return","required":false,"dataType":"string","allowableValues":[],"allowMultiple":false,"paramType":"query"}],"summary":"Fetches glossaries for the specified Provider.","httpMethod":"GET","errorResponses":[{"reason":"Invalid Content Provider code supplied.","code":404}],"nickname":"getGlossaries","responseClass":"List[Glossary]"}]},{"path":"/partner.{format}/glossary/{permalink}","description":"","operations":[{"parameters":[{"name":"permalink","description":"Permalink of Glossary to fetch.","required":false,"dataType":"string","allowableValues":[],"allowMultiple":false,"paramType":"path"},{"name":"version","description":"Version to fetch","required":false,"dataType":"string","allowableValues":[],"allowMultiple":false,"paramType":"query"}],"summary":"Fetches a glossary by permalink.","httpMethod":"GET","errorResponses":[{"reason":"Not authorized.","code":403},{"reason":"Invalid ID supplied.","code":404}],"nickname":"getGlossary","responseClass":"Glossary"}]},{"path":"/partner.{format}/{word}/related","description":"","operations":[{"parameters":[{"name":"word","description":"Word to find related items for","required":false,"dataType":"string","allowableValues":[],"allowMultiple":false,"paramType":"path"},{"name":"type","description":"Related Type","required":false,"dataType":"string","allowableValues":["person"," location"," organization"],"allowMultiple":false,"paramType":"query"},{"name":"skip","description":"Results to skip","required":false,"dataType":"string","allowableValues":[],"allowMultiple":false,"paramType":"query"},{"name":"limit","description":"Maximum number of results to return","required":false,"dataType":"string","allowableValues":[],"allowMultiple":false,"paramType":"query"}],"summary":"Returns weighted terms related to the input word","httpMethod":"GET","errorResponses":[{"reason":"No data found.","code":404}],"nickname":"getRelatedWords","responseClass":"relatedWord"}]},{"path":"/partner.{format}/glossary/{permalink}/entries","description":"","operations":[{"parameters":[{"name":"permalink","description":"Permalink of Glossary.","required":false,"dataType":"string","allowableValues":[],"allowMultiple":false,"paramType":"path"},{"name":"version","description":"Specific Glossary version to fetch Entries for","required":false,"dataType":"string","allowableValues":[],"allowMultiple":false,"paramType":"query"},{"name":"startsWith","description":"Word pattern to fetch with.","required":false,"dataType":"string","allowableValues":[],"allowMultiple":false,"paramType":"query"},{"name":"skip","description":"Results to skip","required":false,"dataType":"string","allowableValues":[],"allowMultiple":false,"paramType":"query"},{"name":"limit","description":"Maximum number of results to return","required":false,"dataType":"string","allowableValues":[],"allowMultiple":false,"paramType":"query"}],"summary":"Fetches GlossaryEntry objects for the specified Glossary.","httpMethod":"GET","errorResponses":[{"reason":"Not authorized.","code":403},{"reason":"Invalid ID supplied.","code":404}],"nickname":"getGlossaryEntries","responseClass":"List[GlossaryEntry]"}]}],"models1":[{"name":"contentProvider","fields":[{"name":"name","required":false,"allowMultiple":false,"paramType":"string"},{"name":"id","required":false,"allowMultiple":false,"paramType":"int"}]},{"name":"Glossary","fields":[{"name":"name","required":false,"allowMultiple":false,"paramType":"string"},{"name":"id","required":false,"allowMultiple":false,"paramType":"long"},{"name":"version","required":false,"allowMultiple":false,"paramType":"double"},{"name":"status","required":false,"allowMultiple":false,"paramType":"glossaryStatus"},{"name":"description","required":false,"allowMultiple":false,"paramType":"string"},{"name":"permalinkId","required":false,"allowMultiple":false,"paramType":"string"},{"name":"contentProvider","required":false,"allowMultiple":false,"paramType":"contentProvider"},{"name":"createdAt","required":false,"allowMultiple":false,"paramType":"Date"},{"name":"publishedDate","required":false,"allowMultiple":false,"paramType":"Date"},{"name":"updatedAt","required":false,"allowMultiple":false,"paramType":"Date"},{"name":"totalEntries","required":false,"allowMultiple":false,"paramType":"int"}]},{"name":"documentModelSearchResults","fields":[{"name":"date","required":false,"allowMultiple":false,"paramType":"string"},{"name":"url","required":false,"allowMultiple":false,"paramType":"string"},{"name":"sentences","required":false,"allowMultiple":false,"paramType":"List[string]"},{"name":"title","required":false,"allowMultiple":false,"paramType":"string"},{"name":"author","required":false,"allowMultiple":false,"paramType":"string"}]},{"name":"GlossaryEntry","fields":[{"name":"url","required":false,"allowMultiple":false,"paramType":"string"},{"name":"wordstring","required":false,"allowMultiple":false,"paramType":"string"},{"name":"example","required":false,"allowMultiple":false,"paramType":"string"},{"name":"title","required":false,"allowMultiple":false,"paramType":"string"},{"name":"note","required":false,"allowMultiple":false,"paramType":"string"},{"name":"glossaryId","required":false,"allowMultiple":false,"paramType":"long"},{"name":"noteType","required":false,"allowMultiple":false,"paramType":"string"}]},{"name":"glossaryStatus","fields":[{"name":"name","required":false,"allowMultiple":false,"paramType":"string"},{"name":"id","required":false,"allowMultiple":false,"paramType":"int"}]}],"basePath":"url","swaggerVersion":"1.0"}
|
data/api_docs/partners.json
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{"resourcePath":"/partners","models":{"glossaryStatus":{"properties":{"id":{"type":"int","required":false,"uniqueItems":false},"name":{"type":"string","required":false,"uniqueItems":false}},"id":"glossaryStatus","type":"any","required":false,"uniqueItems":false},"GlossaryEntry":{"properties":{"title":{"type":"string","required":false,"uniqueItems":false},"noteType":{"type":"string","required":false,"uniqueItems":false},"example":{"type":"string","required":false,"uniqueItems":false},"glossaryId":{"type":"long","required":false,"uniqueItems":false},"wordstring":{"type":"string","required":false,"uniqueItems":false},"note":{"type":"string","required":false,"uniqueItems":false},"url":{"type":"string","required":false,"uniqueItems":false}},"id":"GlossaryEntry","type":"any","required":false,"uniqueItems":false},"Glossary":{"properties":{"updatedAt":{"type":"Date","required":false,"uniqueItems":false},"id":{"type":"long","required":false,"uniqueItems":false},"permalinkId":{"type":"string","required":false,"uniqueItems":false},"status":{"type":"glossaryStatus","required":false,"uniqueItems":false},"createdAt":{"type":"Date","required":false,"uniqueItems":false},"description":{"type":"string","required":false,"uniqueItems":false},"contentProvider":{"type":"contentProvider","required":false,"uniqueItems":false},"name":{"type":"string","required":false,"uniqueItems":false},"totalEntries":{"type":"int","required":false,"uniqueItems":false},"publishedDate":{"type":"Date","required":false,"uniqueItems":false},"version":{"type":"double","required":false,"uniqueItems":false}},"id":"Glossary","type":"any","required":false,"uniqueItems":false},"contentProvider":{"properties":{"id":{"type":"int","required":false,"uniqueItems":false},"name":{"type":"string","required":false,"uniqueItems":false}},"id":"contentProvider","type":"any","required":false,"uniqueItems":false}},"apis":[{"path":"/partners.{format}/{contentProvider}/glossaries","description":"","operations":[{"parameters":[{"name":"contentProvider","description":"Partner Code to create for.","required":false,"dataType":"string","allowableValues":[],"allowMultiple":false,"paramType":"path"},{"description":"Glossary to create","required":false,"dataType":"Glossary","allowableValues":[],"allowMultiple":false,"paramType":"body"}],"summary":"Creates a glossary for the Content Provider.","httpMethod":"POST","errorResponses":[{"reason":"Invalid Glossary supplied.","code":400},{"reason":"Invalid Content Provider code supplied.","code":404}],"nickname":"createGlossary","responseClass":"Glossary"},{"parameters":[{"name":"contentProvider","description":"Partner Code to fetch for.","required":false,"dataType":"string","allowableValues":[],"allowMultiple":false,"paramType":"path"},{"name":"includeDrafts","description":"Includes unpublished Glossaries","required":false,"dataType":"string","allowableValues":[],"allowMultiple":false,"paramType":"query"},{"name":"skip","description":"Results to skip","required":false,"dataType":"string","allowableValues":[],"allowMultiple":false,"paramType":"query"},{"name":"limit","description":"Maximum number of results to return","required":false,"dataType":"string","allowableValues":[],"allowMultiple":false,"paramType":"query"}],"summary":"Fetches glossaries for the specified Provider.","httpMethod":"GET","errorResponses":[{"reason":"Invalid Content Provider code supplied.","code":404}],"nickname":"getGlossaries","responseClass":"List[Glossary]"}]},{"path":"/partners.{format}/{contentProvider}/glossary/{permalinkId}","description":"","operations":[{"parameters":[{"name":"contentProvider","description":"Partner Code to fetch for.","required":false,"dataType":"string","allowableValues":[],"allowMultiple":false,"paramType":"path"},{"name":"permalinkId","description":"Permalink of Glossary to fetch.","required":false,"dataType":"string","allowableValues":[],"allowMultiple":false,"paramType":"path"},{"name":"version","description":"Version to fetch","required":false,"dataType":"string","allowableValues":[],"allowMultiple":false,"paramType":"query"}],"summary":"Fetches a glossary for the specified Provider.","httpMethod":"GET","errorResponses":[{"reason":"Invalid Content Provider code supplied.","code":404}],"nickname":"getGlossary","responseClass":"Glossary"},{"parameters":[{"name":"contentProvider","description":"Partner Code to update for.","required":false,"dataType":"string","allowableValues":[],"allowMultiple":false,"paramType":"path"},{"name":"permalinkId","description":"Permalink of Glossary to fetch.","required":false,"dataType":"string","allowableValues":[],"allowMultiple":false,"paramType":"path"},{"name":"version","description":"Version to fetch","required":false,"dataType":"string","allowableValues":[],"allowMultiple":false,"paramType":"query"},{"description":"Updated Glossary","required":false,"dataType":"Glossary","allowableValues":[],"allowMultiple":false,"paramType":"body"}],"summary":"Updates a Glossaryfor the specified Provider.","httpMethod":"PUT","errorResponses":[{"reason":"Invalid Content Provider code supplied.","code":404}],"nickname":"updateGlossary","responseClass":"Glossary"},{"parameters":[{"name":"contentProvider","description":"Partner Code to delete for.","required":false,"dataType":"string","allowableValues":[],"allowMultiple":false,"paramType":"path"},{"name":"permalinkId","description":"Permalink of Glossary to delete.","required":false,"dataType":"string","allowableValues":[],"allowMultiple":false,"paramType":"path"},{"name":"version","description":"Version to delete","required":false,"dataType":"string","allowableValues":[],"allowMultiple":false,"paramType":"query"}],"summary":"Deletes a single Glossary.","httpMethod":"DELETE","errorResponses":[{"reason":"Invalid Content Provider code supplied.","code":404}],"nickname":"deleteGlossary","responseClass":"ok"}]},{"path":"/partners.{format}/{contentProvider}/glossary/{permalinkId}/entries","description":"","operations":[{"parameters":[{"name":"contentProvider","description":"Partner Code to fetch for.","required":false,"dataType":"string","allowableValues":[],"allowMultiple":false,"paramType":"path"},{"name":"permalinkId","description":"Permalink of Glossary.","required":false,"dataType":"string","allowableValues":[],"allowMultiple":false,"paramType":"path"},{"name":"version","description":"Specific Glossary version to fetch Entries for","required":false,"dataType":"string","allowableValues":[],"allowMultiple":false,"paramType":"query"},{"name":"startsWith","description":"Word pattern to fetch with.","required":false,"dataType":"string","allowableValues":[],"allowMultiple":false,"paramType":"query"},{"name":"skip","description":"Results to skip","required":false,"dataType":"string","allowableValues":[],"allowMultiple":false,"paramType":"query"},{"name":"limit","description":"Maximum number of results to return","required":false,"dataType":"string","allowableValues":[],"allowMultiple":false,"paramType":"query"}],"summary":"Fetches GlossaryEntry objects for the specified Glossary.","httpMethod":"GET","errorResponses":[{"reason":"Invalid Content Provider code supplied.","code":404}],"nickname":"getGlossaryEntries","responseClass":"List[GlossaryEntry]"},{"parameters":[{"name":"contentProvider","description":"Partner Code to add to.","required":false,"dataType":"string","allowableValues":[],"allowMultiple":false,"paramType":"path"},{"name":"permalinkId","description":"Permalink of Glossary.","required":false,"dataType":"string","allowableValues":[],"allowMultiple":false,"paramType":"path"},{"name":"version","description":"Specific Glossary version to fetch Entries for","required":false,"dataType":"string","allowableValues":[],"allowMultiple":false,"paramType":"query"},{"description":"Glossary Entries to add","required":false,"dataType":"GlossaryEntry[]","allowableValues":[],"allowMultiple":false,"paramType":"body"}],"summary":"Adds GlossaryEntry objects for the specified Glossary.","httpMethod":"POST","errorResponses":[{"reason":"Invalid Content Provider code supplied.","code":404}],"nickname":"addGlossaryEntry","responseClass":"ok"}]},{"path":"/partners.{format}/{contentProvider}/glossary/{permalinkId}/publish","description":"","operations":[{"parameters":[{"name":"contentProvider","description":"Partner Code for Glossary.","required":false,"dataType":"string","allowableValues":[],"allowMultiple":false,"paramType":"path"},{"name":"permalinkId","description":"Permalink of Glossary to publish.","required":false,"dataType":"string","allowableValues":[],"allowMultiple":false,"paramType":"path"},{"name":"version","description":"Version to publish.","required":false,"dataType":"string","allowableValues":[],"allowMultiple":false,"paramType":"query"}],"summary":"Publishes a Glossary.","httpMethod":"POST","errorResponses":[{"reason":"Invalid Content Provider code","code":400},{"reason":"Invalid Permalink ID supplied.","code":404}],"nickname":"publishGlossary","responseClass":"ok"}]},{"path":"/partners.{format}/{contentProvider}/glossary/{permalinkId}/clone","description":"","operations":[{"parameters":[{"name":"contentProvider","description":"Partner Code for Glossary.","required":false,"dataType":"string","allowableValues":[],"allowMultiple":false,"paramType":"path"},{"name":"permalinkId","description":"Permalink of Glossary to version.","required":false,"dataType":"string","allowableValues":[],"allowMultiple":false,"paramType":"path"},{"name":"version","description":"New version number to assign.","required":false,"dataType":"string","allowableValues":[],"allowMultiple":false,"paramType":"query"}],"summary":"Creates a new version of a Glossary.","httpMethod":"POST","errorResponses":[{"reason":"Invalid Content Provider code","code":400},{"reason":"Invalid Permalink ID supplied.","code":404}],"nickname":"createVersion","responseClass":"Glossary"}]},{"path":"/partners.{format}/{contentProvider}/glossary/{permalinkId}/entries/{word}","description":"","operations":[{"parameters":[{"name":"contentProvider","description":"Partner Code to delete from.","required":false,"dataType":"string","allowableValues":[],"allowMultiple":false,"paramType":"path"},{"name":"permalinkId","description":"Permalink of Glossary.","required":false,"dataType":"string","allowableValues":[],"allowMultiple":false,"paramType":"path"},{"name":"word","description":"Word to remove.","required":false,"dataType":"string","allowableValues":[],"allowMultiple":false,"paramType":"path"},{"name":"version","description":"Specific Glossary version to fetch Entries for","required":false,"dataType":"string","allowableValues":[],"allowMultiple":false,"paramType":"query"}],"summary":"Removes a GlossaryEntry object from the specified Glossary.","httpMethod":"DELETE","errorResponses":[{"reason":"Invalid word being removed.","code":400},{"reason":"Invalid Content Provider code supplied.","code":404}],"nickname":"deleteGlossaryEntry","responseClass":"ok"}]},{"path":"/partners.{format}/{contentProvider}/glossary/{permalinkId}/deleteEntries","description":"","operations":[{"parameters":[{"name":"contentProvider","description":"Partner Code to delete from.","required":false,"dataType":"string","allowableValues":[],"allowMultiple":false,"paramType":"path"},{"name":"permalinkId","description":"Permalink of Glossary.","required":false,"dataType":"string","allowableValues":[],"allowMultiple":false,"paramType":"path"},{"description":"Words to remove.","required":false,"dataType":"StringValue[]","allowableValues":[],"allowMultiple":false,"paramType":"body"},{"name":"version","description":"Specific Glossary version to remove Entries from","required":false,"dataType":"string","allowableValues":[],"allowMultiple":false,"paramType":"query"}],"summary":"Removes a GlossaryEntry object from the specified Glossary.","httpMethod":"POST","errorResponses":[{"reason":"Invalid word being removed.","code":400},{"reason":"Invalid Content Provider code supplied.","code":404}],"nickname":"deleteGlossaryEntries","responseClass":"ok"}]}],"models1":[{"name":"contentProvider","fields":[{"name":"name","required":false,"allowMultiple":false,"paramType":"string"},{"name":"id","required":false,"allowMultiple":false,"paramType":"int"}]},{"name":"Glossary","fields":[{"name":"name","required":false,"allowMultiple":false,"paramType":"string"},{"name":"id","required":false,"allowMultiple":false,"paramType":"long"},{"name":"version","required":false,"allowMultiple":false,"paramType":"double"},{"name":"status","required":false,"allowMultiple":false,"paramType":"glossaryStatus"},{"name":"description","required":false,"allowMultiple":false,"paramType":"string"},{"name":"permalinkId","required":false,"allowMultiple":false,"paramType":"string"},{"name":"contentProvider","required":false,"allowMultiple":false,"paramType":"contentProvider"},{"name":"createdAt","required":false,"allowMultiple":false,"paramType":"Date"},{"name":"publishedDate","required":false,"allowMultiple":false,"paramType":"Date"},{"name":"updatedAt","required":false,"allowMultiple":false,"paramType":"Date"},{"name":"totalEntries","required":false,"allowMultiple":false,"paramType":"int"}]},{"name":"GlossaryEntry","fields":[{"name":"url","required":false,"allowMultiple":false,"paramType":"string"},{"name":"wordstring","required":false,"allowMultiple":false,"paramType":"string"},{"name":"example","required":false,"allowMultiple":false,"paramType":"string"},{"name":"title","required":false,"allowMultiple":false,"paramType":"string"},{"name":"note","required":false,"allowMultiple":false,"paramType":"string"},{"name":"glossaryId","required":false,"allowMultiple":false,"paramType":"long"},{"name":"noteType","required":false,"allowMultiple":false,"paramType":"string"}]},{"name":"glossaryStatus","fields":[{"name":"name","required":false,"allowMultiple":false,"paramType":"string"},{"name":"id","required":false,"allowMultiple":false,"paramType":"int"}]}],"basePath":"url","swaggerVersion":"1.0"}
|
@@ -1,140 +0,0 @@
|
|
1
|
-
# HEY HACKER! THIS IS AN AUTO-GENERATED FILE.
|
2
|
-
# So don't bother editing it. To see how it's built, take a look at the Rakefile
|
3
|
-
|
4
|
-
module PartnerMethods
|
5
|
-
|
6
|
-
# Fetches model search results.
|
7
|
-
#
|
8
|
-
def get_results(id, *args)
|
9
|
-
http_method = :get
|
10
|
-
path = '/partner/{id}/result'
|
11
|
-
path.sub!('{id}', id.to_s)
|
12
|
-
|
13
|
-
# Ruby turns all key-value arguments at the end into a single hash
|
14
|
-
# e.g. Wordnik.word.get_examples('dingo', :limit => 10, :part_of_speech => 'verb')
|
15
|
-
# becomes {:limit => 10, :part_of_speech => 'verb'}
|
16
|
-
last_arg = args.pop if args.last.is_a?(Hash)
|
17
|
-
last_arg = args.pop if args.last.is_a?(Array)
|
18
|
-
last_arg ||= {}
|
19
|
-
|
20
|
-
# Look for a kwarg called :request_only, whose presence indicates
|
21
|
-
# that we want the request itself back, not the response body
|
22
|
-
if last_arg.is_a?(Hash) && last_arg[:request_only].present?
|
23
|
-
request_only = true
|
24
|
-
last_arg.delete(:request_only)
|
25
|
-
end
|
26
|
-
|
27
|
-
params = last_arg
|
28
|
-
body ||= {}
|
29
|
-
request = Wordnik::Request.new(http_method, path, :params => params, :body => body)
|
30
|
-
request_only ? request : request.response.body
|
31
|
-
end
|
32
|
-
|
33
|
-
# Fetches glossaries for the specified Provider.
|
34
|
-
#
|
35
|
-
def get_glossaries(*args)
|
36
|
-
http_method = :get
|
37
|
-
path = '/partner/glossaries'
|
38
|
-
|
39
|
-
# Ruby turns all key-value arguments at the end into a single hash
|
40
|
-
# e.g. Wordnik.word.get_examples('dingo', :limit => 10, :part_of_speech => 'verb')
|
41
|
-
# becomes {:limit => 10, :part_of_speech => 'verb'}
|
42
|
-
last_arg = args.pop if args.last.is_a?(Hash)
|
43
|
-
last_arg = args.pop if args.last.is_a?(Array)
|
44
|
-
last_arg ||= {}
|
45
|
-
|
46
|
-
# Look for a kwarg called :request_only, whose presence indicates
|
47
|
-
# that we want the request itself back, not the response body
|
48
|
-
if last_arg.is_a?(Hash) && last_arg[:request_only].present?
|
49
|
-
request_only = true
|
50
|
-
last_arg.delete(:request_only)
|
51
|
-
end
|
52
|
-
|
53
|
-
params = last_arg
|
54
|
-
body ||= {}
|
55
|
-
request = Wordnik::Request.new(http_method, path, :params => params, :body => body)
|
56
|
-
request_only ? request : request.response.body
|
57
|
-
end
|
58
|
-
|
59
|
-
# Fetches a glossary by permalink.
|
60
|
-
#
|
61
|
-
def get_glossary(permalink, *args)
|
62
|
-
http_method = :get
|
63
|
-
path = '/partner/glossary/{permalink}'
|
64
|
-
path.sub!('{permalink}', permalink.to_s)
|
65
|
-
|
66
|
-
# Ruby turns all key-value arguments at the end into a single hash
|
67
|
-
# e.g. Wordnik.word.get_examples('dingo', :limit => 10, :part_of_speech => 'verb')
|
68
|
-
# becomes {:limit => 10, :part_of_speech => 'verb'}
|
69
|
-
last_arg = args.pop if args.last.is_a?(Hash)
|
70
|
-
last_arg = args.pop if args.last.is_a?(Array)
|
71
|
-
last_arg ||= {}
|
72
|
-
|
73
|
-
# Look for a kwarg called :request_only, whose presence indicates
|
74
|
-
# that we want the request itself back, not the response body
|
75
|
-
if last_arg.is_a?(Hash) && last_arg[:request_only].present?
|
76
|
-
request_only = true
|
77
|
-
last_arg.delete(:request_only)
|
78
|
-
end
|
79
|
-
|
80
|
-
params = last_arg
|
81
|
-
body ||= {}
|
82
|
-
request = Wordnik::Request.new(http_method, path, :params => params, :body => body)
|
83
|
-
request_only ? request : request.response.body
|
84
|
-
end
|
85
|
-
|
86
|
-
# Returns weighted terms related to the input word
|
87
|
-
#
|
88
|
-
def get_related_words(word, *args)
|
89
|
-
http_method = :get
|
90
|
-
path = '/partner/{word}/related'
|
91
|
-
path.sub!('{word}', word.to_s)
|
92
|
-
|
93
|
-
# Ruby turns all key-value arguments at the end into a single hash
|
94
|
-
# e.g. Wordnik.word.get_examples('dingo', :limit => 10, :part_of_speech => 'verb')
|
95
|
-
# becomes {:limit => 10, :part_of_speech => 'verb'}
|
96
|
-
last_arg = args.pop if args.last.is_a?(Hash)
|
97
|
-
last_arg = args.pop if args.last.is_a?(Array)
|
98
|
-
last_arg ||= {}
|
99
|
-
|
100
|
-
# Look for a kwarg called :request_only, whose presence indicates
|
101
|
-
# that we want the request itself back, not the response body
|
102
|
-
if last_arg.is_a?(Hash) && last_arg[:request_only].present?
|
103
|
-
request_only = true
|
104
|
-
last_arg.delete(:request_only)
|
105
|
-
end
|
106
|
-
|
107
|
-
params = last_arg
|
108
|
-
body ||= {}
|
109
|
-
request = Wordnik::Request.new(http_method, path, :params => params, :body => body)
|
110
|
-
request_only ? request : request.response.body
|
111
|
-
end
|
112
|
-
|
113
|
-
# Fetches GlossaryEntry objects for the specified Glossary.
|
114
|
-
#
|
115
|
-
def get_glossary_entries(permalink, *args)
|
116
|
-
http_method = :get
|
117
|
-
path = '/partner/glossary/{permalink}/entries'
|
118
|
-
path.sub!('{permalink}', permalink.to_s)
|
119
|
-
|
120
|
-
# Ruby turns all key-value arguments at the end into a single hash
|
121
|
-
# e.g. Wordnik.word.get_examples('dingo', :limit => 10, :part_of_speech => 'verb')
|
122
|
-
# becomes {:limit => 10, :part_of_speech => 'verb'}
|
123
|
-
last_arg = args.pop if args.last.is_a?(Hash)
|
124
|
-
last_arg = args.pop if args.last.is_a?(Array)
|
125
|
-
last_arg ||= {}
|
126
|
-
|
127
|
-
# Look for a kwarg called :request_only, whose presence indicates
|
128
|
-
# that we want the request itself back, not the response body
|
129
|
-
if last_arg.is_a?(Hash) && last_arg[:request_only].present?
|
130
|
-
request_only = true
|
131
|
-
last_arg.delete(:request_only)
|
132
|
-
end
|
133
|
-
|
134
|
-
params = last_arg
|
135
|
-
body ||= {}
|
136
|
-
request = Wordnik::Request.new(http_method, path, :params => params, :body => body)
|
137
|
-
request_only ? request : request.response.body
|
138
|
-
end
|
139
|
-
|
140
|
-
end
|