diff options
author | Martin Czygan <martin.czygan@gmail.com> | 2020-08-17 17:53:51 +0200 |
---|---|---|
committer | Martin Czygan <martin.czygan@gmail.com> | 2020-08-17 17:53:51 +0200 |
commit | 9c655cad78b8c61387493bd7bfe80073c2993e35 (patch) | |
tree | 87e7d451ec7acc139eedb0446e016b2c8d23eb7f | |
parent | 0a48924c0f1dbbfcbdc23712ee44a4b94c7cf06e (diff) | |
download | fuzzycat-9c655cad78b8c61387493bd7bfe80073c2993e35.tar.gz fuzzycat-9c655cad78b8c61387493bd7bfe80073c2993e35.zip |
matching: verify container can verify serial name first
-rw-r--r-- | fuzzycat/fatcat/matching.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/fuzzycat/fatcat/matching.py b/fuzzycat/fatcat/matching.py index 4379d99..ba9b8a8 100644 --- a/fuzzycat/fatcat/matching.py +++ b/fuzzycat/fatcat/matching.py @@ -218,6 +218,7 @@ def verify_serial_name(a: str, b: str) -> MatchStatus: if len(a & b) > 0: return MatchStatus.STRONG + # First, try values as given. issnls_for_a = serialsdb.get(a, set()) issnls_for_b = serialsdb.get(b, set()) @@ -225,7 +226,7 @@ def verify_serial_name(a: str, b: str) -> MatchStatus: if status != MatchStatus.AMBIGIOUS: return status - # Try value cleanup. + # Try to match slightly cleaned up values. issnls_for_a = serialsdb.get(a, set(), cleanup_pipeline=cleanups.basic) issnls_for_b = serialsdb.get(b, set(), cleanup_pipeline=cleanups.basic) @@ -233,7 +234,11 @@ def verify_serial_name(a: str, b: str) -> MatchStatus: def verify_container_name(a: str, b: str) -> MatchStatus: - pass + status = verify_serial_name(a, b) + if status != MatchStatus.AMBIGIOUS: + return status + + # TODO: add additional verification, string match and common patterns. def verify_container_match(a: ContainerEntity, b: ContainerEntity) -> MatchStatus: |