Skip to content

Commit

Permalink
Deprecate V1 Thesaurus functionality
Browse files Browse the repository at this point in the history
Oxford Dictionaries is updating their API to a new version which
includes quite a few changes:
https://developer.oxforddictionaries.com/version2

They are moving the thesaurus functionality to its own endpoint
(instead of having part of the entries endpoint).

Use `Client#thesaurus` instead. Specifically use `Client#thesaurus` with
the `filter` parameter to define what you want.

For example:

```
Client.thesaurus(
  word: 'ace',
  language: 'en',
  params: { filter: 'synonyms,antonyms' }
)

```
  • Loading branch information
swcraig committed Jun 23, 2019
1 parent 3a32f75 commit 8a55e0f
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions lib/oxford_dictionary/endpoints/entry_endpoint.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,43 @@ def entry_sentences(query, params = {})
end

def entry_antonyms(query, params = {})
warn '''
Client#entry_antonyms is DEPRECATED and will become non-functional
on June 30, 2019. Use Client#thesaurus instead. Reference
https://github.com/swcraig/oxford-dictionary/pull/13 for more
information. Check out OxfordDictionary::Endpoints::Thesaurus for the
interface to use. Specifically use it with
params: { fields: \'antonyms\' }
'''

params[:end] = 'antonyms'
entry_request(query, params)
end

def entry_synonyms(query, params = {})
warn '''
Client#entry_synonyms is DEPRECATED and will become non-functional
on June 30, 2019. Use Client#thesaurus instead. Reference
https://github.com/swcraig/oxford-dictionary/pull/13 for more
information. Check out OxfordDictionary::Endpoints::Thesaurus for the
interface to use. Specifically use it with
params: { fields: \'synonyms\' }
'''

params[:end] = 'synonyms'
entry_request(query, params)
end

def entry_antonyms_synonyms(query, params = {})
warn '''
Client#entry_antonyms_synonyms is DEPRECATED and will be non-functional
on June 30, 2019. Use Client#thesaurus instead. Reference
https://github.com/swcraig/oxford-dictionary/pull/14 for more
information. Check out OxfordDictionary::Endpoints::Thesaurus for the
interface to use. Specifically use it with
params: { fields: \'synonyms,antonyms\' }
'''

params[:end] = 'synonyms;antonyms'
entry_request(query, params)
end
Expand Down

0 comments on commit 8a55e0f

Please sign in to comment.