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

authorVincent Michel <vincent.michel@logilab.fr>
changeset1615cd653f1d
branchdefault
phasepublic
hiddenno
parent revision#99863e609845 [distances] Add an ExactMatchProcessing, closes #252734
child revision#2921c0bfc527 [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 1615cd653f1dd0518f9cf582bc13a7ecdf6a7c26
# Parent 99863e609845b5aa54b663dd25266b8a89cd68ae
[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