44 lines
1.0 KiB
C++
44 lines
1.0 KiB
C++
|
#ifndef ARFF_HPP
|
||
|
#define ARFF_HPP
|
||
|
|
||
|
#include <string>
|
||
|
#include <vector>
|
||
|
|
||
|
namespace ARFF {
|
||
|
void ParseArguments(int argc, char* argv[]);
|
||
|
std::string GetDataFilename(void);
|
||
|
void LogInfo(const std::string location, const std::string message);
|
||
|
void LogError(const std::string location, const std::string message);
|
||
|
|
||
|
struct AttributeType {
|
||
|
public:
|
||
|
std::string attribute;
|
||
|
std::vector<std::string> values;
|
||
|
AttributeType(std::string attribute);
|
||
|
void AddValue(std::string value);
|
||
|
};
|
||
|
|
||
|
struct Instance {
|
||
|
public:
|
||
|
Instance(const int id, const int size);
|
||
|
unsigned int id;
|
||
|
std::vector<std::string> values;
|
||
|
};
|
||
|
|
||
|
class Arff {
|
||
|
public:
|
||
|
Arff() = default;
|
||
|
void Read(std::string filename);
|
||
|
private:
|
||
|
std::string relation;
|
||
|
std::vector<AttributeType> attributeList;
|
||
|
std::vector<Instance> database;
|
||
|
void AddAttribute(std::string line);
|
||
|
void AddData(std::string line);
|
||
|
void TestIntegrity(void);
|
||
|
};
|
||
|
|
||
|
}
|
||
|
|
||
|
#endif
|