relaton-nist 1.14.4 → 1.14.6
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ff158dab9df4bfc2254789771db9ca74bc422b9d6ac78351da0ccbca1d858815
|
4
|
+
data.tar.gz: e7ef8d2cb1ff797095f7c6646194610ffe7bab67f97d909c9d54d75d9f0552c3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ef6f0be37367d7e71ac0783be8252219a9a49e7affe27bfcef78c21929d64c10b2f4cba081a4515d75e64bfccffed21dd72848d2653594363f9e4fa753c7c002
|
7
|
+
data.tar.gz: f9b24bb62b115b11f291a9514420426a758d3207062e4bd75fc09169f32338d3891ca802441df405ce9b4ab159f39aea2762c458e811c30e87523e9835a94dbc
|
@@ -29,14 +29,6 @@ module RelatonNist
|
|
29
29
|
end
|
30
30
|
|
31
31
|
def parse_docid(doc) # rubocop:disable Metrics/AbcSize, Metrics/MethodLength
|
32
|
-
# case doi
|
33
|
-
# when "10.6028/NBS.CIRC.12e2revjune" then doi.sub!("13e", "12e")
|
34
|
-
# when "10.6028/NBS.CIRC.36e2" then doi.sub!("46e", "36e")
|
35
|
-
# when "10.6028/NBS.HB.67suppJune1967" then doi.sub!("1965", "1967")
|
36
|
-
# when "10.6028/NBS.HB.105-1r1990" then doi.sub!("105-1-1990", "105-1r1990")
|
37
|
-
# when "10.6028/NIST.HB.150-10-1995" then doi.sub!(/150-10$/, "150-10-1995")
|
38
|
-
# end
|
39
|
-
# anchor = doi.split("/")[1..-1].join "/"
|
40
32
|
[
|
41
33
|
{ type: "NIST", id: pub_id(doc), primary: true },
|
42
34
|
{ type: "DOI", id: fetch_doi(doc) },
|
@@ -135,8 +127,12 @@ module RelatonNist
|
|
135
127
|
# @param doc [Nokogiri::XML::Element]
|
136
128
|
# @return [Array<RelatonBib::FormattedString>]
|
137
129
|
def fetch_abstract(doc)
|
138
|
-
doc.xpath(
|
139
|
-
|
130
|
+
doc.xpath(
|
131
|
+
"jats:abstract/jats:p", "jats" => "http://www.ncbi.nlm.nih.gov/JATS1"
|
132
|
+
).each_with_object([]) do |a, m|
|
133
|
+
next if a.text.empty?
|
134
|
+
|
135
|
+
m << RelatonBib::FormattedString.new(content: a.text, language: doc["language"], script: "Latn")
|
140
136
|
end
|
141
137
|
end
|
142
138
|
|
@@ -58,14 +58,11 @@ module RelatonNist
|
|
58
58
|
parts = doi_parts(item.hit[:json]) || code_parts(item.hit[:code])
|
59
59
|
(refparts[:code] && [parts[:series], item.hit[:series]].include?(refparts[:series]) &&
|
60
60
|
refparts[:code].casecmp(parts[:code].upcase).zero? &&
|
61
|
-
(
|
62
|
-
(
|
63
|
-
(
|
64
|
-
(
|
65
|
-
refparts[:draft] == parts[:draft] && refparts[:add] == parts[:add]
|
66
|
-
refparts[:res] == parts[:res]) # ||
|
67
|
-
# (refparts[:code] && !refparts[:code].empty? &&
|
68
|
-
# item.hit[:title]&.include?("#{refparts[:series]} #{refparts[:code]}"))
|
61
|
+
(refparts[:prt] == parts[:prt]) &&
|
62
|
+
(refparts[:vol] == parts[:vol]) &&
|
63
|
+
(refparts[:ver] == parts[:ver]) &&
|
64
|
+
(refparts[:rev] == parts[:rev]) &&
|
65
|
+
refparts[:draft] == parts[:draft] && refparts[:add] == parts[:add])
|
69
66
|
end
|
70
67
|
end
|
71
68
|
|
@@ -73,7 +70,7 @@ module RelatonNist
|
|
73
70
|
|
74
71
|
def code_parts(code) # rubocop:disable Metrics/MethodLength
|
75
72
|
{
|
76
|
-
prefix: match(/^(?:NIST|NBS)\s?/, code),
|
73
|
+
# prefix: match(/^(?:NIST|NBS)\s?/, code),
|
77
74
|
series: match(/(?<val>(?:SP|FIPS|IR|ITL\sBulletin|White\sPaper))\s/, code),
|
78
75
|
code: match(/(?<val>[0-9-]{3,}[A-Z]?)/, code),
|
79
76
|
prt: match(/(?:pt|\sPart\s)(?<val>\d+)/, code),
|
@@ -86,7 +83,6 @@ module RelatonNist
|
|
86
83
|
# (?:\s(?<rev2>Rev\.\s\d+))?
|
87
84
|
add: match(/\sAdd(?:endum)?(?<val>\d*)/, code),
|
88
85
|
draft: !match(/\((?:Retired\s)?Draft\)/, code).nil?,
|
89
|
-
res: match(/(?<=\s)RES/, text),
|
90
86
|
}
|
91
87
|
end
|
92
88
|
|
@@ -95,7 +91,7 @@ module RelatonNist
|
|
95
91
|
|
96
92
|
id = json["doi"].split("/").last
|
97
93
|
{
|
98
|
-
prefix: match(/^(?:NIST|NBS)\./, id),
|
94
|
+
# prefix: match(/^(?:NIST|NBS)\./, id),
|
99
95
|
series: match(/(?:SP|FIPS|IR|ITL\sBulletin|White\sPaper)(?=\.)/, id),
|
100
96
|
code: match(/(?<=\.)\d{3,}(?:-\d+)*(?:[[:alpha:]](?!\d|raft|er|t?\d))?/, id),
|
101
97
|
prt: match(/pt?(?<val>\d+)/, id),
|
@@ -123,7 +119,6 @@ module RelatonNist
|
|
123
119
|
rev: match(/(?:(?:(?<dl>\.)|[^a-z])r|\sRev\.\s)(?(<dl>)-)(?<val>\d+)/, text),
|
124
120
|
add: match(/(?:(?<dl>\.)?add|\/Add)(?(<dl>)-)(?<val>\d*)/, text),
|
125
121
|
draft: !(match(/\((?:Draft|PD)\)/, text).nil? && @opts[:stage].nil?),
|
126
|
-
res: match(/(?<=\s)RES/, text),
|
127
122
|
# prt2: match(/(?<=\s)Part\s[A-Z\d]+/, text),
|
128
123
|
# vol2: match(/(?<=\s)Vol\.\s\d+/, text),
|
129
124
|
# ver2: match(/(?<=\s)Ver\.\s\d+/, text),
|
data/lib/relaton_nist/version.rb
CHANGED
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: 1.14.
|
4
|
+
version: 1.14.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-06-
|
11
|
+
date: 2023-06-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: relaton-bib
|