code: def _build_from_category_spacy_doc_iter(self, category_doc_iter):
          '''
          Parameters
          ----------
          category_doc_iter : iterator of (string category name, spacy.tokens.doc.Doc) pairs
  
          Returns
          ----------
          t : TermDocMatrix
          '''
          term_idx_store = IndexStore()
          category_idx_store = IndexStore()
          metadata_idx_store = IndexStore()
          X, mX, y = self._get_features_and_labels_from_documents_and_indexes \
              (category_doc_iter,
               category_idx_store,
               term_idx_store,
               metadata_idx_store)
          return TermDocMatrix(X,
                               mX,
                               y,
                               term_idx_store=term_idx_store,
                               category_idx_store=category_idx_store,
                               metadata_idx_store=metadata_idx_storef _build_from_category_spacy_doc_iter(self, category_doc_iter):
          '''
          Parameters
          ----------
          category_doc_iter : iterator of (string category name, spacy.tokens.doc.Doc) pairs
  
          Returns
          ----------
          t : TermDocMatrix
          '''
          term_idx_store = IndexStore()
          category_idx_store = IndexStore()
          metadata_idx_store = IndexStore()
          X, mX, y = self._get_features_and_labels_from_documents_and_indexes \
              (category_doc_iter,
               category_idx_store,
               term_idx_store,
               metadata_idx_store)
          return TermDocMatrix(X,
                               mX,
                               y,
                               term_idx_store=term_idx_store,
                               category_idx_store=category_idx_store,
                               metadata_idx_store=metadata_idx_store)
docs: Parameters
          ----------
          category_doc_iter : iterator of (string category name, spacy.tokens.doc.Doc) pairs
  
          Returns
          ----------
          t : TermDocMatrix