class_docstr: A mapping from symbols to consecutive integers
class_docstr_tok: ["A","mapping","from","symbols","to","consecutive","integers"]
code: def __init__(
      self,
      pad: str = "<pad>",
      eos: str = "</s>",
      unk: str = "<unk>",
      bos: str = "<s>",
      max_special_tokens: int = vocab_constants.MAX_SPECIAL_TOKENS,
  ) -> None:
      self.unk_word, self.pad_word, self.eos_word = unk, pad, eos
      self.symbols: List[str] = []
      self.count: List[int] = []
      self.indices: Dict[str, int] = {}
      self.lexicon_indices: Set[int] = set()
  
      self.pad_index = self.add_symbol(pad)
      assert self.pad_index == vocab_constants.PAD_ID
  
      # Adds a junk symbol for vocab_constants' GO_ID
      self.add_symbol("<reserved>")
  
      self.eos_index = self.add_symbol(eos)
      assert self.eos_index == vocab_constants.EOS_ID
  
      self.unk_index = self.add_symbol(unk)
      assert self.unk_index == vocab_constants.UNK_ID
      self.bos_index = self.add_symbol(bos)
  
      # Adds junk symbols to pad up to the number of special tokens.
      num_reserved = max_special_tokens - len(self.symbols)
      for i in range(num_reserved):
          self.add_symbol(f"<reserved_{i}>")
  
      self.nspecial = len(self.symbols)
      assert self.nspecial == max_special_tokens
  
imports: import os
  import re
  from typing import Dict, List, Optional, Set
  from fairseq.data import dictionary
  from fairseq.file_io import PathManager
  from pytorch_translate import vocab_constants
label_desc: Use image node_id 1 to create a new Dictionary object from inherited base classes: dictionary with example: obj = Dictionary(pad, eos, unk, bos, max_special_tokens)