oxford_dictionary 1.3.1 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (34) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +12 -0
  3. data/README.md +37 -49
  4. data/fixtures/vcr_cassettes/v1_entry.yml +526 -0
  5. data/fixtures/vcr_cassettes/v1_entry_antonym_synonym.yml +42 -0
  6. data/fixtures/vcr_cassettes/v1_entry_antonyms.yml +42 -0
  7. data/fixtures/vcr_cassettes/v1_entry_definitions.yml +228 -0
  8. data/fixtures/vcr_cassettes/v1_entry_error.yml +49 -0
  9. data/fixtures/vcr_cassettes/v1_entry_es.yml +108 -0
  10. data/fixtures/vcr_cassettes/v1_entry_examples.yml +242 -0
  11. data/fixtures/vcr_cassettes/v1_entry_past_nouns.yml +49 -0
  12. data/fixtures/vcr_cassettes/v1_entry_pronunciations.yml +156 -0
  13. data/fixtures/vcr_cassettes/v1_entry_synonyms.yml +42 -0
  14. data/fixtures/vcr_cassettes/v1_entry_us.yml +526 -0
  15. data/fixtures/vcr_cassettes/v1_inflection.yml +74 -0
  16. data/fixtures/vcr_cassettes/v1_inflection_filters.yml +52 -0
  17. data/fixtures/vcr_cassettes/v1_search.yml +42 -0
  18. data/fixtures/vcr_cassettes/v1_search_prefix.yml +42 -0
  19. data/fixtures/vcr_cassettes/v1_search_translation.yml +42 -0
  20. data/lib/oxford_dictionary/client.rb +211 -18
  21. data/lib/oxford_dictionary/version.rb +1 -1
  22. metadata +19 -16
  23. data/lib/oxford_dictionary/api_objects/entry.rb +0 -11
  24. data/lib/oxford_dictionary/api_objects/entry_response.rb +0 -12
  25. data/lib/oxford_dictionary/api_objects/lexical_entry.rb +0 -16
  26. data/lib/oxford_dictionary/api_objects/list_response.rb +0 -7
  27. data/lib/oxford_dictionary/api_objects/pronunciation.rb +0 -10
  28. data/lib/oxford_dictionary/api_objects/sense.rb +0 -19
  29. data/lib/oxford_dictionary/deprecated_request.rb +0 -127
  30. data/lib/oxford_dictionary/endpoints/entry_endpoint.rb +0 -131
  31. data/lib/oxford_dictionary/endpoints/inflection_endpoint.rb +0 -23
  32. data/lib/oxford_dictionary/endpoints/search_endpoint.rb +0 -26
  33. data/lib/oxford_dictionary/endpoints/wordlist_endpoint.rb +0 -35
  34. data/lib/oxford_dictionary/error.rb +0 -10
