From 5cfa505ae2c44f58df73640dec00517786a9e4a4 Mon Sep 17 00:00:00 2001 From: einarr Date: Fri, 6 Feb 2009 22:21:19 +0000 Subject: [PATCH] Fixed critical bug in txt2ftsv that made output datasets incorrect if more than one list was used. --- bin/txt2ftsv | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/txt2ftsv b/bin/txt2ftsv index ac20f91..8802e27 100755 --- a/bin/txt2ftsv +++ b/bin/txt2ftsv @@ -67,11 +67,11 @@ def read_file(fd): return [l.strip() for l in lines if l.strip() != ''] def build_dataset(dimension, id_lists, filenames): - all_ids = reduce(set.union, [set(x) for x in id_lists]) + all_ids = list(reduce(set.union, [set(x) for x in id_lists])) x = numpy.zeros((len(all_ids), len(id_lists)), 'b') for i, idl in enumerate(id_lists): - for j, id in enumerate(idl): - x[j,i] = True + for id in idl: + x[all_ids.index(id),i] = True if category: ds = dataset.CategoryDataset(x, [(dimension, all_ids), ('files', filenames)], name=ds_name)