class_docstr: Dictionary encapsulates the mapping between normalized words and their integer ids.
  
  Notable instance attributes:
  
  Attributes
  ----------
  token2id : dict of (str, int)
      token -> token_id. I.e. the reverse mapping to `self[token_id]`.
  cfs : dict of (int, int)
      Collection frequencies: token_id -> how many instances of this token are contained in the documents.
  dfs : dict of (int, int)
      Document frequencies: token_id -> how many documents contain this token.
  num_docs : int
      Number of documents processed.
  num_pos : int
      Total number of corpus positions (number of processed words).
  num_nnz : int
      Total number of non-zeroes in the BOW matrix (sum of the number of unique
      words per document over the entire corpus).
class_docstr_tok: ["Dictionary","encapsulates","the","mapping","between","normalized","words","and","their","integer","ids",".","Notable","instance","attributes",":","Attributes","--","--","--","--","--","token2id",":","dict","of","(","str",",","int",")","token","-",">","token_id",".","I.e",".","the","reverse","mapping","to","`","self","[","token_id","]","`",".","cfs",":","dict","of","(","int",",","int",")","Collection","frequencies",":","token_id","-",">","how","many","instances","of","this","token","are","contained","in","the","documents",".","dfs",":","dict","of","(","int",",","int",")","Document","frequencies",":","token_id","-",">","how","many","documents","contain","this","token",".","num_docs",":","int","Number","of","documents","processed",".","num_pos",":","int","Total","number","of","corpus","positions","(","number","of","processed","words",")",".","num_nnz",":","int","Total","number","of","non-zeroes","in","the","BOW","matrix","(","sum","of","the","number","of","unique","words","per","document","over","the","entire","corpus",")","."]
docstr: Update dictionary from a collection of `documents`.
  
  Parameters
  ----------
  documents : iterable of iterable of str
      Input corpus. All tokens should be already **tokenized and normalized**.
  prune_at : int, optional
      Dictionary will try to keep no more than `prune_at` words in its mapping, to limit its RAM
      footprint, the correctness is not guaranteed.
      Use :meth:`~gensim.corpora.dictionary.Dictionary.filter_extremes` to perform proper filtering.
  
  Examples
  --------
  .. sourcecode:: pycon
  
      >>> from gensim.corpora import Dictionary
      >>>
      >>> corpus = ["máma mele maso".split(), "ema má máma".split()]
      >>> dct = Dictionary(corpus)
      >>> len(dct)
      5
      >>> dct.add_documents([["this", "is", "sparta"], ["just", "joking"]])
      >>> len(dct)
      10
docstr_tok: ["Update","dictionary","from","a","collection","of","`","documents","`",".","Parameters","--","--","--","--","--","documents",":","iterable","of","iterable","of","str","Input","corpus",".","All","tokens","should","be","already","*","*","tokenized","and","normalized","*","*",".","prune_at",":","int",",","optional","Dictionary","will","try","to","keep","no","more","than","`","prune_at","`","words","in","its","mapping",",","to","limit","its","RAM","footprint",",","the","correctness","is","not","guaranteed",".","Use",":","meth",":","`","~gensim.corpora.dictionary.Dictionary.filter_extremes","`","to","perform","proper","filtering",".","Examples","--","--","--","--","..","sourcecode",":",":","pycon",">",">",">","from","gensim.corpora","import","Dictionary",">",">",">",">",">",">","corpus","=","[","``","m\u00e1ma","mele","maso","''",".split","(",")",",","``","ema","m\u00e1","m\u00e1ma","''",".split","(",")","]",">",">",">","dct","=","Dictionary","(","corpus",")",">",">",">","len","(","dct",")","5",">",">",">","dct.add_documents","(","[","[","``","this","''",",","``","is","''",",","``","sparta","''","]",",","[","``","just","''",",","``","joking","''","]","]",")",">",">",">","len","(","dct",")","10"]
code: def add_documents(self, documents, prune_at=2000000):
      """Update dictionary from a collection of `documents`.
  
      Parameters
      ----------
      documents : iterable of iterable of str
          Input corpus. All tokens should be already **tokenized and normalized**.
      prune_at : int, optional
          Dictionary will try to keep no more than `prune_at` words in its mapping, to limit its RAM
          footprint, the correctness is not guaranteed.
          Use :meth:`~gensim.corpora.dictionary.Dictionary.filter_extremes` to perform proper filtering.
  
      Examples
      --------
      .. sourcecode:: pycon
  
          >>> from gensim.corpora import Dictionary
          >>>
          >>> corpus = ["máma mele maso".split(), "ema má máma".split()]
          >>> dct = Dictionary(corpus)
          >>> len(dct)
          5
          >>> dct.add_documents([["this", "is", "sparta"], ["just", "joking"]])
          >>> len(dct)
          10
  
      """
      for docno, document in enumerate(documents):
          # log progress & run a regular check for pruning, once every 10k docs
          if docno % 10000 == 0:
              if prune_at is not None and len(self) > prune_at:
                  self.filter_extremes(
                      no_below=0, no_above=1.0, keep_n=prune_at
                  )
              logger.info("adding document #%i to %s", docno, self)
  
          # update Dictionary with the document
          self.doc2bow(
              document, allow_update=True
          )  # ignore the result, here we only care about updating token ids
  
      logger.info(
          "built %s from %i documents (total %i corpus positions)",
          self,
          self.num_docs,
          self.num_pos,
      )
  
imports: from collections import defaultdict
  from collections.abc import Mapping
  import logging
  import itertools
  from typing import Optional, List, Tuple
  from gensim import utils
label_desc: Use image node_id 10 for calling the Dictionary obj's underlying member method code with example usage: obj.add_documents(documents, prune_at) without return types