<commit_before>#include <aleph/topology/Simplex.hh>
#include <aleph/topology/SimplicialComplex.hh>

#include <aleph/utilities/String.hh>

#include <fstream>
#include <istream>
#include <iostream>
#include <stdexcept>
#include <string>
#include <vector>

using DataType          = double;
using VertexType        = unsigned;
using Simplex           = aleph::topology::Simplex<DataType, VertexType>;
using SimplicialComplex = aleph::topology::SimplicialComplex<Simplex>;

std::vector<SimplicialComplex> readData( std::istream& in )
{
  std::string line;

  while( std::getline( in, line ) )
  {
    auto tokens
      = aleph::utilities::split(
          line,
          std::string( "[:;,[:space:]]+" )
    );

    std::vector<DataType> values;
    values.reserve( tokens.size() );

    for( auto&& token : tokens )
    {
      bool success = false;
      auto value   = aleph::utilities::convert<DataType>( token, success );

      if( !success )
        throw std::runtime_error( "Unable to convert token to expected data type" );

      values.emplace_back( value );
    }
  }
}

void usage()
{
}

int main( int argc, char** argv )
{
  if( argc < 1 )
  {
    usage();
    return -1;<commit_msg>Basic simplicial complex loading for functions<commit_after>#include <aleph/topology/io/Function.hh>

#include <aleph/topology/Simplex.hh>
#include <aleph/topology/SimplicialComplex.hh>

#include <aleph/utilities/String.hh>

#include <fstream>
#include <istream>
#include <iostream>
#include <stdexcept>
#include <string>
#include <vector>

using DataType          = double;
using VertexType        = unsigned;
using Simplex           = aleph::topology::Simplex<DataType, VertexType>;
using SimplicialComplex = aleph::topology::SimplicialComplex<Simplex>;

std::vector<SimplicialComplex> readData( std::istream& in )
{
  std::vector<SimplicialComplex> complexes;
  std::string line;

  while( std::getline( in, line ) )
  {
    auto tokens
      = aleph::utilities::split(
          line,
          std::string( "[:;,[:space:]]+" )
    );

    std::vector<DataType> values;
    values.reserve( tokens.size() );

    for( auto&& token : tokens )
    {
      bool success = false;
      auto value   = aleph::utilities::convert<DataType>( token, success );

      if( !success )
        throw std::runtime_error( "Unable to convert token to expected data type" );

      values.emplace_back( value );
    }

    complexes.push_back(
      aleph::topology::io::loadFunction<SimplicialComplex>(
        values.begin(), values.end(),
        [] ( DataType x, DataType y )
        {
          return std::max(x,y);
        }
      )
    );
  }

  return complexes;
}

void usage()
{
}

int main( int argc, char** argv )
{
  if( argc < 1 )
  {
    usage();
    return -1;
{'fraction_non_alphanumeric': 0.14280536426241391, 'fraction_numerical': 0.0014498006524102935, 'mean_word_length': 3.1503759398496243, 'pattern_counts': {'":': 0, '<': 36, '<?xml version=': 0, '>': 34, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2465819', 'n_tokens_mistral': 917, 'n_tokens_neox': 893, 'n_words': 202}