aboutsummaryrefslogtreecommitdiffstats
path: root/fuzzycat
diff options
context:
space:
mode:
authorMartin Czygan <martin.czygan@gmail.com>2020-11-28 17:22:06 +0100
committerMartin Czygan <martin.czygan@gmail.com>2020-11-28 17:22:06 +0100
commitdbe51fe929712f142c91ce3f4ffad600a2c2c8f6 (patch)
treee5036589b3a592dcfbd8861f304f1cd1b178a1ba /fuzzycat
parent834a23edfa931b12648dbff31d53ea98d272c125 (diff)
downloadfuzzycat-dbe51fe929712f142c91ce3f4ffad600a2c2c8f6.tar.gz
fuzzycat-dbe51fe929712f142c91ce3f4ffad600a2c2c8f6.zip
limit to 5 authors
Diffstat (limited to 'fuzzycat')
-rw-r--r--fuzzycat/verify.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/fuzzycat/verify.py b/fuzzycat/verify.py
index a40c0d9..2eff873 100644
--- a/fuzzycat/verify.py
+++ b/fuzzycat/verify.py
@@ -325,8 +325,11 @@ def compare(a, b):
# in this block.
Score = collections.namedtuple("Score", "a b value")
scores = []
- # account for the possible arbitrary ordering of authors
- for a, b in itertools.product(a_slug_authors, b_slug_authors):
+ # account for the possible arbitrary ordering of authors, XXX: this
+ # explodes.
+ a_trimmed = sorted(a_slug_authors)[:5]
+ b_trimmed = sorted(b_slug_authors)[:5]
+ for a, b in itertools.product(a_trimmed, b_trimmed):
scores.append(Score(a, b, author_similarity_score(a, b)))
# TODO: less arbitrary metric and threshold
top_scores = []