def read_hypergraph(string):
hgr = hypergraph()<EOL>dotG = pydot.graph_from_dot_data(string)<EOL>for each_node in dotG.get_nodes():<EOL><INDENT>if '<STR_LIT>' == each_node.get('<STR_LIT>'):<EOL><INDENT>hgr.add_node(each_node.get_name())<EOL><DEDENT>elif '<STR_LIT>' == each_node.get('<STR_LIT>'):<EOL><INDENT>hgr.add_hyperedge(each_node.get_name())<EOL><DEDENT><DEDENT>for each_link in dotG.get_edges():<EOL><INDENT>if hgr.has_node(each_link.get_source()):<EOL><INDENT>link_hypernode = each_link.get_source()<EOL>link_hyperedge = each_link.get_destination()<EOL><DEDENT>elif hgr.has_node(each_link.get_destination()):<EOL><INDENT>link_hypernode = each_link.get_destination()<EOL>link_hyperedge = each_link.get_source()<EOL><DEDENT>hgr.link(link_hypernode, link_hyperedge)<EOL><DEDENT>return hgr<EOL>
Read a hypergraph from a string in dot format. Nodes and edges specified in the input will be
added to the current hypergraph.

@type  string: string
@param string: Input string in dot format specifying a graph.

@rtype:  hypergraph
@return: Hypergraph