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

Changed regexp

parent 586b6b0b
No related branches found
No related tags found
No related merge requests found
......@@ -90,10 +90,26 @@ void Decoder::evaluate(const Config & config, std::filesystem::path modelPath, c
{
if (buffer != std::fgets(buffer, 1024, evalFromUD))
break;
if (util::doIfNameMatch(std::regex("(.*)\\|(.*)\\|(.*)\\|(.*)\\|(.*)"), buffer, [this](auto sm)
if (buffer[std::strlen(buffer)-1] == '\n')
buffer[std::strlen(buffer)-1] = '\0';
if (util::doIfNameMatch(std::regex("(.*)Metric(.*)"), buffer, [this, buffer](auto sm){}))
continue;
if (util::doIfNameMatch(std::regex("(.*)\\|(.*)\\|(.*)\\|(.*)\\|(.*)"), buffer, [this, buffer](auto sm)
{
for (unsigned int i = 0; i < this->evaluation[sm[1]].size(); i++)
this->evaluation[sm[1]][i] = std::stof(sm[1+i]);
{
if (std::string(sm[i+2]).empty())
{
this->evaluation[sm[1]][i] = 0.0;
continue;
}
try {this->evaluation[sm[1]][i] = std::stof(sm[i+2]);}
catch (std::exception &)
{
util::myThrow(fmt::format("score '{}' is not a number in line '{}'", std::string(sm[i+2]), buffer));
}
}
})){}
}
......
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