Skip to content
Snippets Groups Projects
Commit 9cd10b96 authored by Franck Dary's avatar Franck Dary
Browse files

Added possibility to print special columns in printForDebug

parent f3eac5e2
Branches
No related tags found
No related merge requests found
...@@ -145,6 +145,8 @@ void Config::printForDebug(FILE * dest) const ...@@ -145,6 +145,8 @@ void Config::printForDebug(FILE * dest) const
static constexpr int windowSize = 10; static constexpr int windowSize = 10;
static constexpr int lettersWindowSize = 40; static constexpr int lettersWindowSize = 40;
static constexpr int maxWordLength = 7; static constexpr int maxWordLength = 7;
// exceptions = special columns we wish to print
static std::set<std::string> exceptions{};
int firstLineToPrint = wordIndex; int firstLineToPrint = wordIndex;
int lastLineToPrint = wordIndex; int lastLineToPrint = wordIndex;
...@@ -159,7 +161,7 @@ void Config::printForDebug(FILE * dest) const ...@@ -159,7 +161,7 @@ void Config::printForDebug(FILE * dest) const
toPrint.back().emplace_back(""); toPrint.back().emplace_back("");
for (unsigned int i = 0; i < getNbColumns(); i++) 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; continue;
toPrint.back().emplace_back(getColName(i)); toPrint.back().emplace_back(getColName(i));
} }
...@@ -170,7 +172,7 @@ void Config::printForDebug(FILE * dest) const ...@@ -170,7 +172,7 @@ void Config::printForDebug(FILE * dest) const
toPrint.back().emplace_back(line == (int)wordIndex ? "=>" : ""); toPrint.back().emplace_back(line == (int)wordIndex ? "=>" : "");
for (unsigned int i = 0; i < getNbColumns(); i++) 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; continue;
std::string colContent = has(i,line,0) ? getAsFeature(i, line).get() : "?"; std::string colContent = has(i,line,0) ? getAsFeature(i, line).get() : "?";
std::string toPrintCol = colContent; std::string toPrintCol = colContent;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment