class_docstr: Builds and/or loads a dictionary.
  
  The dictionary provides access to the frequency of each token, functions to
  translate sentences from tokens to their vectors (list of ints, each int is the
  index of a token in the dictionary) and back from vectors to tokenized text.
class_docstr_tok: ["Builds","and\/or","loads","a","dictionary",".","The","dictionary","provides","access","to","the","frequency","of","each","token",",","functions","to","translate","sentences","from","tokens","to","their","vectors","(","list","of","ints",",","each","int","is","the","index","of","a","token","in","the","dictionary",")","and","back","from","vectors","to","tokenized","text","."]
docstr: Load pre-existing dictionary in 'token[<TAB>count]' format.
  
  Initialize counts from other dictionary, or 0 if they aren't included.
code: def load(self, filename):
      """
      Load pre-existing dictionary in 'token[<TAB>count]' format.
  
      Initialize counts from other dictionary, or 0 if they aren't included.
      """
      logging.info(f"loading dictionary from {filename}")
  
      lower_special = self.null_token == self.null_token.lower()
      SPECIAL_TOKENS = {"__UNK__", "__NULL__", "__END__", "__START__"}
      with PathManager.open(
          filename, "r", encoding="utf-8", errors="ignore"
      ) as read:
          for line in read:
              split = line.rstrip("\n\r").split("\t")
              token = unescape(split[0])
              if lower_special and token in SPECIAL_TOKENS:
                  token = token.lower()
              cnt = int(split[1]) if len(split) > 1 else 0
              self.freq[token] = cnt
              self.add_token(token)
      logging.info(f"num words = {len(self)}")
  
imports: from typing import Optional
  from parlai.core.params import ParlaiParser
  from parlai.core.opt import Opt
  from parlai.core.build_data import modelzoo_path
  from parlai.utils.bpe import bpe_factory, BPEHelper
  from .agents import Agent
  from .build_data import make_dir
  from collections import defaultdict
  import copy
  import numpy
  import os
  import json
  import re
  import parlai.utils.logging
  from parlai.utils.io import PathManager
  from typing import List
  import enum
label_desc: Use image node_id 27 for calling the DictionaryAgent obj's underlying member method code with example usage: obj.load(filename) without return types