#NEWLINE# def del_docids( self , * docids ) : #NEWLINE# #INDENT# 'Delete docids from index' #NEWLINE# def _del_helper( map , key ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# del map [ key ] #NEWLINE# #UNINDENT# except KeyError : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# #UNINDENT# for docid in docids : #NEWLINE# #INDENT# for ( term , freq ) in self . _doc_vectors [ docid ] . iteritems ( ) : #NEWLINE# #INDENT# self . _df_map [ term ] -= 1 #NEWLINE# self . _term_index [ term ] = [ ( _docid , docid ) for ( _docid , freq ) in self . _term_index . get ( term , [ ] ) if ( _docid != docid ) ] #NEWLINE# if ( len ( self . _term_index [ term ] ) == 0 ) : #NEWLINE# #INDENT# del self . _term_index [ term ] #NEWLINE# #UNINDENT# #UNINDENT# name = self . docid_to_name ( docid ) #NEWLINE# _del_helper ( self . _docid_to_name_map , docid ) #NEWLINE# _del_helper ( self . _docid_to_feature_map , docid ) #NEWLINE# _del_helper ( self . _name_to_docid_map , name ) #NEWLINE# _del_helper ( self . _doc_len_map , docid ) #NEWLINE# _del_helper ( self . _doc_vectors , docid ) #NEWLINE# self . _N -= 1