Fix solved mertinterface.py crash on xml tags only sentence
@@ -60,6 +60,7 @@ class _DocumentTranslator:
# tokenize
translation['translation'] = self._tokenizer.process(translation['translation'])
+ if 'nbest' in translation:
for hyp in translation['nbest']:
hyp['translation'] = self._tokenizer.process(hyp['translation'])
@@ -69,6 +70,7 @@ class _DocumentTranslator:
print translation['translation'].encode('utf-8')
sys.stdout.flush()
+ if 'nbest' in translation:
for hyp in translation['nbest']:
scores = []
