<commit_before>package uk.ac.ebi.quickgo.index.annotation.coterms;

import uk.ac.ebi.quickgo.index.annotation.Annotation;

import com.google.common.base.Preconditions;
import java.util.function.Predicate;
import org.springframework.batch.item.ItemProcessor;

/**
 * @author <NAME>
 * Date: 06/09/2016
 * Time: 16:30
 * Created with IntelliJ IDEA.
 *
 * A version of ItemProcessor for adding details from an {@link uk.ac.ebi.quickgo.index.annotation.Annotation}
 * to a matrix of permutations where GOTerm A and GOTerm B both annotate the same Gene Product.
 *
 * Version of GPAFileToSummary from Beta
 */
public class Co_occurringGoTermsFromAnnotations implements ItemProcessor<Annotation, Annotation> {

    private final AnnotationCo_occurringTermsAggregator annotationCoOccurringTermsAggregator;
    private final Predicate<Annotation> toBeProcessed;

    public Co_occurringGoTermsFromAnnotations(AnnotationCo_occurringTermsAggregator annotationCoOccurringTermsAggregator,
            Predicate<Annotation> toBeProcessed) {
        Preconditions.checkArgument(annotationCoOccurringTermsAggregator != null);
        Preconditions.checkArgument(toBeProcessed != null);
        this.annotationCoOccurringTermsAggregator = annotationCoOccurringTermsAggregator;
        this.toBeProcessed = toBeProcessed;
    }

    @Override
    public Annotation process(Annotation annotation) throws Exception {

        if (toBeProcessed.test(annotation)) {
            annotationCoOccurringTermsAggregator.addRowToMatrix(annotation);
        }

        return annotation;
    }
}<commit_msg>Rename AnnotationCo_occurringTermsAggregator member variable to something more usable.<commit_after>package uk.ac.ebi.quickgo.index.annotation.coterms;

import uk.ac.ebi.quickgo.index.annotation.Annotation;

import com.google.common.base.Preconditions;
import java.util.function.Predicate;
import org.springframework.batch.item.ItemProcessor;

/**
 * @author <NAME>
 * Date: 06/09/2016
 * Time: 16:30
 * Created with IntelliJ IDEA.
 *
 * A version of ItemProcessor for adding details from an {@link uk.ac.ebi.quickgo.index.annotation.Annotation}
 * to a matrix of permutations where GOTerm A and GOTerm B both annotate the same Gene Product.
 *
 * Version of GPAFileToSummary from Beta
 */
public class Co_occurringGoTermsFromAnnotations implements ItemProcessor<Annotation, Annotation> {

    private final AnnotationCo_occurringTermsAggregator aggregator;
    private final Predicate<Annotation> toBeProcessed;

    public Co_occurringGoTermsFromAnnotations(AnnotationCo_occurringTermsAggregator aggregator,
            Predicate<Annotation> toBeProcessed) {
        Preconditions.checkArgument(aggregator != null);
        Preconditions.checkArgument(toBeProcessed != null);
        this.aggregator = aggregator;
        this.toBeProcessed = toBeProcessed;
    }

    @Override
    public Annotation process(Annotation annotation) throws Exception {
        if (toBeProcessed.test(annotation)) {
            aggregator.addRowToMatrix(annotation);
        }
        return annotation;
    }
}
{'fraction_non_alphanumeric': 0.07517084282460136, 'fraction_numerical': 0.0078099576960624795, 'mean_word_length': 4.402460456942004, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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': '5716428', 'n_tokens_mistral': 904, 'n_tokens_neox': 851, 'n_words': 191}