class_docstr: A container for the nodes and labelled edges of a dependency structure.
docstr: Extract dependency triples of the form:
  ((head word, head tag), rel, (dep word, dep tag))
docstr_tok: ["Extract","dependency","triples","of","the","form",":","(","(","head","word",",","head","tag",")",",","rel",",","(","dep","word",",","dep","tag",")",")"]
code: def triples(self, node=None):
      """
      Extract dependency triples of the form:
      ((head word, head tag), rel, (dep word, dep tag))
      """
  
      if not node:
          node = self.root
  
      head = (node["word"], node["ctag"])
      for i in sorted(chain.from_iterable(node["deps"].values())):
          dep = self.get_by_address(i)
          yield (head, dep["rel"], (dep["word"], dep["ctag"]))
          yield from self.triples(node=dep)
  
imports: import subprocess
  import warnings
  from collections import defaultdict
  from itertools import chain
  from pprint import pformat
  from nltk.internals import find_binary
  from nltk.tree import Tree
label_desc: Use image node_id 20 for calling the DependencyGraph obj's underlying member method code with example usage: obj.triples(node) without return types