Skip to content

Commit

Permalink
fix keyword name in gazetteMatching
Browse files Browse the repository at this point in the history
  • Loading branch information
fgregg committed Mar 4, 2015
1 parent 7d420e7 commit 725cb9f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions dedupe/clustering.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ def greedyMatching(dupes, threshold=0.5):

return clusters

def gazetteMatching(dupes, threshold=0.5, n=1):
def gazetteMatching(dupes, threshold=0.5, n_matches=1):
dupes = numpy.array(dupes)
clusters = []

Expand All @@ -210,7 +210,7 @@ def gazetteMatching(dupes, threshold=0.5, n=1):
for pair, score in dupes_list:
a, b = pair
if a == group :
if i < n :
if i < n_matches :
matches.append((pair, score))
i += 1
else :
Expand Down
18 changes: 9 additions & 9 deletions tests/test_dedupe.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,15 +240,15 @@ def test_gazette_matching(self):
(((3, 6), 0.72),)])

assert set(gazetteMatch(self.bipartite_dupes,
threshold=0, n=2)) == set([(((1, 6), 0.72),
((1, 8), 0.6)),
(((2, 7), 0.72),
((2, 8), 0.3)),
(((3, 6), 0.72),
((3, 8), 0.65)),
(((4, 6), 0.96),
((4, 5), 0.63)),
(((5, 8), 0.24),)])
threshold=0, n_matches=2)) == set([(((1, 6), 0.72),
((1, 8), 0.6)),
(((2, 7), 0.72),
((2, 8), 0.3)),
(((3, 6), 0.72),
((3, 8), 0.65)),
(((4, 6), 0.96),
((4, 5), 0.63)),
(((5, 8), 0.24),)])

assert set(gazetteMatch(self.bipartite_dupes,
threshold=0)) == set([(((4, 6), 0.96),),
Expand Down

0 comments on commit 725cb9f

Please sign in to comment.