PearsonLongman-Dictionary 0.4.1 → 0.4.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f849e40cb12345214befbe7b4dd0b0efbe61c38b
4
- data.tar.gz: 3559acc5691b294ada7f6ada0364ab6f0550ebbd
3
+ metadata.gz: 10edccc30fe9fdd7d871bacadba4e404c568baa2
4
+ data.tar.gz: bc8454a7bd6b30460fa2271b5baf690e40a7dc66
5
5
  SHA512:
6
- metadata.gz: d8d6a7e3d4849376ca31a45fb793feb1577e3d61be16077bf345a09ee91b0efdad6b07fc6adc7f6c7f58304ff2d0badd974dec1173d2d510dc272d54320fbb02
7
- data.tar.gz: 95cf06b8a1ee10fbba9387c06bfa46210a5b51d99b0264d16c880729e5c0ba3f6fddc5d27d1d6e5f6358870716cb96fdc384ad331983b559b9e9b5db0ed4f377
6
+ metadata.gz: 5f13af9a9d397685f4bb46339963258134fec285028e1f859774783a74368e87d7644955830875fe280dbc59725706619724b730ccb747635e1b8de663b3c4cc
7
+ data.tar.gz: 3e34028d41da4d42e57486a6b75fa1fc12d7267720e2da22bb3a1a388669ead9466c272879fc4da8242c01aa0c8492b392c064c756e30ebc7492a48d861eae83
@@ -42,7 +42,10 @@ module DictionaryLookup
42
42
  part_of_speech = result["part_of_speech"]
43
43
  entries = result["url"]
44
44
  # In wordwise dictionary, value of definition is String. Hence the is_a? test
45
+ begin
45
46
  _definitions = result["senses"].first["definition"]
47
+ rescue => e
48
+ else
46
49
  denotation = _definitions.is_a?(Array) ? _definitions.first : _definitions
47
50
  if result["senses"].first["examples"].nil?
48
51
  examples = []
@@ -54,6 +57,7 @@ module DictionaryLookup
54
57
  else
55
58
  pronunciations = result["pronunciations"].first["audio"].map{|e| e["url"]}
56
59
  end
60
+ end
57
61
  definitions << DictionaryLookup::Definition.new(headword, part_of_speech, denotation, examples, pronunciations, entries)
58
62
  end
59
63
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: PearsonLongman-Dictionary
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Arnold Tonderai Marunda