code: def search(self, ngram):
  		'''
  		Parameters
  		----------
  		ngram str or unicode, string to search for
  
  		Returns
  		-------
  		pd.DataFrame, {'texts': <matching texts>, 'categories': <corresponding categories>}
  
  		'''
  		mask = self._document_index_mask(ngram)
  		return pd.DataFrame({
  			'text': self.get_texts()[mask],
  			'category': [self._category_idx_store.getval(idx)
  			             for idx in self._y[mask]]
  		}f search(self, ngram):
  		'''
  		Parameters
  		----------
  		ngram str or unicode, string to search for
  
  		Returns
  		-------
  		pd.DataFrame, {'texts': <matching texts>, 'categories': <corresponding categories>}
  
  		'''
  		mask = self._document_index_mask(ngram)
  		return pd.DataFrame({
  			'text': self.get_texts()[mask],
  			'category': [self._category_idx_store.getval(idx)
  			             for idx in self._y[mask]]
  		})
docs: Parameters
  		----------
  		ngram str or unicode, string to search for
  
  		Returns
  		-------
  		pd.DataFrame, {'texts': <matching texts>, 'categories': <corresponding categories>}