<commit_before><?php
defined('DEBUG') or define('DEBUG', false);

if (!defined('LYSINE_NO_ERROR_HANDLER'))
    set_error_handler(function($errno, $error, $file = null, $line = null) {
        if (error_reporting() & $errno)
            throw new \ErrorException($error, $errno, $errno, $file, $line);
        return true;
    });

spl_autoload_register(function ($class) {
    static $files = null;
    if ($files === null)
        $files = require __DIR__ . '/class_files.php';

    $class = strtolower(ltrim($class, '\\'));

    if (stripos($class, 'lysine\\') !== 0) return false;
    if (!array_key_exists($class, $files)) return false;

    require __DIR__ .'/'. $files[$class];

    return class_exists($class, false) || interface_exists($class, false);
});

require __DIR__ .'/functions.php';
<commit_msg>代码改进 auto load function不需要返回值<commit_after><?php
defined('DEBUG') or define('DEBUG', false);

if (!defined('LYSINE_NO_ERROR_HANDLER'))
    set_error_handler(function($errno, $error, $file = null, $line = null) {
        if (error_reporting() & $errno)
            throw new \ErrorException($error, $errno, $errno, $file, $line);
        return true;
    });

spl_autoload_register(function ($class) {
    static $files = null;
    if ($files === null)
        $files = require __DIR__ . '/class_files.php';

    $class = strtolower(ltrim($class, '\\'));

    if (stripos($class, 'lysine\\') !== 0) return false;
    if (!array_key_exists($class, $files)) return false;

    require __DIR__ .'/'. $files[$class];
});

require __DIR__ .'/functions.php';

{'fraction_non_alphanumeric': 0.1796675191815857, 'fraction_numerical': 0.0012787723785166241, 'mean_word_length': 3.6996996996997, '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': '1403472', 'n_tokens_mistral': 528, 'n_tokens_neox': 511, 'n_words': 120}