Open joa-quim opened 8 years ago
I suggest creating a build system with CMake to build a shared library libparatext.so
It's a header-only template library so simply include the headers you need.
The CSVColBasedLoader
is the main controller class for CSV loading. For example, to load a CSV file myfile.csv
and copy the contents of the first column, which is assumed categorical, do:
#include <vector>
#include "csv/colbased_loader.hpp"
int main(int argc, char **argv) {
ParaText::CSV::ColBasedLoader loader;
ParaText::ParseParams params;
params.num_threads=1;
loader.load("myfile.csv", params);
// Now, just grab the first column, which we assume to be categorical.
std::vector<size_t> col_data;
auto inserter = std::back_inserter(col_data);
loader.copy_column<decltype(inserter), size_t>(0, inserter);
auto levels = loader.get_levels();
return 0;
}
HTH. A C++ tutorial and reference guide is in our medium-term roadmap.
It might be nice to add a makefile for installing the headers into a particular toolchain location
Ok, as title says. If I want to build just the lib and no python wrapper how can we do that?
Thanks