def build_graph (json_iter):
global DEBUG, WordNode<EOL>graph = nx.DiGraph()<EOL>for meta in json_iter:<EOL><INDENT>if DEBUG:<EOL><INDENT>print(meta["<STR_LIT>"])<EOL><DEDENT>for pair in get_tiles(map(WordNode._make, meta["<STR_LIT>"])):<EOL><INDENT>if DEBUG:<EOL><INDENT>print(pair)<EOL><DEDENT>for word_id in pair:<EOL><INDENT>if not graph.has_node(word_id):<EOL><INDENT>graph.add_node(word_id)<EOL><DEDENT><DEDENT>try:<EOL><INDENT>graph.edge[pair[<NUM_LIT:0>]][pair[<NUM_LIT:1>]]["<STR_LIT>"] += <NUM_LIT:1.0><EOL><DEDENT>except KeyError:<EOL><INDENT>graph.add_edge(pair[<NUM_LIT:0>], pair[<NUM_LIT:1>], weight=<NUM_LIT:1.0>)<EOL><DEDENT><DEDENT><DEDENT>return graph<EOL>
construct the TextRank graph from parsed paragraphs