class_docstr: Class for generating a dictionary of all words in the PTB corpus
class_docstr_tok: ["Class","for","generating","a","dictionary","of","all","words","in","the","PTB","corpus"]
docstr: Method for adding a single word to the dictionary
  Args:
      word: str, word to be added
  
  Returns:
      None
docstr_tok: ["Method","for","adding","a","single","word","to","the","dictionary","Args",":","word",":","str",",","word","to","be","added","Returns",":","None"]
code: def add_word(self, word):
      """
      Method for adding a single word to the dictionary
      Args:
          word: str, word to be added
  
      Returns:
          None
      """
      if word not in self.word2idx:
          self.idx2word.append(word)
          self.word2idx[word] = len(self.idx2word) - 1
      return self.word2idx[word]
  
file_path: nlp-architect/nlp_architect/data/ptb.py
imports: import os
  import sys
  import numpy
  import urllib.request
label_desc: Use image node_id 2 for calling the PTBDictionary obj's underlying member method code with example usage: obj.add_word(word) and returns: self