oxford_dictionary 2.0.1 → 3.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/.rubocop.yml +5 -0
  3. data/CHANGELOG.md +3 -0
  4. data/README.md +3 -0
  5. data/Rakefile +5 -1
  6. data/lib/oxford_dictionary/client.rb +8 -249
  7. data/lib/oxford_dictionary/deserialize.rb +10 -0
  8. data/lib/oxford_dictionary/endpoints/endpoint.rb +1 -0
  9. data/lib/oxford_dictionary/endpoints/entries.rb +14 -10
  10. data/lib/oxford_dictionary/endpoints/lemmas.rb +18 -0
  11. data/lib/oxford_dictionary/endpoints/search.rb +4 -0
  12. data/lib/oxford_dictionary/endpoints/sentences.rb +4 -0
  13. data/lib/oxford_dictionary/endpoints/thesaurus.rb +4 -0
  14. data/lib/oxford_dictionary/endpoints/translations.rb +4 -0
  15. data/lib/oxford_dictionary/request.rb +2 -0
  16. data/lib/oxford_dictionary/version.rb +1 -1
  17. data/oxford_dictionary.gemspec +1 -2
  18. metadata +9 -24
  19. data/fixtures/vcr_cassettes/v1_entry.yml +0 -526
  20. data/fixtures/vcr_cassettes/v1_entry_antonym_synonym.yml +0 -42
  21. data/fixtures/vcr_cassettes/v1_entry_antonyms.yml +0 -42
  22. data/fixtures/vcr_cassettes/v1_entry_definitions.yml +0 -228
  23. data/fixtures/vcr_cassettes/v1_entry_error.yml +0 -49
  24. data/fixtures/vcr_cassettes/v1_entry_es.yml +0 -108
  25. data/fixtures/vcr_cassettes/v1_entry_examples.yml +0 -242
  26. data/fixtures/vcr_cassettes/v1_entry_past_nouns.yml +0 -49
  27. data/fixtures/vcr_cassettes/v1_entry_pronunciations.yml +0 -156
  28. data/fixtures/vcr_cassettes/v1_entry_synonyms.yml +0 -42
  29. data/fixtures/vcr_cassettes/v1_entry_us.yml +0 -526
  30. data/fixtures/vcr_cassettes/v1_inflection.yml +0 -74
  31. data/fixtures/vcr_cassettes/v1_inflection_filters.yml +0 -52
  32. data/fixtures/vcr_cassettes/v1_search.yml +0 -42
  33. data/fixtures/vcr_cassettes/v1_search_prefix.yml +0 -42
  34. data/fixtures/vcr_cassettes/v1_search_translation.yml +0 -42
@@ -1,42 +0,0 @@
1
- ---
2
- http_interactions:
3
- - request:
4
- method: get
5
- uri: https://od-api.oxforddictionaries.com/api/v2/thesaurus/en/vapid?fields=antonyms,synonyms
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: 403
25
- message: Forbidden
26
- headers:
27
- Content-Type:
28
- - text/plain; charset=us-ascii
29
- Date:
30
- - Sun, 30 Jun 2019 01:14:06 GMT
31
- Server:
32
- - openresty/1.13.6.2
33
- Content-Length:
34
- - '21'
35
- Connection:
36
- - keep-alive
37
- body:
38
- encoding: UTF-8
39
- string: Authentication failed
40
- http_version:
41
- recorded_at: Sun, 30 Jun 2019 01:14:06 GMT
42
- recorded_with: VCR 4.0.0
@@ -1,42 +0,0 @@
1
- ---
2
- http_interactions:
3
- - request:
4
- method: get
5
- uri: https://od-api.oxforddictionaries.com/api/v2/thesaurus/en/vapid?fields=antonyms
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: 403
25
- message: Forbidden
26
- headers:
27
- Content-Type:
28
- - text/plain; charset=us-ascii
29
- Date:
30
- - Sun, 30 Jun 2019 01:14:04 GMT
31
- Server:
32
- - openresty/1.13.6.2
33
- Content-Length:
34
- - '21'
35
- Connection:
36
- - keep-alive
37
- body:
38
- encoding: UTF-8
39
- string: Authentication failed
40
- http_version:
41
- recorded_at: Sun, 30 Jun 2019 01:14:04 GMT
42
- recorded_with: VCR 4.0.0
@@ -1,228 +0,0 @@
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
@@ -1,49 +0,0 @@
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
@@ -1,108 +0,0 @@
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