2011-09-30 | Paul Boddie | raw annotate files changeset graph | Added the initial version of the indexing module and some test programs to demonstrate the motivation behind the project. |
1 #!/usr/bin/env python 2 3 from simplex import * 4 import sys, time 5 6 filename = sys.argv[1] 7 terms = sys.argv[2:] 8 9 f = open(filename) 10 try: 11 for term in terms: 12 f.seek(0) 13 14 t = time.time() 15 line = find_line_in_file(f, term) 16 if line: 17 print "Found (at %s seconds)...\n%s" % (time.time() - t, line) 18 finally: 19 f.close() 20 21 # vim: tabstop=4 expandtab shiftwidth=4