From 9cd10b9612a8051023640d6714f88b354fa8c54a Mon Sep 17 00:00:00 2001
From: Franck Dary <franck.dary@lis-lab.fr>
Date: Mon, 8 Feb 2021 11:02:58 +0100
Subject: [PATCH] Added possibility to print special columns in printForDebug

---
 reading_machine/src/Config.cpp | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/reading_machine/src/Config.cpp b/reading_machine/src/Config.cpp
index 5bd1f7d..ffe2f3e 100644
--- a/reading_machine/src/Config.cpp
+++ b/reading_machine/src/Config.cpp
@@ -145,6 +145,8 @@ void Config::printForDebug(FILE * dest) const
   static constexpr int windowSize = 10;
   static constexpr int lettersWindowSize = 40;
   static constexpr int maxWordLength = 7;
+  // exceptions = special columns we wish to print
+  static std::set<std::string> exceptions{};
 
   int firstLineToPrint = wordIndex;
   int lastLineToPrint = wordIndex;
@@ -159,7 +161,7 @@ void Config::printForDebug(FILE * dest) const
   toPrint.back().emplace_back("");
   for (unsigned int i = 0; i < getNbColumns(); i++)
   {
-    if (isExtraColumn(getColName(i)) and getColName(i) != EOSColName)
+    if ((isExtraColumn(getColName(i)) and exceptions.count(getColName(i)) == 0) and getColName(i) != EOSColName)
       continue;
     toPrint.back().emplace_back(getColName(i));
   }
@@ -170,7 +172,7 @@ void Config::printForDebug(FILE * dest) const
     toPrint.back().emplace_back(line == (int)wordIndex ? "=>" : "");
     for (unsigned int i = 0; i < getNbColumns(); i++)
     {
-      if (isExtraColumn(getColName(i)) and getColName(i) != EOSColName)
+      if ((isExtraColumn(getColName(i)) and exceptions.count(getColName(i)) == 0) and getColName(i) != EOSColName)
         continue;
       std::string colContent = has(i,line,0) ? getAsFeature(i, line).get() : "?";
       std::string toPrintCol = colContent;
-- 
GitLab