@@ -0,0 +1,228 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://od-api.oxforddictionaries.com/api/v2/entries/en-gb/ace?fields=definitions
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Accept-Encoding:
11
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
12
+ Accept:
13
+ - application/json
14
+ User-Agent:
15
+ - Ruby
16
+ Host:
17
+ - od-api.oxforddictionaries.com
18
+ App-Id:
19
+ - APP_ID
20
+ App-Key:
21
+ - APP_KEY
22
+ response:
23
+ status:
24
+ code: 200
25
+ message: OK
26
+ headers:
27
+ Api-Version:
28
+ - v2
29
+ Code-Version:
30
+ - v2.3.2-g02aa52c
31
+ Content-Type:
32
+ - application/json;charset=utf-8
33
+ Date:
34
+ - Sun, 30 Jun 2019 01:14:00 GMT
35
+ Server:
36
+ - openresty/1.13.6.2
37
+ Content-Length:
38
+ - '7392'
39
+ Connection:
40
+ - keep-alive
41
+ body:
42
+ encoding: UTF-8
43
+ string: |-
44
+ {
45
+ "id": "ace",
46
+ "metadata": {
47
+ "operation": "retrieve",
48
+ "provider": "Oxford University Press",
49
+ "schema": "RetrieveEntry"
50
+ },
51
+ "results": [
52
+ {
53
+ "id": "ace",
54
+ "language": "en-gb",
55
+ "lexicalEntries": [
56
+ {
57
+ "entries": [
58
+ {
59
+ "homographNumber": "100",
60
+ "senses": [
61
+ {
62
+ "definitions": [
63
+ "a playing card with a single spot on it, ranked as the highest card in its suit in most card games"
64
+ ],
65
+ "id": "m_en_gbus0005680.006"
66
+ },
67
+ {
68
+ "definitions": [
69
+ "a person who excels at a particular sport or other activity"
70
+ ],
71
+ "id": "m_en_gbus0005680.010",
72
+ "subsenses": [
73
+ {
74
+ "definitions": [
75
+ "a pilot who has shot down many enemy aircraft"
76
+ ],
77
+ "id": "m_en_gbus0005680.011"
78
+ }
79
+ ]
80
+ },
81
+ {
82
+ "definitions": [
83
+ "(in tennis and similar games) a service that an opponent is unable to return and thus wins a point"
84
+ ],
85
+ "id": "m_en_gbus0005680.013",
86
+ "subsenses": [
87
+ {
88
+ "definitions": [
89
+ "a hole in one"
90
+ ],
91
+ "id": "m_en_gbus0005680.014"
92
+ }
93
+ ]
94
+ }
95
+ ]
96
+ }
97
+ ],
98
+ "language": "en-gb",
99
+ "lexicalCategory": {
100
+ "id": "noun",
101
+ "text": "Noun"
102
+ },
103
+ "text": "ace"
104
+ },
105
+ {
106
+ "entries": [
107
+ {
108
+ "homographNumber": "101",
109
+ "senses": [
110
+ {
111
+ "definitions": [
112
+ "very good"
113
+ ],
114
+ "id": "m_en_gbus0005680.016"
115
+ }
116
+ ]
117
+ }
118
+ ],
119
+ "language": "en-gb",
120
+ "lexicalCategory": {
121
+ "id": "adjective",
122
+ "text": "Adjective"
123
+ },
124
+ "text": "ace"
125
+ },
126
+ {
127
+ "entries": [
128
+ {
129
+ "homographNumber": "102",
130
+ "senses": [
131
+ {
132
+ "definitions": [
133
+ "(in tennis and similar games) serve an ace against (an opponent)"
134
+ ],
135
+ "id": "m_en_gbus0005680.020",
136
+ "subsenses": [
137
+ {
138
+ "definitions": [
139
+ "score an ace on (a hole) or with (a shot)"
140
+ ],
141
+ "id": "m_en_gbus0005680.026"
142
+ }
143
+ ]
144
+ },
145
+ {
146
+ "definitions": [
147
+ "achieve high marks in (a test or exam)"
148
+ ],
149
+ "id": "m_en_gbus0005680.028",
150
+ "subsenses": [
151
+ {
152
+ "definitions": [
153
+ "outdo someone in a competitive situation"
154
+ ],
155
+ "id": "m_en_gbus0005680.029"
156
+ }
157
+ ]
158
+ }
159
+ ]
160
+ }
161
+ ],
162
+ "language": "en-gb",
163
+ "lexicalCategory": {
164
+ "id": "verb",
165
+ "text": "Verb"
166
+ },
167
+ "text": "ace"
168
+ }
169
+ ],
170
+ "type": "headword",
171
+ "word": "ace"
172
+ },
173
+ {
174
+ "id": "ace",
175
+ "language": "en-gb",
176
+ "lexicalEntries": [
177
+ {
178
+ "entries": [
179
+ {
180
+ "homographNumber": "200",
181
+ "senses": [
182
+ {
183
+ "definitions": [
184
+ "a person who has no sexual feelings or desires"
185
+ ],
186
+ "id": "m_en_gbus1190638.004"
187
+ }
188
+ ]
189
+ }
190
+ ],
191
+ "language": "en-gb",
192
+ "lexicalCategory": {
193
+ "id": "noun",
194
+ "text": "Noun"
195
+ },
196
+ "text": "ace"
197
+ },
198
+ {
199
+ "entries": [
200
+ {
201
+ "homographNumber": "201",
202
+ "senses": [
203
+ {
204
+ "definitions": [
205
+ "(of a person) having no sexual feelings or desires; asexual"
206
+ ],
207
+ "id": "m_en_gbus1190638.006"
208
+ }
209
+ ]
210
+ }
211
+ ],
212
+ "language": "en-gb",
213
+ "lexicalCategory": {
214
+ "id": "adjective",
215
+ "text": "Adjective"
216
+ },
217
+ "text": "ace"
218
+ }
219
+ ],
220
+ "type": "headword",
221
+ "word": "ace"
222
+ }
223
+ ],
224
+ "word": "ace"
225
+ }
226
+ http_version:
227
+ recorded_at: Sun, 30 Jun 2019 01:14:00 GMT
228
+ recorded_with: VCR 4.0.0
@@ -0,0 +1,49 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://od-api.oxforddictionaries.com/api/v2/entries/en-gb/wordthatdoesnotexist
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Accept-Encoding:
11
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
12
+ Accept:
13
+ - application/json
14
+ User-Agent:
15
+ - Ruby
16
+ Host:
17
+ - od-api.oxforddictionaries.com
18
+ App-Id:
19
+ - APP_ID
20
+ App-Key:
21
+ - APP_KEY
22
+ response:
23
+ status:
24
+ code: 404
25
+ message: NOT FOUND
26
+ headers:
27
+ Api-Version:
28
+ - v2
29
+ Code-Version:
30
+ - v2.3.2-g02aa52c
31
+ Content-Type:
32
+ - application/json;charset=utf-8
33
+ Date:
34
+ - Sun, 30 Jun 2019 01:29:22 GMT
35
+ Server:
36
+ - openresty/1.13.6.2
37
+ Content-Length:
38
+ - '90'
39
+ Connection:
40
+ - keep-alive
41
+ body:
42
+ encoding: UTF-8
43
+ string: |-
44
+ {
45
+ "error": "No entry found matching supplied source_lang, word and provided filters"
46
+ }
47
+ http_version:
48
+ recorded_at: Sun, 30 Jun 2019 01:29:22 GMT
49
+ recorded_with: VCR 4.0.0
@@ -0,0 +1,108 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://od-api.oxforddictionaries.com/api/v2/entries/es/ace
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Accept-Encoding:
11
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
12
+ Accept:
13
+ - application/json
14
+ User-Agent:
15
+ - Ruby
16
+ Host:
17
+ - od-api.oxforddictionaries.com
18
+ App-Id:
19
+ - APP_ID
20
+ App-Key:
21
+ - APP_KEY
22
+ response:
23
+ status:
24
+ code: 200
25
+ message: OK
26
+ headers:
27
+ Api-Version:
28
+ - v2
29
+ Code-Version:
30
+ - v2.3.2-g02aa52c
31
+ Content-Type:
32
+ - application/json;charset=utf-8
33
+ Date:
34
+ - Sun, 30 Jun 2019 01:13:59 GMT
35
+ Server:
36
+ - openresty/1.13.6.2
37
+ Content-Length:
38
+ - '2317'
39
+ Connection:
40
+ - keep-alive
41
+ body:
42
+ encoding: UTF-8
43
+ string: |-
44
+ {
45
+ "id": "ace",
46
+ "metadata": {
47
+ "operation": "retrieve",
48
+ "provider": "Oxford University Press",
49
+ "schema": "RetrieveEntry"
50
+ },
51
+ "results": [
52
+ {
53
+ "id": "ace",
54
+ "language": "es",
55
+ "lexicalEntries": [
56
+ {
57
+ "entries": [
58
+ {
59
+ "grammaticalFeatures": [
60
+ {
61
+ "id": "masculine",
62
+ "text": "Masculine",
63
+ "type": "Gender"
64
+ }
65
+ ],
66
+ "notes": [
67
+ {
68
+ "text": "Se pronuncia 'eis'",
69
+ "type": "editorialNote"
70
+ },
71
+ {
72
+ "text": "El plural es aces (pronunciado 'eises')",
73
+ "type": "grammaticalNote"
74
+ }
75
+ ],
76
+ "senses": [
77
+ {
78
+ "definitions": [
79
+ "Jugada de tenis en la que el jugador obtiene directamente un tanto al efectuar un saque sin que el adversario consiga tocar la pelota"
80
+ ],
81
+ "domains": [
82
+ {
83
+ "id": "sport",
84
+ "text": "Sport"
85
+ }
86
+ ],
87
+ "id": "id5d20fa17-6641-44d4-ac73-41220aa62a81"
88
+ }
89
+ ]
90
+ }
91
+ ],
92
+ "language": "es",
93
+ "lexicalCategory": {
94
+ "id": "noun",
95
+ "text": "Noun"
96
+ },
97
+ "text": "ace"
98
+ }
99
+ ],
100
+ "type": "headword",
101
+ "word": "ace"
102
+ }
103
+ ],
104
+ "word": "ace"
105
+ }
106
+ http_version:
107
+ recorded_at: Sun, 30 Jun 2019 01:14:00 GMT
108
+ recorded_with: VCR 4.0.0
@@ -0,0 +1,242 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://od-api.oxforddictionaries.com/api/v2/entries/en-gb/ace?fields=examples
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Accept-Encoding:
11
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
12
+ Accept:
13
+ - application/json
14
+ User-Agent:
15
+ - Ruby
16
+ Host:
17
+ - od-api.oxforddictionaries.com
18
+ App-Id:
19
+ - APP_ID
20
+ App-Key:
21
+ - APP_KEY
22
+ response:
23
+ status:
24
+ code: 200
25
+ message: OK
26
+ headers:
27
+ Api-Version:
28
+ - v2
29
+ Code-Version:
30
+ - v2.3.2-g02aa52c
31
+ Content-Type:
32
+ - application/json;charset=utf-8
33
+ Date:
34
+ - Sun, 30 Jun 2019 01:14:01 GMT
35
+ Server:
36
+ - openresty/1.13.6.2
37
+ Content-Length:
38
+ - '8008'
39
+ Connection:
40
+ - keep-alive
41
+ body:
42
+ encoding: UTF-8
43
+ string: |-
44
+ {
45
+ "id": "ace",
46
+ "metadata": {
47
+ "operation": "retrieve",
48
+ "provider": "Oxford University Press",
49
+ "schema": "RetrieveEntry"
50
+ },
51
+ "results": [
52
+ {
53
+ "id": "ace",
54
+ "language": "en-gb",
55
+ "lexicalEntries": [
56
+ {
57
+ "entries": [
58
+ {
59
+ "homographNumber": "100",
60
+ "senses": [
61
+ {
62
+ "examples": [
63
+ {
64
+ "text": "the ace of diamonds"
65
+ },
66
+ {
67
+ "registers": [
68
+ {
69
+ "id": "figurative",
70
+ "text": "Figurative"
71
+ }
72
+ ],
73
+ "text": "life had started dealing him aces again"
74
+ }
75
+ ],
76
+ "id": "m_en_gbus0005680.006"
77
+ },
78
+ {
79
+ "id": "m_en_gbus0005680.010",
80
+ "subsenses": [
81
+ {
82
+ "examples": [
83
+ {
84
+ "text": "a Battle of Britain ace"
85
+ }
86
+ ],
87
+ "id": "m_en_gbus0005680.011"
88
+ }
89
+ ]
90
+ },
91
+ {
92
+ "examples": [
93
+ {
94
+ "text": "Nadal banged down eight aces in the set"
95
+ }
96
+ ],
97
+ "id": "m_en_gbus0005680.013",
98
+ "subsenses": [
99
+ {
100
+ "examples": [
101
+ {
102
+ "text": "his hole in one at the 15th was Senior's second ace as a professional"
103
+ }
104
+ ],
105
+ "id": "m_en_gbus0005680.014"
106
+ }
107
+ ]
108
+ }
109
+ ]
110
+ }
111
+ ],
112
+ "language": "en-gb",
113
+ "lexicalCategory": {
114
+ "id": "noun",
115
+ "text": "Noun"
116
+ },
117
+ "text": "ace"
118
+ },
119
+ {
120
+ "entries": [
121
+ {
122
+ "homographNumber": "101",
123
+ "senses": [
124
+ {
125
+ "examples": [
126
+ {
127
+ "text": "an ace swimmer"
128
+ },
129
+ {
130
+ "notes": [
131
+ {
132
+ "text": "as exclamation",
133
+ "type": "grammaticalNote"
134
+ }
135
+ ],
136
+ "text": "Ace! You've done it!"
137
+ }
138
+ ],
139
+ "id": "m_en_gbus0005680.016"
140
+ }
141
+ ]
142
+ }
143
+ ],
144
+ "language": "en-gb",
145
+ "lexicalCategory": {
146
+ "id": "adjective",
147
+ "text": "Adjective"
148
+ },
149
+ "text": "ace"
150
+ },
151
+ {
152
+ "entries": [
153
+ {
154
+ "homographNumber": "102",
155
+ "senses": [
156
+ {
157
+ "id": "m_en_gbus0005680.020",
158
+ "subsenses": [
159
+ {
160
+ "examples": [
161
+ {
162
+ "text": "there was a prize for the first player to ace the hole"
163
+ }
164
+ ],
165
+ "id": "m_en_gbus0005680.026"
166
+ }
167
+ ]
168
+ }
169
+ ]
170
+ }
171
+ ],
172
+ "language": "en-gb",
173
+ "lexicalCategory": {
174
+ "id": "verb",
175
+ "text": "Verb"
176
+ },
177
+ "text": "ace"
178
+ }
179
+ ],
180
+ "type": "headword",
181
+ "word": "ace"
182
+ },
183
+ {
184
+ "id": "ace",
185
+ "language": "en-gb",
186
+ "lexicalEntries": [
187
+ {
188
+ "entries": [
189
+ {
190
+ "homographNumber": "200",
191
+ "senses": [
192
+ {
193
+ "examples": [
194
+ {
195
+ "text": "both asexual, they have managed to connect with other aces offline"
196
+ }
197
+ ],
198
+ "id": "m_en_gbus1190638.004"
199
+ }
200
+ ]
201
+ }
202
+ ],
203
+ "language": "en-gb",
204
+ "lexicalCategory": {
205
+ "id": "noun",
206
+ "text": "Noun"
207
+ },
208
+ "text": "ace"
209
+ },
210
+ {
211
+ "entries": [
212
+ {
213
+ "homographNumber": "201",
214
+ "senses": [
215
+ {
216
+ "examples": [
217
+ {
218
+ "text": "I didn't realize that I was ace for a long time"
219
+ }
220
+ ],
221
+ "id": "m_en_gbus1190638.006"
222
+ }
223
+ ]
224
+ }
225
+ ],
226
+ "language": "en-gb",
227
+ "lexicalCategory": {
228
+ "id": "adjective",
229
+ "text": "Adjective"
230
+ },
231
+ "text": "ace"
232
+ }
233
+ ],
234
+ "type": "headword",
235
+ "word": "ace"
236
+ }
237
+ ],
238
+ "word": "ace"
239
+ }
240
+ http_version:
241
+ recorded_at: Sun, 30 Jun 2019 01:14:01 GMT
242
+ recorded_with: VCR 4.0.0
@@ -0,0 +1,49 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://od-api.oxforddictionaries.com/api/v2/entries/en-gb/ace?grammaticalFeatures=singular,past&lexicalCategory=noun
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Accept-Encoding:
11
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
12
+ Accept:
13
+ - application/json
14
+ User-Agent:
15
+ - Ruby
16
+ Host:
17
+ - od-api.oxforddictionaries.com
18
+ App-Id:
19
+ - APP_ID
20
+ App-Key:
21
+ - APP_KEY
22
+ response:
23
+ status:
24
+ code: 404
25
+ message: NOT FOUND
26
+ headers:
27
+ Api-Version:
28
+ - v2
29
+ Code-Version:
30
+ - v2.3.2-g02aa52c
31
+ Content-Type:
32
+ - application/json;charset=utf-8
33
+ Date:
34
+ - Sun, 30 Jun 2019 05:08:44 GMT
35
+ Server:
36
+ - openresty/1.13.6.2
37
+ Content-Length:
38
+ - '90'
39
+ Connection:
40
+ - keep-alive
41
+ body:
42
+ encoding: UTF-8
43
+ string: |-
44
+ {
45
+ "error": "No entry found matching supplied source_lang, word and provided filters"
46
+ }
47
+ http_version:
48
+ recorded_at: Sun, 30 Jun 2019 05:08:44 GMT
49
+ recorded_with: VCR 4.0.0