<commit_before>package com.lagodiuk.decisiontree;

public class Rule {

	private final String attribute;

	private final Predicate condition;

	private final Object sampleValue;

	public Rule(String attribute, Predicate condition, Object sampleValue) {
		this.attribute = attribute;
		this.condition = condition;
		this.sampleValue = sampleValue;
	}

	public boolean match(Item item) {
		if (!item.hasAttribute(this.attribute)) {
			return false;
		}
		Object otherField = item.getFieldValue(this.attribute);
		return this.condition.eval(otherField, this.sampleValue);
	}

	@Override
	public String toString() {
		return String.format("%s %s %s", this.attribute, this.condition, this.sampleValue);
	}
}<commit_msg>Small refactoring<commit_after>package com.lagodiuk.decisiontree;

public class Rule {

	private final String attribute;

	private final Predicate predicate;

	private final Object sampleValue;

	public Rule(String attribute, Predicate predicate, Object sampleValue) {
		this.attribute = attribute;
		this.predicate = predicate;
		this.sampleValue = sampleValue;
	}

	public boolean match(Item item) {
		if (!item.hasAttribute(this.attribute)) {
			return false;
		}
		Object otherField = item.getFieldValue(this.attribute);
		return this.predicate.eval(otherField, this.sampleValue);
	}

	public String getAttribute() {
		return this.attribute;
	}

	public Predicate getPredicate() {
		return this.predicate;
	}

	public Object getSampleValue() {
		return this.sampleValue;
	}

	@Override
	public String toString() {
		return String.format("%s %s %s", this.attribute, this.predicate, this.sampleValue);
	}
}
{'fraction_non_alphanumeric': 0.10110974106041924, 'fraction_numerical': 0.0, 'mean_word_length': 4.775800711743773, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '6265068', 'n_tokens_mistral': 515, 'n_tokens_neox': 472, 'n_words': 126}