oxford_dictionary 1.3.1 → 2.0.0
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/CHANGELOG.md +12 -0
- data/README.md +37 -49
- data/fixtures/vcr_cassettes/v1_entry.yml +526 -0
- data/fixtures/vcr_cassettes/v1_entry_antonym_synonym.yml +42 -0
- data/fixtures/vcr_cassettes/v1_entry_antonyms.yml +42 -0
- data/fixtures/vcr_cassettes/v1_entry_definitions.yml +228 -0
- data/fixtures/vcr_cassettes/v1_entry_error.yml +49 -0
- data/fixtures/vcr_cassettes/v1_entry_es.yml +108 -0
- data/fixtures/vcr_cassettes/v1_entry_examples.yml +242 -0
- data/fixtures/vcr_cassettes/v1_entry_past_nouns.yml +49 -0
- data/fixtures/vcr_cassettes/v1_entry_pronunciations.yml +156 -0
- data/fixtures/vcr_cassettes/v1_entry_synonyms.yml +42 -0
- data/fixtures/vcr_cassettes/v1_entry_us.yml +526 -0
- data/fixtures/vcr_cassettes/v1_inflection.yml +74 -0
- data/fixtures/vcr_cassettes/v1_inflection_filters.yml +52 -0
- data/fixtures/vcr_cassettes/v1_search.yml +42 -0
- data/fixtures/vcr_cassettes/v1_search_prefix.yml +42 -0
- data/fixtures/vcr_cassettes/v1_search_translation.yml +42 -0
- data/lib/oxford_dictionary/client.rb +211 -18
- data/lib/oxford_dictionary/version.rb +1 -1
- metadata +19 -16
- data/lib/oxford_dictionary/api_objects/entry.rb +0 -11
- data/lib/oxford_dictionary/api_objects/entry_response.rb +0 -12
- data/lib/oxford_dictionary/api_objects/lexical_entry.rb +0 -16
- data/lib/oxford_dictionary/api_objects/list_response.rb +0 -7
- data/lib/oxford_dictionary/api_objects/pronunciation.rb +0 -10
- data/lib/oxford_dictionary/api_objects/sense.rb +0 -19
- data/lib/oxford_dictionary/deprecated_request.rb +0 -127
- data/lib/oxford_dictionary/endpoints/entry_endpoint.rb +0 -131
- data/lib/oxford_dictionary/endpoints/inflection_endpoint.rb +0 -23
- data/lib/oxford_dictionary/endpoints/search_endpoint.rb +0 -26
- data/lib/oxford_dictionary/endpoints/wordlist_endpoint.rb +0 -35
- data/lib/oxford_dictionary/error.rb +0 -10
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 76a707cc6713b8162a27f4ccbd2dd5f705a2488298fc6a4f47f64c1cdf58249f
|
|
4
|
+
data.tar.gz: c1ccb8317f36dfd52dcf0dcf84600c8cf698030f94e1a67edca17ae7b0a7623d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 8adefff2b029d5e3bc780c12f457848ef97000a34bf04fec3a9211b330fb55ed0477283c34c2f919a570d6425d58928c72d923ff7968595a3871c7e535831af0
|
|
7
|
+
data.tar.gz: 7fced4aff346f014ade560cb5652d157ed289e7f8862da9881dc6aa07308b1b7c57c07db2019bc82274ff6bf81eb763ce66ef4ee97332ced2c8fd4663c678718
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
## OxfordDictionary master (unreleased)
|
|
2
2
|
|
|
3
|
+
## OxfordDictionary 2.0.0 (2019-06-29)
|
|
4
|
+
- Remove wordlist endpoint
|
|
5
|
+
[\#20](https://github.com/swcraig/oxford-dictionary/pull/20)
|
|
6
|
+
- Use new V2 interface for V1 inflection usage
|
|
7
|
+
[\#21](https://github.com/swcraig/oxford-dictionary/pull/21)
|
|
8
|
+
- Use new V2 interface for V1 search usage
|
|
9
|
+
[\#22](https://github.com/swcraig/oxford-dictionary/pull/22)
|
|
10
|
+
- Use new V2 interface for V1 entry usage
|
|
11
|
+
[\#23](https://github.com/swcraig/oxford-dictionary/pull/23)
|
|
12
|
+
- Remove all V1 functionality
|
|
13
|
+
[\#24](https://github.com/swcraig/oxford-dictionary/pull/24)
|
|
14
|
+
|
|
3
15
|
## OxfordDictionary 1.3.0 (2019-06-22)
|
|
4
16
|
|
|
5
17
|
- Add V2 translations support
|
data/README.md
CHANGED
|
@@ -19,79 +19,67 @@ client = OxfordDictionary::Client.new(app_id: 'ID', app_key: 'SECRET')
|
|
|
19
19
|
client = OxfordDictionary.new(app_id: 'ID', app_key: 'SECRET')
|
|
20
20
|
```
|
|
21
21
|
### Usage Examples
|
|
22
|
-
Some documentation on the different endpoint function calls can be found [here](http://rubydoc.info/gems/oxford_dictionary/OxfordDictionary/Endpoints)
|
|
23
|
-
|
|
24
22
|
This wrapper follows the schema laid out by the API quite closely. The data
|
|
25
23
|
schema for the different API calls can be found [here](https://developer.oxforddictionaries.com/documentation).
|
|
26
24
|
|
|
27
|
-
######
|
|
25
|
+
###### Entries
|
|
28
26
|
```ruby
|
|
29
|
-
entry = client.entry('vapid')
|
|
27
|
+
entry = client.entry(word: 'vapid', dataset: 'en-gb', params: {})
|
|
30
28
|
|
|
31
29
|
# Access the first entry
|
|
32
30
|
# Refer to the API documentation for the schema of the returned data structure
|
|
33
|
-
first_lexical_entry = entry.
|
|
31
|
+
first_lexical_entry = entry.lexicalEntries.first
|
|
34
32
|
|
|
35
33
|
# With some filters
|
|
36
34
|
filters = { lexicalCategory: 'Verb', domains: 'Art'}
|
|
37
|
-
client.entry('truth', filters)
|
|
35
|
+
client.entry(word: 'truth', dataset: 'en-gb', params: filters)
|
|
36
|
+
|
|
37
|
+
# You can also search for the results for different datasets
|
|
38
|
+
# Refer to the Oxford Dictionaries documentation for all the
|
|
39
|
+
# possible datasets
|
|
40
|
+
client.entry(word: 'ace', dataset: 'es', params: {})
|
|
38
41
|
|
|
39
|
-
#
|
|
40
|
-
|
|
42
|
+
# You can query for results from a specific "field"
|
|
43
|
+
# Refer to the Oxford Dictionaries documentation for all the
|
|
44
|
+
# possible fields
|
|
45
|
+
client.entry(word: 'explain', dataset: 'en-gb', params: { fields: 'examples' })
|
|
41
46
|
|
|
42
|
-
# From a dictionary of a specific language (default is 'en')
|
|
43
|
-
client.entry('ace', lang: 'es')
|
|
44
47
|
```
|
|
45
48
|
|
|
46
|
-
######
|
|
49
|
+
###### Lemmas
|
|
47
50
|
```ruby
|
|
48
|
-
|
|
49
|
-
examples = client.entry_examples('explain')
|
|
50
|
-
|
|
51
|
-
# Or only the pronunciations...
|
|
52
|
-
the_noises = client.entry_pronunciations('knight')
|
|
53
|
-
|
|
54
|
-
# Or the translations (for Swahili in this example)
|
|
55
|
-
en_to_es = client.entry_translations('change', translations: 'sw')
|
|
56
|
-
# If no :translations filter is supplied, default is 'es'
|
|
57
|
-
|
|
58
|
-
# Or some of the other documented API calls
|
|
59
|
-
client.entry_sentences('scholar')
|
|
60
|
-
client.entry_definitions('correct')
|
|
61
|
-
client.entry_antonyms_synonyms('monotonous')
|
|
62
|
-
# Etc...
|
|
63
|
-
|
|
64
|
-
# Generally the method names follow the documented API closely
|
|
51
|
+
client.lemma(word: 'condition', language: 'en', params: {})
|
|
65
52
|
```
|
|
66
53
|
|
|
67
|
-
######
|
|
54
|
+
###### Translations
|
|
68
55
|
```ruby
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
# Or the search endpoint
|
|
76
|
-
search_results = client.search('condition', prefix: true)
|
|
56
|
+
client.translation(
|
|
57
|
+
word: 'condition',
|
|
58
|
+
source_language: 'en',
|
|
59
|
+
target_language: 'es',
|
|
60
|
+
params: {}
|
|
61
|
+
)
|
|
77
62
|
```
|
|
78
63
|
|
|
79
|
-
######
|
|
80
|
-
There isn't much argument checking at the moment. Some endpoints do not accept filter arguments, refer to the API documentation to check for endpoints that accept filters.
|
|
64
|
+
###### Sentences
|
|
81
65
|
```ruby
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
filters = { lang: 'es' }
|
|
85
|
-
|
|
86
|
-
# To use multiple values on a single filter, make it an array
|
|
87
|
-
filters = { lexicalCategory: ['Noun', 'Verb'] }
|
|
66
|
+
client.sentence(word: 'paraphrase', language: 'en', params: {})
|
|
67
|
+
```
|
|
88
68
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
69
|
+
###### Search
|
|
70
|
+
```ruby
|
|
71
|
+
client.search(language: 'en-gb', params: { q: 'vapid' })
|
|
92
72
|
```
|
|
93
73
|
|
|
94
|
-
|
|
74
|
+
###### Thesaurus
|
|
75
|
+
```ruby
|
|
76
|
+
client.thesaurus(
|
|
77
|
+
word: 'book',
|
|
78
|
+
language: 'en',
|
|
79
|
+
params: { fields: 'synonyms,antonyms}
|
|
80
|
+
)
|
|
81
|
+
# Or use { fields: 'synonyms' } for just synonyms
|
|
82
|
+
```
|
|
95
83
|
|
|
96
84
|
## Development
|
|
97
85
|
|