(self, data: types.CorpusData, batch_size: int = 1000, n_process: int = 1)
Add one or a stream of texts, records, or :class:`spacy.tokens.Doc` s
        to the corpus, ensuring that all processing is or has already been done
        by the :attr:`Corpus.spacy_lang` pipeline.

        Args:
            data
            batch_size: Number of texts to buffer when processing with spaCy.
            n_process: Number of parallel processors to run when processing.
                If -1, this is set to ``multiprocessing.cpu_count()``.

                .. note:: This feature is only applies when ``data`` is a sequence
                   of texts or records.

        See Also:
            * :meth:`Corpus.add_text()`
            * :meth:`Corpus.add_texts()`
            * :meth:`Corpus.add_record()`
            * :meth:`Corpus.add_records()`
            * :meth:`Corpus.add_doc()`
            * :meth:`Corpus.add_docs()`
Add one or a stream of texts, records, or :class:`spacy.tokens.Doc` s
        to the corpus, ensuring that all processing is or has already been done
        by the :attr:`Corpus.spacy_lang` pipeline.
Add one or a stream of texts records or : class : spacy . tokens . Doc s to the corpus ensuring that all processing is or has already been done by the : attr : Corpus . spacy_lang pipeline .
def add(self, data: types.CorpusData, batch_size: int = 1000, n_process: int = 1):
        """
        Add one or a stream of texts, records, or :class:`spacy.tokens.Doc` s
        to the corpus, ensuring that all processing is or has already been done
        by the :attr:`Corpus.spacy_lang` pipeline.

        Args:
            data
            batch_size: Number of texts to buffer when processing with spaCy.
            n_process: Number of parallel processors to run when processing.
                If -1, this is set to ``multiprocessing.cpu_count()``.

                .. note:: This feature is only applies when ``data`` is a sequence
                   of texts or records.

        See Also:
            * :meth:`Corpus.add_text()`
            * :meth:`Corpus.add_texts()`
            * :meth:`Corpus.add_record()`
            * :meth:`Corpus.add_records()`
            * :meth:`Corpus.add_doc()`
            * :meth:`Corpus.add_docs()`
        """
        if isinstance(data, str):
            self.add_text(data)
        elif isinstance(data, Doc):
            self.add_doc(data)
        elif utils.is_record(data):
            self.add_record(data)
        elif isinstance(data, collections.abc.Iterable):
            first, data = itertoolz.peek(data)
            if isinstance(first, str):
                self.add_texts(data, batch_size=batch_size, n_process=n_process)
            elif isinstance(first, Doc):
                self.add_docs(data)
            elif utils.is_record(first):
                self.add_records(data, batch_size=batch_size, n_process=n_process)
            else:
                raise TypeError(
                    errors.type_invalid_msg("data", type(data), types.CorpusData)
                )
        else:
            raise TypeError(
                errors.type_invalid_msg("data", type(data), types.CorpusData)
            )
def add ( self , data : types . CorpusData , batch_size : int = 1000 , n_process : int = 1 ) : if isinstance ( data , str ) : self . add_text ( data ) elif isinstance ( data , Doc ) : self . add_doc ( data ) elif utils . is_record ( data ) : self . add_record ( data ) elif isinstance ( data , collections . abc . Iterable ) : first , data = itertoolz . peek ( data ) if isinstance ( first , str ) : self . add_texts ( data , batch_size = batch_size , n_process = n_process ) elif isinstance ( first , Doc ) : self . add_docs ( data ) elif utils . is_record ( first ) : self . add_records ( data , batch_size = batch_size , n_process = n_process ) else : raise TypeError ( errors . type_invalid_msg ( "data" , type ( data ) , types . CorpusData ) ) else : raise TypeError ( errors . type_invalid_msg ( "data" , type ( data ) , types . CorpusData ) )