rbbt-sources 3.1.28 → 3.1.29

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: 50eb50d6c48d792ccc7836dbd196b9536f26039a
4
- data.tar.gz: 25c973bfc1207dd74a88a50b9a10d9f9024fc22f
3
+ metadata.gz: 14ec519ad1a7309351fadacf8d418b197c931769
4
+ data.tar.gz: 8426ce938123e929a04a07bbb6c0ab5d12be6b04
5
5
  SHA512:
6
- metadata.gz: 69dedb4d4c1f297931ec739dd397753f824cb6a1b34f09693d785d9e530940823eb36bb5b994b1b77869077cbb7a3ccd02e15e5dda903c7e5f9ce3e6765909e8
7
- data.tar.gz: afc19612fe773c97906fef56e12d9a2ca3b0f1b93479c6113164e0eca50460271fe2dcb0fada678bbebc093fa508db20b49784c37c0cd7e5be44ff635d32b94e
6
+ metadata.gz: d817ada6d2df2a355dd3ac7ae6c98d3261f029bd9a82a02e45c0022118ff88b99e5ead63c6d424c6a522e0c4d89f66ac4b0c00c33d4007cd9462dbb8b3923ba6
7
+ data.tar.gz: adf03a5ba5263bcb10877e8823826b9239cbabc73e9fe81ace8b2d21e2da0505d6a350f7c36f44efe73af0257863ec0077b6a7255abbb7daa3dfba857b6717bc
@@ -257,11 +257,19 @@ module PubMed
257
257
  result[pmid] = xml
258
258
  end
259
259
 
260
+ ids.each{|id| next if id.nil? or result[id]; fid = id.sub(/^0+/,''); next unless result[fid]; result[id] = result[fid]}
261
+ ids.each{|id| next if id.nil? or result[id]; result[id] = ""}
262
+
260
263
  result
261
264
  end
262
265
 
263
266
  articles = {}
264
- pmids.each{|id| next if id.nil? or result_files[id].nil?; articles[id] = Article.new(Open.read(result_files[id])) }
267
+ pmids.each do |id|
268
+ next if id.nil? or result_files[id].nil?
269
+ txt = Open.read(result_files[id])
270
+ next if txt.empty?
271
+ articles[id] = Article.new(txt)
272
+ end
265
273
 
266
274
  if _array
267
275
  articles
@@ -31,6 +31,14 @@ class TestPubMed < Test::Unit::TestCase
31
31
  assert("vazquez2008sent", PubMed::Article.make_bibentry('vazquez', 2008, "SENT: Semantic features in text"))
32
32
  assert("vazquez2008aes", PubMed::Article.make_bibentry('vazquez', 2008, "An Example System"))
33
33
  end
34
+
35
+ def test_missing
36
+ pmids = '18627426,014966295'.split(",")
37
+ Log.severity = 0
38
+ assert PubMed.get_article(pmids).include? "014966295"
39
+ assert ! PubMed.get_article(pmids).include?("18627426")
40
+ end
41
+
34
42
  end
35
43
 
36
44
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rbbt-sources
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.28
4
+ version: 3.1.29
5
5
  platform: ruby
6
6
  authors:
7
7
  - Miguel Vazquez
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-12-22 00:00:00.000000000 Z
11
+ date: 2018-01-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rbbt-util