[aligner] Keep the distance matrix by default, closes #252735

authorVincent Michel <vincent.michel@logilab.fr>
changeset30b35c628028
branchdefault
phasedraft
hiddenyes
parent revision#672dbc5cdeee [distances] Add an ExactMatchProcessing, closes #252734
child revision#37fb52b4e152 [doc] add a logo for the project
files modified by this revision
rl/aligner.py
# HG changeset patch
# User Vincent Michel <vincent.michel@logilab.fr>
# Date 1401196421 -7200
# Tue May 27 15:13:41 2014 +0200
# Node ID 30b35c628028ff2ee21bcda7ba27b586e332c07a
# Parent 672dbc5cdeeef6fb69c8b106e1c298a0facad7e0
[aligner] Keep the distance matrix by default, closes #252735

diff --git a/rl/aligner.py b/rl/aligner.py
@@ -161,14 +161,14 @@
1                          # XXX avoid issue in sparse matrix
2                          global_mat[k, v] = d or 10**(-10)
3          self.time = time.time() - start_time
4          return global_mat, global_matched
5 
6 -    def get_aligned_pairs(self, refset, targetset, unique=True):
7 +    def get_aligned_pairs(self, refset, targetset, unique=True, use_distance=True):
8          """ Get the pairs of aligned elements
9          """
10 -        global_mat, global_matched = self.align(refset, targetset, get_matrix=False)
11 +        global_mat, global_matched = self.align(refset, targetset, get_matrix=use_distance)
12          for pair in iter_aligned_pairs(refset, targetset, global_mat, global_matched, unique):
13              self.pairs_found += 1
14              yield pair
15          self.log_infos()
16