<commit_before>/* testshg.cc: testing SHG library */

/**
 * \file testing/testshg.cc
 * Testing SHG library.
 * \date Created on 20 August 2009.
 */

#include <algorithm>
#include <iomanip>
#include <iostream>
#include <string>
#include <vector>
#ifdef MCHECK
extern "C" {
#include <mcheck.h>
}
#endif
#include "shg/ieee.h"
#include "shg/utils.h"
#include "testshg.h"

namespace SHG {
namespace Testing {

const char* const prgname {"testshg"};
std::ofstream logfile;
const char* const data_path {"../testing/data/"};

namespace {

std::string center(const std::string& s, std::size_t n) {
     std::string t(s);
     const std::string::size_type l = SHG::clean_string(t).size();
     if (n <= l)
          return t;
     return std::string((n - l) / 2, ' ') + t;
}

}       // anonymous namespace

std::string datapath(const char* fname) {
     return std::string(data_path) + fname;
}

void header(const std::string& s) {
     logfile << std::string(72, '=') << '\n';
     logfile << center(s, 72) << '\n';
     logfile << std::string(72, '=') << '\n';
}

void footer(const std::string& s) {
     logfile << std::string(72, '=') << '\n';
     logfile << center("end of " + s, 72) << '\n';
     logfile << std::string(72, '=') << '\n';
}
<commit_msg>Path to data files removed.<commit_after>/* testshg.cc: testing SHG library */

/**
 * \file testing/testshg.cc
 * Testing SHG library.
 * \date Created on 20 August 2009.
 */

#include <algorithm>
#include <iomanip>
#include <iostream>
#include <string>
#include <vector>
#ifdef MCHECK
extern "C" {
#include <mcheck.h>
}
#endif
#include "shg/ieee.h"
#include "shg/utils.h"
#include "testshg.h"

namespace SHG {
namespace Testing {

const char* const prgname {"testshg"};
std::ofstream logfile;

namespace {

std::string center(const std::string& s, std::size_t n) {
     std::string t(s);
     const std::string::size_type l = SHG::clean_string(t).size();
     if (n <= l)
          return t;
     return std::string((n - l) / 2, ' ') + t;
}

}       // anonymous namespace

void header(const std::string& s) {
     logfile << std::string(72, '=') << '\n';
     logfile << center(s, 72) << '\n';
     logfile << std::string(72, '=') << '\n';
}

void footer(const std::string& s) {
     logfile << std::string(72, '=') << '\n';
     logfile << center("end of " + s, 72) << '\n';
     logfile << std::string(72, '=') << '\n';
}

{'fraction_non_alphanumeric': 0.20218579234972678, 'fraction_numerical': 0.015973097940311057, 'mean_word_length': 3.375, 'pattern_counts': {'":': 0, '<': 65, '<?xml version=': 0, '>': 15, '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': '723098', 'n_tokens_mistral': 919, 'n_tokens_neox': 878, 'n_words': 226}