#NEWLINE# def _writeIndices( self , file_obj ) : #NEWLINE# #INDENT# indices = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# doc_to_ids = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# canopies = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# for full_predicate in canopies . predicates : #NEWLINE# #INDENT# for predicate in full_predicate : #NEWLINE# #INDENT# if ( hasattr ( predicate , 'index' ) and predicate . index ) : #NEWLINE# #INDENT# doc_to_ids [ predicate ] = dict ( predicate . index . _doc_to_id ) #NEWLINE# if hasattr ( predicate , 'canopy' ) : #NEWLINE# #INDENT# canopies [ predicate ] = predicate . canopy #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# indices [ predicate ] = predicate . index . _index #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# pickle . dump ( canopies , file_obj ) #NEWLINE# pickle . dump ( indices , file_obj ) #NEWLINE# pickle . dump ( doc_to_ids , file_obj )