From 5f5386de8adae037be81be3bed57fe0aae58e527 Mon Sep 17 00:00:00 2001
From: Franck Dary <franck.dary@lis-lab.fr>
Date: Sun, 29 Mar 2020 15:22:03 +0200
Subject: [PATCH] Added print of transitions scores during decoding in debug
 mode

---
 decoder/src/Decoder.cpp        | 4 ++++
 reading_machine/src/Config.cpp | 2 ++
 2 files changed, 6 insertions(+)

diff --git a/decoder/src/Decoder.cpp b/decoder/src/Decoder.cpp
index 44a8edc..a24f6a2 100644
--- a/decoder/src/Decoder.cpp
+++ b/decoder/src/Decoder.cpp
@@ -44,6 +44,10 @@ void Decoder::decode(BaseConfig & config, std::size_t beamSize, bool debug, bool
           chosenTransition = i;
           bestScore = score;
         }
+        if (debug)
+        {
+          fmt::print(stderr, "{} {:7.2f} {}\n", machine.getTransitionSet().getTransition(i)->appliable(config) ? "*" : " ", score, machine.getTransitionSet().getTransition(i)->getName());
+        }
       }
     } catch(std::exception & e) {util::myThrow(e.what());}
 
diff --git a/reading_machine/src/Config.cpp b/reading_machine/src/Config.cpp
index 03179a0..0429372 100644
--- a/reading_machine/src/Config.cpp
+++ b/reading_machine/src/Config.cpp
@@ -212,6 +212,8 @@ void Config::printForDebug(FILE * dest) const
     if (toPrint[line].back() == EOSSymbol1)
       fmt::print(dest, "\n");
   }
+
+  fmt::print(dest, "{}\n", longLine);
 }
 
 Config::String & Config::getLastNotEmpty(int colIndex, int lineIndex)
-- 
GitLab