arb-dict 0.2.3 → 0.2.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8fed4725735c6c23cd964c3239aa454c8d1ee6c0
4
- data.tar.gz: 3d304afaea8cc21216649e1da5c9b080dec183a4
3
+ metadata.gz: f619ff315f143f075fdd5e975a79e051eb678bd5
4
+ data.tar.gz: eb0e268deae4a9fd6d0c6920b5692df8f2d048c6
5
5
  SHA512:
6
- metadata.gz: 393b0a99314750af6b1730a1e2df06f1b1fe542a0bc3bd36e8e410efc4a7bab7e4af46c0a12610e398513bc35f03192c770f717a6db1e9ae46838b731751ff70
7
- data.tar.gz: 88498063f8e6d35ad56c51d703a69e6edca97b6bcb8f14c89eea5c643f1432eb1e48955528be87f97a8b04213b3b2c158bc998e41f2a8f27296d1c4bdb233ce4
6
+ metadata.gz: 544303a78a66ebaeefaea6955fbf8bea3e726ead4b933d8e4b5d7bd32ff942a0869f8ae24a2bce45808b26093320ae0b6c0a012600a07fbd083752fd15509ccb
7
+ data.tar.gz: 9521c7a613d54e163c84d0f8f1873db2457ee5e7b69d36a40d8f5c23fe37870078ded8b9f3d2ac65f745a0c86ac6d4886c8c146a459bf48b6dfd25cdc9377b23
@@ -52,6 +52,7 @@ if opts
52
52
  end
53
53
  opts.args.each do |entity|
54
54
  main_hash=Arb::Dict.query(entity)
55
+ main_hash=main_hash.map{|tmp| [tmp[0],tmp[1] || 'NOT FOUND']}.to_h
55
56
  send "fmt_#{opts[:format]}", main_hash,opts[:separator]
56
57
  end
57
58
  end
@@ -9,12 +9,12 @@ module Arb
9
9
  tmp_hash = JSON.parse(open("http://dict.youdao.com/jsonresult?q=#{URI.encode(entity)}&type=1").read)
10
10
  main_hash = { entity: entity }
11
11
  if entity.ascii_only?
12
- main_hash[:phonetic_us]=strict_value(tmp_hash['sm'],'No US Phonetic')
13
- main_hash[:phonetic_uk]=strict_value(tmp_hash['uksm'],'No UK Phonetic')
12
+ main_hash[:phonetic_us]=strict_value(tmp_hash['sm'],nil)
13
+ main_hash[:phonetic_uk]=strict_value(tmp_hash['uksm'],nil)
14
14
  else
15
- main_hash[:phonetic]=strict_value(tmp_hash['sm'],'No Phonetic')
15
+ main_hash[:phonetic]=strict_value(tmp_hash['sm'],nil)
16
16
  end
17
- main_hash[:translation]=strict_value(tmp_hash['basic'],'No Translation')
17
+ main_hash[:translation]=strict_value(tmp_hash['basic'],nil)
18
18
  main_hash
19
19
  end
20
20
  private
@@ -1,5 +1,5 @@
1
1
  module Arb
2
2
  module Dict
3
- VERSION = "0.2.3"
3
+ VERSION = "0.2.4"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: arb-dict
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - arybin