Skip to content

Commit 3284c30

Browse files
authored
Merge pull request #4 from r0mainK/fix/value
Fix value in path extractor
2 parents 091021e + 77944df commit 3284c30

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/algorithms/uast_to_bag_paths.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def __call__(self, uast):
2727
"""
2828

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

3333
from pprint import pprint

src/extractors/paths.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ def __init__(self, max_length=5, max_width=5, **kwargs):
1212
self.uast2paths = Uast2BagOfPaths(max_length, max_width)
1313

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

0 commit comments

Comments
 (0)