<commit_before><?php

spl_autoload_register(function ($class) {
    $path = __DIR__;
    foreach (explode('\\', $class) as $part) {
        $path .= DIRECTORY_SEPARATOR . $part;
        if (file_exists("$path.php")) {
            require_once "$path.php";
        } else if (!file_exists($path)) {
            break;
        }
    }
});

<commit_msg>Improve autoloader<commit_after><?php

spl_autoload_register(function ($cls) {
    for ($cls = explode('\\', $cls); $cls; array_pop($cls)) {
        $sep = DIRECTORY_SEPARATOR;
        $php = __DIR__ . $sep . join($sep, $cls) . '.php';
        if (file_exists($php)) {
            /** @noinspection PhpIncludeInspection */
            require_once $php;
            break;
        }
    }
});

{'fraction_non_alphanumeric': 0.1695827725437416, 'fraction_numerical': 0.0, 'mean_word_length': 2.1931330472103006, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, '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': '2306288', 'n_tokens_mistral': 253, 'n_tokens_neox': 251, 'n_words': 46}