docstr: Parameters
  ----------
  ngram str or unicode, string to search for
  
  Returns
  -------
  pd.DataFrame, {'texts': <matching texts>, 'categories': <corresponding categories>}
docstr_tok: ["Parameters","--","--","--","--","--","ngram","str","or","unicode",",","string","to","search","for","Returns","--","--","--","-","pd.DataFrame",",","{","'texts","'",":","<","matching","texts",">",",","'categories","'",":","<","corresponding","categories",">","}"]
code: def search(self, ngram, non_text: bool = False):
      """
      Parameters
      ----------
      ngram str or unicode, string to search for
  
      Returns
      -------
      pd.DataFrame, {'texts': <matching texts>, 'categories': <corresponding categories>}
  
      """
      mask = self._document_index_mask(ngram, non_text=non_text)
      return pd.DataFrame(
          {
              "text": self.get_texts()[mask],
              "category": [
                  self._category_idx_store.getval(idx)
                  for idx in self._y[mask]
              ],
          }
      )
  
file_path: scattertext/scattertext/Corpus.py
imports: import numpy
  import pandas
  from numpy import nonzero
  from scattertext.TermDocMatrix import TermDocMatrix
label_desc: Use image node_id 4 for calling the Corpus obj's underlying member method code with example usage: obj.search(ngram, non_text) and returns: pd