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

.ts file path is now relative to expdir

parent 8749d5f3
No related branches found
No related tags found
No related merge requests found
...@@ -46,7 +46,7 @@ void ReadingMachine::readFromFile(std::filesystem::path path) ...@@ -46,7 +46,7 @@ void ReadingMachine::readFromFile(std::filesystem::path path)
if (!util::doIfNameMatch(std::regex("Name : (.+)"), lines[curLine++], [this](auto sm){name = sm[1];})) if (!util::doIfNameMatch(std::regex("Name : (.+)"), lines[curLine++], [this](auto sm){name = sm[1];}))
util::myThrow("No name specified"); util::myThrow("No name specified");
while (util::doIfNameMatch(std::regex("Classifier : (.+) (.+) (.+)"), lines[curLine++], [this](auto sm){classifier.reset(new Classifier(sm[1], sm[2], sm[3]));})); while (util::doIfNameMatch(std::regex("Classifier : (.+) (.+) (.+)"), lines[curLine++], [this,path](auto sm){classifier.reset(new Classifier(sm.str(1), sm.str(2), path.parent_path() / sm.str(3)));}));
if (!classifier.get()) if (!classifier.get())
util::myThrow("No Classifier specified"); util::myThrow("No Classifier specified");
...@@ -54,7 +54,7 @@ void ReadingMachine::readFromFile(std::filesystem::path path) ...@@ -54,7 +54,7 @@ void ReadingMachine::readFromFile(std::filesystem::path path)
if (!util::doIfNameMatch(std::regex("Predictions : (.+)"), lines[curLine++], [this](auto sm) if (!util::doIfNameMatch(std::regex("Predictions : (.+)"), lines[curLine++], [this](auto sm)
{ {
auto predictions = std::string(sm[1]); auto predictions = sm.str(1);
auto splited = util::split(predictions, ' '); auto splited = util::split(predictions, ' ');
for (auto & prediction : splited) for (auto & prediction : splited)
predicted.insert(std::string(prediction)); predicted.insert(std::string(prediction));
......
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