From 1e9062bbab4a93bd0fcd1053545434438ac768c9 Mon Sep 17 00:00:00 2001
From: "robin.perrotin" <robin.perrotin@lif.univ-mrs.fr>
Date: Mon, 13 Nov 2017 05:30:32 +0100
Subject: [PATCH] .

---
 maca_trans_parser/src/simple_decoder_parser_arc_eager.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/maca_trans_parser/src/simple_decoder_parser_arc_eager.c b/maca_trans_parser/src/simple_decoder_parser_arc_eager.c
index 6e1c379..bbfaf48 100644
--- a/maca_trans_parser/src/simple_decoder_parser_arc_eager.c
+++ b/maca_trans_parser/src/simple_decoder_parser_arc_eager.c
@@ -151,9 +151,10 @@ void simple_decoder_parser_arc_eager(context *ctx)
   int index;
   float score;
   
-  double sumExp = -1;
-  double currentSumExp = 0.;
+  double sumExp = 0;
+  double currentSumExp = 0;
   double ScoreTranslation = -10.;
+  int FlagNotInitExp = 1;
   
   word* word_scored;
   
@@ -195,11 +196,11 @@ void simple_decoder_parser_arc_eager(context *ctx)
 
 	  if(b1 && b2 && b3){
       printf("\n*** %f %f %d %f \n",ScoreTranslation,vcode_array[i].score, i, sumExp);
-      if(sumExp + 0.5 < 0){
+      if(FlagNotInitExp){
         printf(" %f %f %d ",ScoreTranslation,vcode_array[i].score, i);
         ScoreTranslation += vcode_array[i].score;
         printf(" %f " ,ScoreTranslation);
-        sumExp = 0;
+        FlagNotInitExp = 0;
       }
       if(vcode_array[i].score - ScoreTranslation > 0){
         sumExp += exp(vcode_array[i].score - ScoreTranslation);
-- 
GitLab