rbbt-sources 3.1.28 → 3.1.29
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 +4 -4
- data/lib/rbbt/sources/pubmed.rb +9 -1
- data/test/rbbt/sources/test_pubmed.rb +8 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 14ec519ad1a7309351fadacf8d418b197c931769
|
4
|
+
data.tar.gz: 8426ce938123e929a04a07bbb6c0ab5d12be6b04
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d817ada6d2df2a355dd3ac7ae6c98d3261f029bd9a82a02e45c0022118ff88b99e5ead63c6d424c6a522e0c4d89f66ac4b0c00c33d4007cd9462dbb8b3923ba6
|
7
|
+
data.tar.gz: adf03a5ba5263bcb10877e8823826b9239cbabc73e9fe81ace8b2d21e2da0505d6a350f7c36f44efe73af0257863ec0077b6a7255abbb7daa3dfba857b6717bc
|
data/lib/rbbt/sources/pubmed.rb
CHANGED
@@ -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
|
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.
|
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:
|
11
|
+
date: 2018-01-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rbbt-util
|