1.1 --- a/test.py Fri Jan 28 01:36:25 2011 +0100
1.2 +++ b/test.py Thu Feb 03 01:26:35 2011 +0100
1.3 @@ -5,7 +5,6 @@
1.4 from iixr.terms import *
1.5 from iixr.positions import *
1.6 from iixr.index import *
1.7 -from array import array
1.8 import os, sys
1.9
1.10 # Remove old test files.
1.11 @@ -48,11 +47,9 @@
1.12
1.13 f = open("testMS", "wb")
1.14 w = FileWriter(f)
1.15 -b = array("B")
1.16 last = w.get_initial_value(2)
1.17 for t in tuples:
1.18 - last = w.write_sequence(b, t, last, 2)
1.19 -b.tofile(w.f)
1.20 + last = w.write_sequence(t, last, 2)
1.21 w.close()
1.22
1.23 f = open("testMS", "rb")
1.24 @@ -67,11 +64,9 @@
1.25
1.26 f = open("testNMS", "wb")
1.27 w = FileWriter(f)
1.28 -b = array("B")
1.29 last = w.get_initial_value(2)
1.30 for t in tuples2:
1.31 - last = w.write_sequence(b, t, last, 2, monotonic=0)
1.32 -b.tofile(w.f)
1.33 + last = w.write_sequence(t, last, 2, monotonic=0)
1.34 w.close()
1.35
1.36 f = open("testNMS", "rb")
1.37 @@ -170,7 +165,7 @@
1.38 w.reset()
1.39 for docnum, pos_offset, count in term_positions:
1.40 if offset is None:
1.41 - offset = w.f.tell()
1.42 + offset = w.tell()
1.43 w.write_positions(docnum, pos_offset, count)
1.44 doc_frequency += count
1.45 offsets.append((offset, doc_frequency))