diff options
author | Martin Czygan <martin.czygan@gmail.com> | 2020-12-24 02:22:53 +0100 |
---|---|---|
committer | Martin Czygan <martin.czygan@gmail.com> | 2020-12-24 02:22:53 +0100 |
commit | 41961555b1399241bb784a8677e3ca10806f6e2e (patch) | |
tree | f6eff65935a846e18d723119f6e90dc7c9f7e090 | |
parent | b34e8e1c942c45ab448e091b9e51c916a84cca53 (diff) | |
download | fuzzycat-41961555b1399241bb784a8677e3ca10806f6e2e.tar.gz fuzzycat-41961555b1399241bb784a8677e3ca10806f6e2e.zip |
tweak comparison, add test
-rw-r--r-- | fuzzycat/verify.py | 2 | ||||
-rw-r--r-- | tests/data/verify.csv | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/fuzzycat/verify.py b/fuzzycat/verify.py index 99b507a..9b29f81 100644 --- a/fuzzycat/verify.py +++ b/fuzzycat/verify.py @@ -465,7 +465,7 @@ def verify(a: Dict, b: Dict, min_title_length=5) -> Tuple[str, str]: # preprint and published work may not be published in the same # year; compromise allow a small gap if a_release_year and b_release_year and abs(int(a_release_year) - - int(b_release_year)) > 1: + int(b_release_year)) > 2: return Verify(Status.DIFFERENT, Reason.YEAR) return Verify(Status.EXACT, Reason.TITLE_AUTHOR_MATCH) diff --git a/tests/data/verify.csv b/tests/data/verify.csv index cb0eaf2..cd02a34 100644 --- a/tests/data/verify.csv +++ b/tests/data/verify.csv @@ -188,5 +188,5 @@ s5a6e6wnlvdelge256xpha6oqu,zoeto2mymzhi3l74fr2ps5qjyy,, 2bquff6yhffgzaxkbncmu3kshi,myayyezdibc2flxxspaflymmu4,Status.EXACT,WORK_ID 2bquff6yhffgzaxkbncmu3kshi,v2dwuua2rbhyjee2mjvumrdjry,Status.EXACT,TITLE_AUTHOR_MATCH 4zsgxrjpzzg5hbffh4ad4a774a,myayyezdibc2flxxspaflymmu4,Status.EXACT,WORK_ID -4zsgxrjpzzg5hbffh4ad4a774a,v2dwuua2rbhyjee2mjvumrdjry,, -myayyezdibc2flxxspaflymmu4,v2dwuua2rbhyjee2mjvumrdjry,, +4zsgxrjpzzg5hbffh4ad4a774a,v2dwuua2rbhyjee2mjvumrdjry,Status.EXACT,TITLE_AUTHOR_MATCH +myayyezdibc2flxxspaflymmu4,v2dwuua2rbhyjee2mjvumrdjry,Status.EXACT,TITLE_AUTHOR_MATCH |