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

Fixed bugs when there was no HEAD col in mcd

parent 2cd71b60
No related branches found
No related tags found
No related merge requests found
...@@ -106,15 +106,16 @@ void BaseConfig::readTSVInput(std::string_view tsvFilename) ...@@ -106,15 +106,16 @@ void BaseConfig::readTSVInput(std::string_view tsvFilename)
firstIndexOfSequence = i; firstIndexOfSequence = i;
id2index[getConst(idColName, i, 0)] = i; id2index[getConst(idColName, i, 0)] = i;
} }
for (int i = firstIndexOfSequence; i < (int)getNbLines(); ++i) if (hasColIndex(headColName))
{ for (int i = firstIndexOfSequence; i < (int)getNbLines(); ++i)
if (!isToken(i)) {
continue; if (!isToken(i))
auto & head = get(headColName, i, 0); continue;
if (head == "0") auto & head = get(headColName, i, 0);
continue; if (head == "0")
head = std::to_string(id2index[head]); continue;
} head = std::to_string(id2index[head]);
}
} catch(std::exception & e) {util::myThrow(e.what());} } catch(std::exception & e) {util::myThrow(e.what());}
continue; continue;
......
...@@ -605,8 +605,9 @@ void Config::addMissingColumns() ...@@ -605,8 +605,9 @@ void Config::addMissingColumns()
if (curId == 1) if (curId == 1)
firstIndex = index; firstIndex = index;
if (util::isEmpty(getAsFeature(headColName, index))) if (hasColIndex(headColName))
getLastNotEmptyHyp(headColName, index) = (curId == 1) ? "0" : std::to_string(firstIndex); if (util::isEmpty(getAsFeature(headColName, index)))
getLastNotEmptyHyp(headColName, index) = (curId == 1) ? "0" : std::to_string(firstIndex);
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment