Skip to content

Commit a383c78

Browse files
committed
Small modifications due to weird changes in output in SWUM
1 parent 391a437 commit a383c78

File tree

5 files changed

+8
-6
lines changed

5 files changed

+8
-6
lines changed

ensemble_tagger_implementation/ensemble_functions.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ def Process_identifier_with_swum(identifier_data, context_of_identifier):
2626
split_identifier_name = '_'.join(ronin.split(identifier_type_and_name[1]))
2727
if Get_identifier_context(context_of_identifier) != CODE_CONTEXT.FUNCTION:
2828
swum_string = "{identifier_type} {identifier_name}".format(identifier_name = split_identifier_name, identifier_type = identifier_type_and_name[0])
29+
print(['java', '-jar', '../SWUM/SWUM_POS/swum.jar', swum_string, '2', 'true'])
2930
swum_process = subprocess.Popen(['java', '-jar', '../SWUM/SWUM_POS/swum.jar', swum_string, '2', 'true'], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
3031
else:
3132
split_identifier_name = split_identifier_name+'('+identifier_data.split('(')[1]

ensemble_tagger_implementation/preprocess_identifiers.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,14 @@ def Split_raw_identifier(identifier_data):
2020
return identifier_type_and_name
2121

2222
def Parse_swum(swum_output, split_identifier_name):
23-
code_context = swum_output.split('#')
23+
code_context = swum_output.split(':')
24+
print(code_context)
2425
raw_grammar_pattern = grammar_pattern = identifier = []
2526
if code_context[0] == 'FIELD':
26-
identifier = code_context[1].split('-')[1].split()
27+
identifier = code_context[2].split('-')[1].split()
2728
raw_grammar_pattern = re.findall('([A-Z]+)', ' '.join(identifier))
2829
else:
29-
identifier = code_context[1].split('@')[1].split('|')
30+
identifier = code_context[3].split('|')
3031
raw_grammar_pattern = re.findall('([A-Z]+)', ' '.join(identifier))
3132

3233
for pos in raw_grammar_pattern:

srcSAXEventDispatch

0 commit comments

Comments
 (0)