class_docstr:     Dependency-parsing-tree based graph construction class
  
  Parameters
  ----------
  vocab: VocabModel
      Vocabulary including all words appeared in graphs.
class_docstr_tok: ["Dependency-parsing-tree","based","graph","construction","class","Parameters","--","--","--","--","--","vocab",":","VocabModel","Vocabulary","including","all","words","appeared","in","graphs","."]
docstr:     Add node tokens appeared in graph g to vocabulary.
  
  Parameters
  ----------
  g: GraphData
      Graph data-structure.
docstr_tok: ["Add","node","tokens","appeared","in","graph","g","to","vocabulary",".","Parameters","--","--","--","--","--","g",":","GraphData","Graph","data-structure","."]
code: def add_vocab(self, g):
      """
          Add node tokens appeared in graph g to vocabulary.
  
      Parameters
      ----------
      g: GraphData
          Graph data-structure.
  
      """
      for i in range(g.get_node_num()):
          attr = g.get_node_attrs(i)[i]
          self.vocab.word_vocab._add_words([attr["token"]])
  
file_path: graph4nlp/graph4nlp/pytorch/modules/graph_construction/dependency_graph_construction.py
imports: import copy
  import json
  from ...data.data import GraphData
  from .base import StaticGraphConstructionBase
label_desc: Use image node_id 2 for calling the DependencyBasedGraphConstruction obj's underlying member method code with example usage: obj.add_vocab(g) without return types