<commit_before><?php
namespace Hook\Tika;

class Tika {
    private static function run($option, $fileName){
        $process = new \Symfony\Component\Process\Process('java -jar tika-app-1.18.jar '.$option.' "'.$fileName.'"');
        $process->setWorkingDirectory(__DIR__);
        $process->run();

        if (!$process->isSuccessful()) {
            throw new \RuntimeException($process->getErrorOutput());
        }

        return $process->getOutput();
    }

    public static function getWordCount($fileName){
        return str_word_count(self::getText($fileName));
    }

    public static function getXHTML($filename){
        return self::run('--xml', $filename);
    }

    public static function getHTML($filename){
        return self::run('--html', $filename);
    }
<commit_msg>Tika支持1.19<commit_after><?php
namespace Hook\Tika;

class Tika {
    private static function run($option, $fileName){
        $process = new \Symfony\Component\Process\Process('java -jar tika-app-1.19.jar '.$option.' "'.$fileName.'"');
        $process->setWorkingDirectory(__DIR__);
        $process->run();

        if (!$process->isSuccessful()) {
            throw new \RuntimeException($process->getErrorOutput());
        }

        return $process->getOutput();
    }

    public static function getWordCount($fileName){
        return str_word_count(self::getText($fileName));
    }

    public static function getXHTML($filename){
        return self::run('--xml', $filename);
    }

    public static function getHTML($filename){
        return self::run('--html', $filename);
    }

{'fraction_non_alphanumeric': 0.157960981749528, 'fraction_numerical': 0.005663939584644431, 'mean_word_length': 2.955223880597015, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, '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': '6855919', 'n_tokens_mistral': 448, 'n_tokens_neox': 448, 'n_words': 92}