<commit_before><?php
namespace Generator;

class Vector
{
    private $elementGenerator;
    
    public function __construct($elementGenerator)
    {
        $this->elementGenerator = $elementGenerator;
        $this->upperLimit = 1000;
    }

    public function __invoke()
    {
        $vector = [];
        for ($i = 0; $i < rand(1, $this->upperLimit); $i++) {
            $vector[] = call_user_func($this->elementGenerator);
        }
        return $vector;
    }

    public function shrink()
    {
        $this->upperLimit--;
        return $this;
    }
}<commit_msg>Shrinks very slowly, but correctly to the 5-element vector<commit_after><?php
namespace Generator;

class Vector
{
    private $elementGenerator;
    
    public function __construct($elementGenerator)
    {
        $this->elementGenerator = $elementGenerator;
        $this->lowerLimit = 1;
        $this->upperLimit = 1000;
    }

    public function __invoke()
    {
        $vector = [];
        for ($i = 0; $i < rand($this->lowerLimit, $this->upperLimit); $i++) {
            $vector[] = call_user_func($this->elementGenerator);
        }
        return $vector;
    }

    public function shrink()
    {
        $this->lowerLimit = $this->upperLimit;
        $this->upperLimit--;
        return $this;
    }
}
{'fraction_non_alphanumeric': 0.1345707656612529, 'fraction_numerical': 0.010054137664346482, 'mean_word_length': 2.235, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 17, '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': '2726347', 'n_tokens_mistral': 389, 'n_tokens_neox': 371, 'n_words': 82}