<commit_before><commit_msg>- Added dot processor<commit_after><?php

class plDotProcessor extends plExternalCommandProcessor 
{
    public $options;

    public function __construct() 
    {
        $this->options = new plProcessorOptions();
    }

    public function getInputTypes() 
    {
        return array( 
            'text/dot',
        );
    }

    public function getOutputType() 
    {
        return 'image/png';
    }

    public function execute( $infile, $outfile, $type ) 
    {
        exec(
            'dot -Tpng -o ' . escapeshellarg( $outfile ) . ' ' . escapeshellarg( $infile ),
            $output,
            $return
        );

        if ( $return !== 0 ) 
        {
            throw new plProcessorExternalExecutionException( $output );
        }
    }
}

?>
{'fraction_non_alphanumeric': 0.11139240506329114, 'fraction_numerical': 0.0012658227848101266, 'mean_word_length': 1.7657342657342658, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 5, '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': '5423835', 'n_tokens_mistral': 234, 'n_tokens_neox': 218, 'n_words': 50}