uc3-dmp-id 0.1.4 → 0.1.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: ca2358a541ef077a0333d27765542713e1312fc3fed793d87b577a1abdc76834
4
- data.tar.gz: 19b6b5f67cc27e77fe267234dd887580f5b6dae60229fab006cd3fad3021b0f1
3
+ metadata.gz: ed142333899fd7e57c9dc8c5052b51205b13494bb513b2199583397eef7162c7
4
+ data.tar.gz: 01cd7806f0900434cec2a2c5e43488fd9da112e1521e44914a81a51c2a5d7742
5
5
  SHA512:
6
- metadata.gz: 6cff537349cf7ee95e1493589b614403e09a6d61b6d2c2d2e90238ce16867b749b70d74ca4e3442a01c3805f223276d01bb14eb88cd945523c4e3f3211e55cf2
7
- data.tar.gz: 45f85054462bad1212a1b8470af12b75869dd37b6cfc37d7d46b100ac7adfd18e83a9b05cb8267950dab4280045239e5c97efa66fe6e0699e1b432c610ce97d2
6
+ metadata.gz: 102d4e2cafbf9594f6a69d195e9c2659f34e19505bded960979ce24901d144d07d0851b92a6d94a979b87e081a984d3c4999e0933cb667014b38c95fdd781495
7
+ data.tar.gz: 5301292abe35dcaf79c1ae053d5035a057986a671442f4e0d06087441373b607256de5c951603be764f857ef273643bbd17ee6fa42179d9f7b6ef6ea49033755
@@ -17,17 +17,13 @@ module Uc3DmpId
17
17
  # See the bottom of this file for a hard-coded crosswalk between Crossref funder ids and ROR ids
18
18
  # Some APIs do not support ROR fully for funder ids, so we need to be able to reference both
19
19
 
20
- attr_accessor :augmenter, :dmp, :details_hash, :logger
20
+ attr_accessor :dmp, :details_hash, :logger
21
21
 
22
22
  # rubocop:disable Metrics/AbcSize
23
23
  def initialize(**args)
24
24
  @logger = args[:logger]
25
25
  @details_hash = {}
26
26
 
27
- @augmenter = args[:augmenter]
28
- raise ComparatorError, MSG_MISSING_AUGMENTER if @augmenter.nil? ||
29
- !@augmenter['PK']&.start_with?('AUGMENTERS#')
30
-
31
27
  @dmp = args.fetch(:dmp, {})['dmp'].nil? ? args[:dmp] : args.fetch(:dmp, {})['dmp']
32
28
  _extract_dmp_details(dmp:)
33
29
  raise ComparatorError, MSG_MISSING_DMP if @details_hash.empty?
@@ -57,7 +53,7 @@ module Uc3DmpId
57
53
  # }
58
54
  # rubocop:disable Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
59
55
  def compare(hash:)
60
- response = { confidence: 'None', score: 0, notes: [], source: @augmenter['name'] }
56
+ response = { confidence: 'None', score: 0, notes: [] }
61
57
  return response unless hash.is_a?(Hash) && !hash['title'].nil?
62
58
 
63
59
  # Compare the grant ids. If we have a match return the response immediately since that is
@@ -71,17 +67,17 @@ module Uc3DmpId
71
67
 
72
68
  # Only process the following if we had some matching contributors, affiliations or opportuniy nbrs
73
69
  response = _repository_match?(array: hash['repositories'], response:) if response[:score].positive?
74
- response = _keyword_match?(array: hash['repositories'], response:) if response[:score].positive?
70
+ response = _keyword_match?(array: hash['keywords'], response:) if response[:score].positive?
75
71
  response = _text_match?(type: 'title', text: hash['title'], response:) if response[:score].positive?
76
72
  response = _text_match?(type: 'abstract', text: hash['abstract'], response:) if response[:score].positive?
77
73
  # If the score is less than 3 then we have no confidence that it is a match
78
74
  return response if response[:score] <= 2
79
75
 
80
76
  # Set the confidence level based on the score
81
- response[:confidence] = if response[:score] > 15
77
+ response[:confidence] = if response[:score] > 10
82
78
  'High'
83
79
  else
84
- (response[:score] > 10 ? 'Medium' : 'Low')
80
+ (response[:score] > 5 ? 'Medium' : 'Low')
85
81
  end
86
82
  response
87
83
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Uc3DmpId
4
- VERSION = '0.1.4'
4
+ VERSION = '0.1.6'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: uc3-dmp-id
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Riley
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-10-26 00:00:00.000000000 Z
11
+ date: 2023-10-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json