aboutsummaryrefslogtreecommitdiffstats
path: root/fuzzycat/verify.py
diff options
context:
space:
mode:
authorMartin Czygan <martin.czygan@gmail.com>2021-11-05 17:19:07 +0100
committerMartin Czygan <martin.czygan@gmail.com>2021-11-16 18:58:42 +0100
commit0c84af603894049dd8edd95da18d8990ab0516d1 (patch)
tree08fb4ad2b3a498e2edac73972f97e427e0194759 /fuzzycat/verify.py
parent282f315c6ba3643c8c614220ab2f7e1d55de3658 (diff)
downloadfuzzycat-0c84af603894049dd8edd95da18d8990ab0516d1.tar.gz
fuzzycat-0c84af603894049dd8edd95da18d8990ab0516d1.zip
turn "match_release_fuzzy" into a class
Goal of this refactoring was to make the matching process a bit more configurable by using a class and a cascade of queries. For a limited test set: `FuzzyReleaseMatcher.match` is works the same as `match_release_fuzzy`.
Diffstat (limited to 'fuzzycat/verify.py')
-rw-r--r--fuzzycat/verify.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/fuzzycat/verify.py b/fuzzycat/verify.py
index 9eb808b..f570511 100644
--- a/fuzzycat/verify.py
+++ b/fuzzycat/verify.py
@@ -233,10 +233,9 @@ def verify(a: Dict, b: Dict, min_title_length=5) -> Tuple[str, str]:
if has_doi_prefix(a_doi, "10.3403") and has_doi_prefix(b_doi, "10.3403"):
if a_doi + "u" == b_doi or b_doi + "u" == a_doi:
return Verify(Status.STRONG, Reason.CUSTOM_BSI_UNDATED)
- if a_title == b_title and ((dict_has_key(a, "extra.subtitle")
- and not dict_has_key(b, "extra.subtitle")) or
- (dict_has_key(b, "extra.subtitle")
- and not dict_has_key(a, "extra.subtitle"))):
+ if a_title == b_title and (
+ (dict_has_key(a, "extra.subtitle") and not dict_has_key(b, "extra.subtitle")) or
+ (dict_has_key(b, "extra.subtitle") and not dict_has_key(a, "extra.subtitle"))):
return Verify(Status.STRONG, Reason.CUSTOM_BSI_SUBDOC)
except PathAccessError:
pass