From 3bae1fe390351e0555b590d473bf600a935a8323 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ricardo=20Montan=CC=83ana?= Date: Thu, 6 Jul 2023 16:57:25 +0200 Subject: [PATCH] Fix attribute name extraction in ArffFiles --- src/cppmdlp | 2 +- src/fimdlp/ArffFiles.cpp | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/cppmdlp b/src/cppmdlp index db76afc..be1917d 160000 --- a/src/cppmdlp +++ b/src/cppmdlp @@ -1 +1 @@ -Subproject commit db76afc4e2f38c4b365925b84b31c0bb5713dc84 +Subproject commit be1917d05b942bcc6c6dadf817ee0554f17c341b diff --git a/src/fimdlp/ArffFiles.cpp b/src/fimdlp/ArffFiles.cpp index b576699..b3336fe 100644 --- a/src/fimdlp/ArffFiles.cpp +++ b/src/fimdlp/ArffFiles.cpp @@ -63,7 +63,7 @@ void ArffFiles::load(const string& fileName, bool classLast) type = ""; while (ss >> type_w) type += type_w + " "; - attributes.emplace_back(attribute, trim(type)); + attributes.emplace_back(trim(attribute), trim(type)); continue; } if (line[0] == '@') { @@ -111,8 +111,8 @@ void ArffFiles::generateDataset(bool classLast) string ArffFiles::trim(const string& source) { string s(source); - s.erase(0, s.find_first_not_of(" \n\r\t")); - s.erase(s.find_last_not_of(" \n\r\t") + 1); + s.erase(0, s.find_first_not_of(" '\n\r\t")); + s.erase(s.find_last_not_of(" '\n\r\t") + 1); return s; }