parameters: (self)
docstring: Creates the index file from open record file
docstring_summary: Creates the index file from open record file
docstring_tokens: Creates the index file from open record file
function: def create_index(self):
          """Creates the index file from open record file
          """
          self.reset()
          counter = 0
          pre_time = time.time()
          while True:
              if counter % 1000 == 0:
                  cur_time = time.time()
                  print('time:', cur_time - pre_time, ' count:', counter)
              pos = self.tell()
              cont = self.read()
              if cont is None:
                  break
              key = self.key_type(counter)
              self.fidx.write('%s\t%d\n'%(str(key), pos))
              counter = counter + 1
function_tokens: def create_index ( self ) : self . reset ( ) counter = 0 pre_time = time . time ( ) while True : if counter % 1000 == 0 : cur_time = time . time ( ) print ( 'time:' , cur_time - pre_time , ' count:' , counter ) pos = self . tell ( ) cont = self . read ( ) if cont is None : break key = self . key_type ( counter ) self . fidx . write ( '%s\t%d\n' % ( str ( key ) , pos ) ) counter = counter + 1