def add_documents(self, documents):
    'Build dictionary from a collection of documents.\n\n        Notes\n        -----\n        This is only a convenience wrapper for calling `doc2bow` on each document with `allow_update=True`.\n\n        Parameters\n        ----------\n        documents : iterable of list of str\n            Collection of documents.\n\n        Examples\n        --------\n        >>> from gensim.corpora import HashDictionary\n        >>>\n        >>> corpus = [["máma", "mele", "maso"], ["ema", "má", "máma"]]\n        >>> dct = HashDictionary(corpus)\n        >>> "sparta" in dct.token2id\n        False\n        >>> dct.add_documents([["this","is","sparta"],["just","joking"]])  # add more documents in dictionary\n        >>> "sparta" in dct.token2id\n        True\n\n        '
    for (docno, document) in enumerate(documents):
        if ((docno % 10000) == 0):
            logger.info('adding document #%i to %s', docno, self)
        self.doc2bow(document, allow_update=True)
    logger.info('built %s from %i documents (total %i corpus positions)', self, self.num_docs, self.num_pos)
Build dictionary from a collection of documents.

Notes
-----
This is only a convenience wrapper for calling `doc2bow` on each document with `allow_update=True`.

Parameters
----------
documents : iterable of list of str
    Collection of documents.

Examples
--------
>>> from gensim.corpora import HashDictionary
>>>
>>> corpus = [["máma", "mele", "maso"], ["ema", "má", "máma"]]
>>> dct = HashDictionary(corpus)
>>> "sparta" in dct.token2id
False
>>> dct.add_documents([["this","is","sparta"],["just","joking"]])  # add more documents in dictionary
>>> "sparta" in dct.token2id
True
def add_documents(self, documents):
    'Build dictionary from a collection of documents.\n\n        Notes\n        -----\n        This is only a convenience wrapper for calling `doc2bow` on each document with `allow_update=True`.\n\n        Parameters\n        ----------\n        documents : iterable of list of str\n            Collection of documents.\n\n        Examples\n        --------\n        >>> from gensim.corpora import HashDictionary\n        >>>\n        >>> corpus = [["máma", "mele", "maso"], ["ema", "má", "máma"]]\n        >>> dct = HashDictionary(corpus)\n        >>> "sparta" in dct.token2id\n        False\n        >>> dct.add_documents([["this","is","sparta"],["just","joking"]])  # add more documents in dictionary\n        >>> "sparta" in dct.token2id\n        True\n\n        '
    for (docno, document) in enumerate(documents):
        if ((docno % 10000) == 0):
            logger.info('adding document #%i to %s', docno, self)
        self.doc2bow(document, allow_update=True)
    logger.info('built %s from %i documents (total %i corpus positions)', self, self.num_docs, self.num_pos)