<commit_before><?php

namespace Qafoo\ChangeTrack\FISCalculator;

class AprioriGenerator
{
    /**
     * Generates candidate frequent item sets based on the Apriorigen algorithm
     *
     * @param \Qafoo\ChangeTrack\FISCalculator\Set[] $inItemSets
     * @return \Qafoo\ChangeTrack\FISCalculator\Set[]
     */
    public function aprioriGen(Set $inItemSets)
    {
        $candidateSets = new Set(array());
        foreach ($inItemSets as $firstItemSet) {
            $candidateSets = $candidateSets->merge(
                $this->generateCandidatesWith($firstItemSet, $inItemSets)
            );
        }
        return $candidateSets;
    }

    /**
     * Generates a set of candidates on basis of $firstItemSet combined with
     * $inItemSets
     *
     * @param \Qafoo\ChangeTrack\FISCalculator\Set $firstItemSet
     * @param \Qafoo\ChangeTrack\FISCalculator\Set $inItemSets;
     * @return \Qafoo\ChangeTrack\FISCalculator\Set[]
     */
    private function generateCandidatesWith(Set $firstItemSet, Set $inItemSets)
    {
        $candidateSets = new MutableSet();
        foreach ($inItemSets as $secondItemSet) {
            if ($firstItemSet->equals($secondItemSet)) {
                continue;
            }

            if (count($firstItemSet->intersect($secondItemSet)) == count($firstItemSet) - 1) {
                $candidateSet = $firstItemSet->merge($secondItemSet);
<commit_msg>Refactored: Renamed variables for clarity.<commit_after><?php

namespace Qafoo\ChangeTrack\FISCalculator;

class AprioriGenerator
{
    /**
     * Generates candidate frequent item sets based on the Apriorigen algorithm
     *
     * @param \Qafoo\ChangeTrack\FISCalculator\Set[] $inItemSets
     * @return \Qafoo\ChangeTrack\FISCalculator\Set[]
     */
    public function aprioriGen(Set $inItemSets)
    {
        $candidateSets = new Set(array());
        foreach ($inItemSets as $firstItemSet) {
            $candidateSets = $candidateSets->merge(
                $this->generateCandidatesWith($firstItemSet, $inItemSets)
            );
        }
        return $candidateSets;
    }

    /**
     * Generates a set of candidates on basis of $baseItemSet combined with
     * $inItemSets
     *
     * @param \Qafoo\ChangeTrack\FISCalculator\Set $baseItemSet
     * @param \Qafoo\ChangeTrack\FISCalculator\Set $inItemSets;
     * @return \Qafoo\ChangeTrack\FISCalculator\Set[]
     */
    private function generateCandidatesWith(Set $baseItemSet, Set $inItemSets)
    {
        $candidateSets = new MutableSet();
        foreach ($inItemSets as $combineItemSet) {
            if ($baseItemSet->equals($combineItemSet)) {
                continue;
            }

            if (count($baseItemSet->intersect($combineItemSet)) == count($baseItemSet) - 1) {
                $candidateSet = $baseItemSet->merge($combineItemSet);

{'fraction_non_alphanumeric': 0.11009174311926606, 'fraction_numerical': 0.0007057163020465773, 'mean_word_length': 2.6068702290076335, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 13, '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': '5010813', 'n_tokens_mistral': 873, 'n_tokens_neox': 846, 'n_words': 162}