1.1 --- a/test_indexed.py Sun Oct 02 17:40:02 2011 +0200
1.2 +++ b/test_indexed.py Sun Oct 02 19:52:30 2011 +0200
1.3 @@ -13,18 +13,17 @@
1.4 sys.exit(1)
1.5
1.6 f = open(filename)
1.7 -reader = TextFile(f)
1.8 accessor = DelimitedRecord(fields, numeric=(numeric == "true"))
1.9 try:
1.10 t = time.time()
1.11 - l = make_index(reader, accessor.get_key, int(interval))
1.12 + l = make_index(f, accessor.get_key, int(interval))
1.13 print "Indexed in %s seconds." % (time.time() - t)
1.14
1.15 # Now use the index.
1.16
1.17 for term in terms:
1.18 t = time.time()
1.19 - line = find_with_index(reader, accessor.get_key, l, accessor.convert(term))
1.20 + line = find_with_index(f, accessor.get_key, l, accessor.convert(term))
1.21 if line:
1.22 print "Found (at %s seconds)...\n%s" % (time.time() - t, line)
1.23