Add and delete some XXX
authorSimon Chabot <simon.chabot@logilab.fr>
Fri, 09 Nov 2012 11:08:24 +0100
changeset 105 aec512170eac
parent 104 8322d728be8a
child 106 4b06851fa2c1
Add and delete some XXX
aligner.py
--- a/aligner.py	Fri Nov 09 10:03:02 2012 +0100
+++ b/aligner.py	Fri Nov 09 11:08:24 2012 +0100
@@ -72,7 +72,7 @@
                         kwordsgram, siglen)
         rawneighbours = minhasher.findsimilarsentences(threshold)
         neighbours = []
-        for data in rawneighbours: #XXX: Return an iterator
+        for data in rawneighbours:
             neighbours.append([[], []])
             for i in data:
                 if i >= len(alignset):
@@ -93,7 +93,6 @@
         else:
             kmeans = cluster.MiniBatchKMeans(n_clusters=n_clusters)
 
-        # XXX : If there are more than 2 dimensions ??
         kmeans.fit([elt[indexes[0]] or idelement for elt in alignset])
         predicted = kmeans.predict([elt[indexes[1]] or idelement for elt in targetset])
 
@@ -102,6 +101,7 @@
             clusters[i][1].append(ind)
         for ind, i in enumerate(kmeans.labels_):
             clusters[i][0].append(ind)
+        #XXX: Check all lists have one element at least ?
         return clusters
 
 def align(alignset, targetset, treatments, threshold, resultfile):