From 7352d54db5a4565ac561fa918766562e6acf93c3 Mon Sep 17 00:00:00 2001 From: Sanyam Agarwal Date: Mon, 15 Oct 2018 19:21:14 -0400 Subject: [PATCH] bug fix: remove stray \r and \n in the SCORE commands in meteor stdin. --- pycocoevalcap/meteor/meteor.py | 1 + 1 file changed, 1 insertion(+) diff --git a/pycocoevalcap/meteor/meteor.py b/pycocoevalcap/meteor/meteor.py index 9ca375d..5440cd7 100755 --- a/pycocoevalcap/meteor/meteor.py +++ b/pycocoevalcap/meteor/meteor.py @@ -52,6 +52,7 @@ def _stat(self, hypothesis_str, reference_list): # SCORE ||| reference 1 words ||| reference n words ||| hypothesis words hypothesis_str = hypothesis_str.replace('|||','').replace(' ',' ') score_line = ' ||| '.join(('SCORE', ' ||| '.join(reference_list), hypothesis_str)) + score_line = score_line.replace('\n', '').replace('\r', '') self.meteor_p.stdin.write('{}\n'.format(score_line)) return self.meteor_p.stdout.readline().strip()