Merges another document graph into the current one, thereby adding all
        the necessary nodes and edges (with attributes, layers etc.).

        NOTE: This will only work if both graphs have exactly the same
        tokenization.

def merge_graphs(self, other_docgraph, verbose=False):
        """
        Merges another document graph into the current one, thereby adding all
        the necessary nodes and edges (with attributes, layers etc.).

        NOTE: This will only work if both graphs have exactly the same
        tokenization.
        """
        # keep track of all merged/old root nodes in case we need to
        # delete them or their attributes (e.g. 'metadata')
        if hasattr(self, 'merged_rootnodes'):
            self.merged_rootnodes.append(other_docgraph.root)
        else:
            self.merged_rootnodes = [other_docgraph.root]

        # renaming the tokens of the other graph to match this one
        rename_tokens(other_docgraph, self, verbose=verbose)
        self.add_nodes_from(other_docgraph.nodes(data=True))

        # copy token node attributes to the current namespace
        for node_id, node_attrs in other_docgraph.nodes(data=True):
            if istoken(other_docgraph, node_id) and \
                self.ns+':token' not in self.node[node_id]:
                    self.node[node_id].update({self.ns+':token': other_docgraph.get_token(node_id)})
        self.add_edges_from(other_docgraph.edges(data=True))

        # workaround for issues #89 and #96
        # copy the token node IDs / sentence node IDs from the other graph,
        # if this graph doesn't have such lists, yet
        if other_docgraph.name and not self.name:
            self.name = other_docgraph.name
        if other_docgraph.tokens and not self.tokens:
            self.tokens = other_docgraph.tokens
        if other_docgraph.sentences and not self.sentences:
            self.sentences = other_docgraph.sentences

        # there should be no dangling, unused root nodes in a merged graph
        self.merge_rootnodes(other_docgraph)