<commit_before>package uk.ac.ebi.quickgo.client.service.loader.presets.ff;

import java.util.List;
import org.springframework.batch.item.ItemProcessor;

import static com.google.common.base.Preconditions.checkArgument;

/**
 * Checks the validity of the relevancy associated with a {@link RawNamedPreset}.
 *
 * Created 31/08/16
 * @author Edd
 */
public class RawNamedPresetRelevanceChecker implements ItemProcessor<RawNamedPreset, RawNamedPreset> {
    private static final RawNamedPreset INSIGNIFICANT_PRESET = null;
    private final List<String> presetsOrderedByRelevance;

    public RawNamedPresetRelevanceChecker(List<String> presetsOrderedByRelevance) {
        checkArgument(presetsOrderedByRelevance != null, "The parameter, presetsOrderedByRelevance, cannot be null");
        this.presetsOrderedByRelevance = presetsOrderedByRelevance;
    }

    @Override public RawNamedPreset process(RawNamedPreset rawNamedPreset) throws Exception {
        int relevancyPosition = presetsOrderedByRelevance.indexOf(rawNamedPreset.name);

        if (relevancyPosition >= 0) {
            rawNamedPreset.relevancy = relevancyPosition;
            return rawNamedPreset;
        } else {
            return INSIGNIFICANT_PRESET;
        }
    }
}
<commit_msg>don't declare throws exception, which is no longer thrown<commit_after>package uk.ac.ebi.quickgo.client.service.loader.presets.ff;

import java.util.List;
import org.springframework.batch.item.ItemProcessor;

import static com.google.common.base.Preconditions.checkArgument;

/**
 * Checks the validity of the relevancy associated with a {@link RawNamedPreset}.
 *
 * Created 31/08/16
 * @author Edd
 */
public class RawNamedPresetRelevanceChecker implements ItemProcessor<RawNamedPreset, RawNamedPreset> {
    private static final RawNamedPreset INSIGNIFICANT_PRESET = null;
    private final List<String> presetsOrderedByRelevance;

    public RawNamedPresetRelevanceChecker(List<String> presetsOrderedByRelevance) {
        checkArgument(presetsOrderedByRelevance != null, "The parameter, presetsOrderedByRelevance, cannot be null");
        this.presetsOrderedByRelevance = presetsOrderedByRelevance;
    }

    @Override public RawNamedPreset process(RawNamedPreset rawNamedPreset) {
        int relevancyPosition = presetsOrderedByRelevance.indexOf(rawNamedPreset.name);

        if (relevancyPosition >= 0) {
            rawNamedPreset.relevancy = relevancyPosition;
            return rawNamedPreset;
        } else {
            return INSIGNIFICANT_PRESET;
        }
    }
}

{'fraction_non_alphanumeric': 0.07550137632717263, 'fraction_numerical': 0.005505308690523005, 'mean_word_length': 4.181262729124236, 'pattern_counts': {'":': 0, '<': 9, '<?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': '1799763', 'n_tokens_mistral': 760, 'n_tokens_neox': 728, 'n_words': 154}