Commit 671d5d01ea28123c2ca86830bf31365f7ba467db

Authored by Cristina Muntean
1 parent a493e664

other print

Showing 1 changed file with 3 additions and 1 deletions   Show diff stats
merge_wordcount_with_edge_features.py
... ... @@ -80,23 +80,25 @@ def mergeBlackList(city, cityFile):
80 80 :return:
81 81 """
82 82 tokenDict = dict()
  83 + lines = 0
83 84 updates = 0
84 85 new_nodes = 0
85 86  
86 87 fileDir = os.path.dirname(os.path.realpath(cityFile))
87 88 filetype = cityFile.split("/")[-1].replace(city, "")
  89 +
88 90 for filename in os.listdir(fileDir):
89 91 if city not in filename and filetype in filename:
90 92 print "Opening file: ", filename
91 93 inputFile = codecs.open(fileDir+"/"+filename, "r", "utf-8")
92 94 for line in inputFile:
  95 + lines += 1
93 96 node = Node.parseString(line)
94 97 if node.description in tokenDict:
95 98 # update node
96 99 existing_node = tokenDict[node.description]
97 100 updateNode(existing_node, node)
98 101 updates += 1
99   -
100 102 else:
101 103 tokenDict[node.description] = node
102 104 new_nodes += 1
... ...