Skip to content

Commit

Permalink
updated sub backend
Browse files Browse the repository at this point in the history
  • Loading branch information
AnthonyMRios committed Dec 6, 2019
1 parent c2a133f commit 89051be
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions pymetamap/SubprocessBackend.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,13 +148,19 @@ def extract_concepts(self, sentences=None, ids=None,
command.append('--silent')

if sentences is not None:
input_text = ""
input_text = None
if ids is not None:
for identifier, sentence in zip(ids, sentences):
input_text += '{0!r}|{1!r}\n'.format(identifier, sentence).encode('utf8')
if input_text is None:
input_text = '{0!r}|{1!r}\n'.format(identifier, sentence).encode('utf8')
else:
input_text += '{0!r}|{1!r}\n'.format(identifier, sentence).encode('utf8')
else:
for sentence in sentences:
input_text += '{0!r}\n'.format(sentence).encode('utf8')
if input_text is None:
input_text = '{0!r}\n'.format(sentence).encode('utf8')
else:
input_text += '{0!r}\n'.format(sentence).encode('utf8')

input_command = list()
input_command.append('echo')
Expand Down

0 comments on commit 89051be

Please sign in to comment.