From be1917d05b942bcc6c6dadf817ee0554f17c341b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ricardo=20Montan=CC=83ana?= Date: Thu, 6 Jul 2023 16:15:23 +0200 Subject: [PATCH] Fix attribute name extraction in ArffFiles --- tests/ArffFiles.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/ArffFiles.cpp b/tests/ArffFiles.cpp index 82f5774..a95e244 100644 --- a/tests/ArffFiles.cpp +++ b/tests/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; }