<commit_before>package at.ac.tuwien.kr.alpha.common;

import at.ac.tuwien.kr.alpha.Util;
import at.ac.tuwien.kr.alpha.common.atoms.Literal;

import java.util.List;

/**
 * Represents a non-ground rule or a constraint for the semi-naive grounder.
 * Copyright (c) 2016, the Alpha Team.
 */
public class Rule {
	private final Head head;
	private final List<Literal> body;

	public Rule(Head head, List<Literal> body) {
		this.head = head;
		this.body = body;
<commit_msg>Removing duplicate literals from rule bodies.<commit_after>package at.ac.tuwien.kr.alpha.common;

import at.ac.tuwien.kr.alpha.Util;
import at.ac.tuwien.kr.alpha.common.atoms.Literal;

import java.util.ArrayList;
import java.util.LinkedHashSet;
import java.util.List;

/**
 * Represents a non-ground rule or a constraint for the semi-naive grounder.
 * Copyright (c) 2016, the Alpha Team.
 */
public class Rule {
	private final Head head;
	private final List<Literal> body;

	public Rule(Head head, List<Literal> body) {
		this.head = head;
		// Remove duplicate body literals.
		LinkedHashSet<Literal> bodyLiterals = new LinkedHashSet<>(body);
		this.body = new ArrayList<>(bodyLiterals);

{'fraction_non_alphanumeric': 0.11734253666954271, 'fraction_numerical': 0.006902502157031924, 'mean_word_length': 4.248868778280543, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 10, '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': '2763107', 'n_tokens_mistral': 401, 'n_tokens_neox': 384, 'n_words': 108}