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: Save dictionary to file
  Returns:
      None
docstr_tok: ["Save","dictionary","to","file","Returns",":","None"]
code: def save_dictionary(self):
      """
      Save dictionary to file
      Returns:
          None
      """
      with open(
          os.path.join(self.data_dir, "dictionary.txt"), "w"
      ) as fp:
          for k in self.word2idx:
              fp.write("%s,%d\n" % (k, self.word2idx[k]))
  
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 4 for calling the PTBDictionary obj's underlying member method code with example usage: obj.save_dictionary() without return types