<commit_before><?php
namespace Czim\Processor\Contexts;

use Czim\Processor\Contracts\ProcessContextInterface;
use Czim\DataObject\Contracts\DataObjectInterface;
use Czim\Processor\Contracts\ProcessorInterface;
use Illuminate\Support\Arr;

abstract class AbstractProcessContext implements ProcessContextInterface
{

    /**
     * Data being processed
     *
     * @var DataObjectInterface
     */
    protected $data;

    /**
     * Particular settings for the context at large
     *
     * @var array
     */
    protected $settings = [];

    /**
     * Cached data
     *
     * @var array
     */
    protected $cache = [];

    /**
     * @var ProcessorInterface|null
     */
    protected $processor;


    /**
     * @param DataObjectInterface     $data
     * @param array|null              $settings
     * @param ProcessorInterface|null $processor
     */
    public function __construct(
        DataObjectInterface $data,
        array $settings = null,
        ProcessorInterface $processor = null
    ) {
        $this->data = $data;

        if ( ! is_null($settings)) {
            $this->setSettings($settings);
        }

        $this->cache = [];

        $this->initialize();
    }

    /**
     * @param ProcessorInterface $processor
     * @return $this
     */
    public function setProcessor(ProcessorInterface $processor)
    {
        $this->processor = $processor;

        return $this;
    }

    /**
     * @return ProcessorInterface|null
     */<commit_msg>fixed missing assignment of processor in context constructor<commit_after><?php
namespace Czim\Processor\Contexts;

use Czim\Processor\Contracts\ProcessContextInterface;
use Czim\DataObject\Contracts\DataObjectInterface;
use Czim\Processor\Contracts\ProcessorInterface;
use Illuminate\Support\Arr;

abstract class AbstractProcessContext implements ProcessContextInterface
{

    /**
     * Data being processed
     *
     * @var DataObjectInterface
     */
    protected $data;

    /**
     * Particular settings for the context at large
     *
     * @var array
     */
    protected $settings = [];

    /**
     * Cached data
     *
     * @var array
     */
    protected $cache = [];

    /**
     * @var ProcessorInterface|null
     */
    protected $processor;


    /**
     * @param DataObjectInterface     $data
     * @param array|null              $settings
     * @param ProcessorInterface|null $processor
     */
    public function __construct(
        DataObjectInterface $data,
        array $settings = null,
        ProcessorInterface $processor = null
    ) {
        $this->data      = $data;
        $this->processor = $processor;

        if ( ! is_null($settings)) {
            $this->setSettings($settings);
        }

        $this->cache = [];

        $this->initialize();
    }

    /**
     * @param ProcessorInterface $processor
     * @return $this
     */
    public function setProcessor(ProcessorInterface $processor)
    {
        $this->processor = $processor;

        return $this;
    }

    /**
     * @return ProcessorInterface|null
     */
{'fraction_non_alphanumeric': 0.10977590126664502, 'fraction_numerical': 0.0, 'mean_word_length': 2.171987641606591, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 14, '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': '918159', 'n_tokens_mistral': 837, 'n_tokens_neox': 824, 'n_words': 181}