<commit_before><?php

require_once 'vendor/autoload.php';

try {
    $configFile = __DIR__ . DIRECTORY_SEPARATOR . "config" . DIRECTORY_SEPARATOR . "config.ini";
    $config = \fkooman\Config\Config::fromIniFile($configFile);

    // data directory
    $dirName        = $config->s('export')->l('dir', true); // REQ

    // validate classes
    $validators     = $config->s('validator')->s('validate', false, array())->toArray();

    $logger = new \fkooman\janus\log\EntityLog();

    $entities = json_decode(file_get_contents($dirName . DIRECTORY_SEPARATOR . "export.json"), true);

    foreach ($validators as $v) {
        //echo $v . PHP_EOL;
        $class = "\\fkooman\\janus\\validate\\" . $v;
        $validate = new $class($entities, $logger);
        $validate->validateEntities();
    }

    $outputFile = $dirName . DIRECTORY_SEPARATOR . "log.json";
    if (false === @file_put_contents($outputFile, $logger->toJson())) {
        throw new Exception(sprintf("unable to write JSON file '%s' to disk", $outputFile));
    }
} catch (Exception $e) {
    echo sprintf("ERROR: %s", $e->getMessage());
    die(PHP_EOL);
}<commit_msg>print validators being run<commit_after><?php

require_once 'vendor/autoload.php';

try {
    $configFile = __DIR__ . DIRECTORY_SEPARATOR . "config" . DIRECTORY_SEPARATOR . "config.ini";
    $config = \fkooman\Config\Config::fromIniFile($configFile);

    // data directory
    $dirName        = $config->s('export')->l('dir', true); // REQ

    // validate classes
    $validators     = $config->s('validator')->s('validate', false, array())->toArray();

    $logger = new \fkooman\janus\log\EntityLog();

    $entities = json_decode(file_get_contents($dirName . DIRECTORY_SEPARATOR . "export.json"), true);

    foreach ($validators as $v) {
        echo sprintf("Validator: %s" . PHP_EOL, $v);
        $class = "\\fkooman\\janus\\validate\\" . $v;
        $validate = new $class($entities, $logger);
        $validate->validateEntities();
    }

    $outputFile = $dirName . DIRECTORY_SEPARATOR . "log.json";
    if (false === @file_put_contents($outputFile, $logger->toJson())) {
        throw new Exception(sprintf("unable to write JSON file '%s' to disk", $outputFile));
    }
} catch (Exception $e) {
    echo sprintf("ERROR: %s", $e->getMessage());
    die(PHP_EOL);
}
{'fraction_non_alphanumeric': 0.17926565874730022, 'fraction_numerical': 0.0, 'mean_word_length': 3.273062730627306, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 19, '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': '7005173', 'n_tokens_mistral': 768, 'n_tokens_neox': 761, 'n_words': 153}