class_docstr: DmlCorpus implements a collection of articles. It is initialized via a DmlConfig
  object, which holds information about where to look for the articles and how
  to process them.
  
  Apart from being a regular corpus (bag-of-words iterable with a `len()` method),
  DmlCorpus has methods for building a dictionary (mapping between words and
  their ids).
docstr: Populate dictionary mapping and statistics.
  
  This is done by sequentially retrieving the article fulltexts, splitting
  them into tokens and converting tokens to their ids (creating new ids as
  necessary).
docstr_tok: ["Populate","dictionary","mapping","and","statistics",".","This","is","done","by","sequentially","retrieving","the","article","fulltexts",",","splitting","them","into","tokens","and","converting","tokens","to","their","ids","(","creating","new","ids","as","necessary",")","."]
code: def buildDictionary(self):
      """
      Populate dictionary mapping and statistics.
  
      This is done by sequentially retrieving the article fulltexts, splitting
      them into tokens and converting tokens to their ids (creating new ids as
      necessary).
      """
      logger.info(
          "creating dictionary from %i articles", len(self.documents)
      )
      self.dictionary = dictionary.Dictionary()
      numPositions = 0
      for docNo, (sourceId, docUri) in enumerate(self.documents):
          if docNo % 1000 == 0:
              logger.info(
                  "PROGRESS: at document #%i/%i (%s, %s)",
                  docNo,
                  len(self.documents),
                  sourceId,
                  docUri,
              )
          source = self.config.sources[sourceId]
          contents = source.getContent(docUri)
          words = [
              source.normalizeWord(word)
              for word in source.tokenize(contents)
          ]
          numPositions += len(words)
  
          # convert to bag-of-words, but ignore the result -- here we only care about updating token ids
          _ = self.dictionary.doc2bow(
              words, allowUpdate=True
          )  # noqa:F841
      logger.info(
          "built %s from %i documents (total %i corpus positions)",
          self.dictionary,
          len(self.documents),
          numPositions,
      )
  
imports: import logging
  import os.path
  from gensim import interfaces, matutils
  import dictionary
label_desc: Use image node_id 4 for calling the DmlCorpus obj's underlying member method code with example usage: obj.buildDictionary() without return types