From c3e2e2718fa565986ee47019cd422566c171d96b Mon Sep 17 00:00:00 2001 From: Cristina Muntean Date: Wed, 28 Sep 2016 17:16:37 +0200 Subject: [PATCH] limiting condition --- merge_wordcount_with_edge_features.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/merge_wordcount_with_edge_features.py b/merge_wordcount_with_edge_features.py index 532982a..5c68a16 100644 --- a/merge_wordcount_with_edge_features.py +++ b/merge_wordcount_with_edge_features.py @@ -94,14 +94,15 @@ def mergeBlackList(city, cityFile): for line in inputFile: lines += 1 node = Node.parseString(line) - if node.description in tokenDict: - # update node - existing_node = tokenDict[node.description] - updateNode(existing_node, node) - updates += 1 - else: - tokenDict[node.description] = node - new_nodes += 1 + if node.nodeCount > 1: + if node.description in tokenDict: + # update node + existing_node = tokenDict[node.description] + updateNode(existing_node, node) + updates += 1 + else: + tokenDict[node.description] = node + new_nodes += 1 print "Dict size: ", len(tokenDict) print "Lines: ", lines print "Updates: ", updates -- libgit2 0.21.4