Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/algorithms/uast_to_bag_paths.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def __call__(self, uast):
"""

path_contexts = get_paths(uast, self._max_length, self._max_width)
dict_of_paths = Counter(path_contexts)
dict_of_paths = {str(path): val for path, val in Counter(path_contexts).items()}
self._log.info("Extracted paths successfully")

from pprint import pprint
Expand Down
2 changes: 1 addition & 1 deletion src/extractors/paths.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ def __init__(self, max_length=5, max_width=5, **kwargs):
self.uast2paths = Uast2BagOfPaths(max_length, max_width)

def uast_to_bag(self, uast):
return {str(path): 1 for path in self.uast2paths(uast)}
return self.uast2paths(uast)