<commit_before>package fr.vergne.data;

import java.util.Date;

public class ConceptFactory {

	private final ConceptContainer container;
	private final Concept creator;
	private boolean decorationsActivated;

	public ConceptFactory(ConceptContainer container, Concept creator) {
		this.creator = creator;
		this.container = container;
	}

	public void setDecorationsActivated(boolean decorations) {
		this.decorationsActivated = decorations;
	}

	public boolean getDecorationsActivated() {
		return decorationsActivated;
	}

	private void initConcept(Concept concept) {
		container.addConcept(concept);
		if (getDecorationsActivated()) {
			ConceptFactory systemFactory = container.getSystemConceptFactory();
			boolean old = systemFactory.getDecorationsActivated();
			systemFactory.setDecorationsActivated(false);
			systemFactory.makeWasCreatedByRelation(concept, creator);
			systemFactory.makeWasCreatedOnRelation(concept, new Date());
			systemFactory.setDecorationsActivated(old);
		} else {
			// do not put decorations
		}
	}

	public Property makeProperty() {
		Property property = new Property();
		initConcept(property);
		return property;
	}

	public Property makeProperty(Object representation) {
		Property property = makeProperty();
		property.setRepresentation(representation);
		return property;
	}

	public Relation makeRelation(Concept start, Concept end) {
		Relation relation = new Relation();
		relation.setStart(start);
		relation.setEnd(end);
		initConcept(relation);
		return relation;
	}

	public Relation makeRelation(Concept start, Concept end,
			Object representation) {
		Relation relation = makeRelation(start, end);
		relation.setRepresentation(representation);
		return relation;
	}

	public Relation makeWasCreatedByRelation(Concept created, Concept creator) {
		Relation relation = makeRelation(created, creator);
		relation.setRepresentation("was created by");
		return relation;
	}

	public Relation makeWasCreatedOnRelation(Concept created, Date date) {
		Relation relation = makeRelation(created, makeProperty(date));
		relation.setRepresentation("was created on");
		return relation;
	}

	public Relation makeIsInstanceOfRelation(Concept instance, Concept type) {
		Relation relation = makeRelation(instance, type);
		relation.setRepresentation("is instance of");
		return relation;
	}
}
<commit_msg>Simplify methods.<commit_after>package fr.vergne.data;

import java.util.Date;

public class ConceptFactory {

	private final ConceptContainer container;
	private final Concept creator;
	private boolean decorationsActivated;

	public ConceptFactory(ConceptContainer container, Concept creator) {
		this.creator = creator;
		this.container = container;
	}

	public void setDecorationsActivated(boolean decorations) {
		this.decorationsActivated = decorations;
	}

	public boolean getDecorationsActivated() {
		return decorationsActivated;
	}

	private void initConcept(Concept concept) {
		container.addConcept(concept);
		if (getDecorationsActivated()) {
			ConceptFactory systemFactory = container.getSystemConceptFactory();
			boolean old = systemFactory.getDecorationsActivated();
			systemFactory.setDecorationsActivated(false);
			systemFactory.makeWasCreatedByRelation(concept, creator);
			systemFactory.makeWasCreatedOnRelation(concept, new Date());
			systemFactory.setDecorationsActivated(old);
		} else {
			// do not put decorations
		}
	}

	public Property makeProperty() {
		Property property = new Property();
		initConcept(property);
		return property;
	}

	public Property makeProperty(Object representation) {
		Property property = makeProperty();
		property.setRepresentation(representation);
		return property;
	}

	public Relation makeRelation(Concept start, Concept end) {
		Relation relation = new Relation();
		relation.setStart(start);
		relation.setEnd(end);
		initConcept(relation);
		return relation;
	}

	public Relation makeRelation(Concept start, Concept end,
			Object representation) {
		Relation relation = makeRelation(start, end);
		relation.setRepresentation(representation);
		return relation;
	}

	public Relation makeWasCreatedByRelation(Concept created, Concept creator) {
		return makeRelation(created, creator, "was created by");
	}

	public Relation makeWasCreatedOnRelation(Concept created, Date date) {
		return makeRelation(created, makeProperty(date), "was created on");
	}

	public Relation makeIsInstanceOfRelation(Concept instance, Concept type) {
		return makeRelation(instance, type, "is instance of");
	}
}

{'fraction_non_alphanumeric': 0.08570159857904085, 'fraction_numerical': 0.0, 'mean_word_length': 5.723880597014926, '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': '5997601', 'n_tokens_mistral': 1387, 'n_tokens_neox': 1234, 'n_words': 308}