aboutsummaryrefslogtreecommitdiffstats
path: root/fuzzycat
diff options
context:
space:
mode:
authorMartin Czygan <martin.czygan@gmail.com>2020-12-09 01:42:16 +0100
committerMartin Czygan <martin.czygan@gmail.com>2020-12-09 01:42:16 +0100
commit4b5d71b8ca085c102fff1cf6629fa58582873d27 (patch)
tree982b306b9a4a1230f51c11d27b3a18a37716937b /fuzzycat
parent26c71fe52d4cabc3cca8b29f6fa3d99c66e5f912 (diff)
downloadfuzzycat-4b5d71b8ca085c102fff1cf6629fa58582873d27.tar.gz
fuzzycat-4b5d71b8ca085c102fff1cf6629fa58582873d27.zip
add another case
Diffstat (limited to 'fuzzycat')
-rw-r--r--fuzzycat/common.py1
-rw-r--r--fuzzycat/verify.py14
2 files changed, 15 insertions, 0 deletions
diff --git a/fuzzycat/common.py b/fuzzycat/common.py
index d87bef4..977db2c 100644
--- a/fuzzycat/common.py
+++ b/fuzzycat/common.py
@@ -57,3 +57,4 @@ class Miss(str, Enum):
SUBTITLE = 'miss.subtitle'
TITLE_FILENAME = 'miss.title_filename'
YEAR = 'miss.year'
+ SHARED_DOI_PREFIX = 'miss.shared_doi_prefix'
diff --git a/fuzzycat/verify.py b/fuzzycat/verify.py
index e945a15..dd2ced8 100644
--- a/fuzzycat/verify.py
+++ b/fuzzycat/verify.py
@@ -437,6 +437,20 @@ def compare(a, b):
(dict_key_exists(b, "ext_ids.pmid") and not dict_key_exists(b, "ext_ids.doi"))):
return (Status.STRONG, OK.PMID_DOI_PAIR)
+ # Publication from same publisher and different DOI or year a probably
+ # different.
+ try:
+ a_container_id = glom(a, "container_id")
+ b_container_id = glom(b, "container_id")
+ a_doi = glom(a, "ext_ids.doi")
+ b_doi = glom(b, "ext_ids.doi")
+
+ if a_container_id == b_container_id and a_doi != b_doi and not has_doi_prefix(
+ a_doi, "10.1126"):
+ return (Status.DIFFERENT, Miss.SHARED_DOI_PREFIX)
+ except PathAccessError:
+ pass
+
if a_authors and len(a_slug_authors & b_slug_authors) == 0:
# Before we bail out, run an authors similarity check. TODO: This is
# not the right place, but lives here now, since these cases popped up