relaton-nist 0.9.0 → 0.9.1

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
  SHA256:
3
- metadata.gz: abd608217be8e9fa36bc9e6d387d76bcac0655cc9ae9cb2ad6dd8a10981f15ec
4
- data.tar.gz: 80e6d48a013bb510009ffc968bb7332daac07a9858bf42895183d848c4ba7e5c
3
+ metadata.gz: b76a47785318a2497fae5a3fdab022b16d6117ad91470a23c46e73773e1e59ea
4
+ data.tar.gz: b33350d778c2c378f208443e5d9a7b636d2f22ee1908a953b6200abed97a7fb5
5
5
  SHA512:
6
- metadata.gz: 1d79eddb9c2a1f58fe7478c1de1d7fd4444a7db3c84b2f59b8b8f3447bedd9ee84cf55297e0b32abbaf42c632f90b7952615203fbc3d1e5c4adfff330446d8ac
7
- data.tar.gz: d327e6358a7f2f5a3b9761c9106b17c6b04c9db026359d217a35a7d501759a26f5767bc68b6ebd01f6a04eaa95693732f34c1e1b701b1d98b6055080bfc1b89b
6
+ metadata.gz: 6ae73a5ae455ca08d1cefaf446a419c07fd1984f7f2e6105666aa87ed2dc01206c8c832d2b0a01cd273cbd5b6248b93b971ab8e68bfb36b2fe8a46a1e95bd09a
7
+ data.tar.gz: 20c7e25ea1fdaa2af341213dfe85ad81357bd40abd035a18468c0f168c5b149eb3e8e5a35d724bbc8838e184233774e6a66fdaaef6a5b1aaf8dc4c12dee63502
@@ -111,21 +111,22 @@ module RelatonNist
111
111
  { years: missed_years }
112
112
  end
113
113
 
114
- def fetch_pages(s, n)
115
- workers = RelatonBib::WorkersPool.new n
114
+ def fetch_pages(hits, threads)
115
+ workers = RelatonBib::WorkersPool.new threads
116
116
  workers.worker { |w| { i: w[:i], hit: w[:hit].fetch } }
117
- s.each_with_index { |hit, i| workers << { i: i, hit: hit } }
117
+ hits.each_with_index { |hit, i| workers << { i: i, hit: hit } }
118
118
  workers.end
119
- workers.result.sort { |x, y| x[:i] <=> y[:i] }.map { |x| x[:hit] }
119
+ workers.result.sort_by { |a| a[:i] }.map { |x| x[:hit] }
120
120
  end
121
121
 
122
122
  def nistbib_search_filter(code, year, opts)
123
- docid = code.match(%r{[0-9-]{3,}}).to_s
123
+ idregex = %r{[0-9-]{3,}}
124
+ docid = code.match(idregex).to_s
124
125
  serie = code.match(%r{(FISP|SP|NISTIR)(?=\s)})
125
126
  warn "[relaton-nist] (\"#{code}\") fetching..."
126
127
  result = search(code, year, opts)
127
128
  result.select do |i|
128
- i.hit[:code]&.include?(docid) && (!serie || i.hit[:serie] == serie.to_s)
129
+ i.hit[:code]&.match(idregex).to_s == docid && (!serie || i.hit[:serie] == serie.to_s)
129
130
  end
130
131
  end
131
132
 
@@ -1,3 +1,3 @@
1
1
  module RelatonNist
2
- VERSION = "0.9.0".freeze
2
+ VERSION = "0.9.1".freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: relaton-nist
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.0
4
+ version: 0.9.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-03-30 00:00:00.000000000 Z
11
+ date: 2020-04-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: debase