def _tree(self, i):
        node = self.get_by_address(i)
        word = node['word']
        deps = sorted(chain.from_iterable(node['deps'].values()))

        if deps:
            return Tree(word, [self._tree(dep) for dep in deps])
        else:
            return word
Turn dependency graphs into NLTK trees.
dataset/ETHPy150Open nltk/nltk/nltk/parse/dependencygraph.py/DependencyGraph._tree