<commit_before>package es.um.nosql.schemainference.util.emf;

import java.util.List;
import java.util.stream.Collectors;

import es.um.nosql.schemainference.NoSQLSchema.Aggregate;
import es.um.nosql.schemainference.NoSQLSchema.Association;
import es.um.nosql.schemainference.NoSQLSchema.Attribute;
import es.um.nosql.schemainference.NoSQLSchema.Entity;
import es.um.nosql.schemainference.NoSQLSchema.EntityVersion;
import es.um.nosql.schemainference.NoSQLSchema.NoSQLSchema;
import es.um.nosql.schemainference.NoSQLSchema.PrimitiveType;
import es.um.nosql.schemainference.NoSQLSchema.Property;
import es.um.nosql.schemainference.NoSQLSchema.Reference;
import es.um.nosql.schemainference.NoSQLSchema.Tuple;
import es.um.nosql.schemainference.NoSQLSchema.Type;

public class NoSQLSchemaSerializer
{
	private static NoSQLSchemaSerializer instance;
	
	private static final String TAB = "\t";

	public static NoSQLSchemaSerializer getInstance()
	{
		if (instance == null)
			instance = new NoSQLSchemaSerializer();

		return instance;
	}

	public String serializePretty(NoSQLSchema theSchema)
	{
		if (theSchema == null)
			return null;

		StringBuilder result = new StringBuilder();

		result.append("NoSQLSchema name:" + theSchema.getName() + System.lineSeparator());

		for (Entity entity : theSchema.getEntities())
			result.append(serializePretty(entity, TAB));

		return result.toString();
	}

	public String SerializePretty(Entity entity)
	{
		return serializePretty(entity, "");<commit_msg>format<commit_after>package es.um.nosql.schemainference.util.emf;

import java.util.List;
import java.util.stream.Collectors;

import es.um.nosql.schemainference.NoSQLSchema.Aggregate;
import es.um.nosql.schemainference.NoSQLSchema.Association;
import es.um.nosql.schemainference.NoSQLSchema.Attribute;
import es.um.nosql.schemainference.NoSQLSchema.Entity;
import es.um.nosql.schemainference.NoSQLSchema.EntityVersion;
import es.um.nosql.schemainference.NoSQLSchema.NoSQLSchema;
import es.um.nosql.schemainference.NoSQLSchema.PrimitiveType;
import es.um.nosql.schemainference.NoSQLSchema.Property;
import es.um.nosql.schemainference.NoSQLSchema.Reference;
import es.um.nosql.schemainference.NoSQLSchema.Tuple;
import es.um.nosql.schemainference.NoSQLSchema.Type;

public class NoSQLSchemaSerializer
{
	private static NoSQLSchemaSerializer instance;
	
	private static final String TAB = "\t";

	public static NoSQLSchemaSerializer getInstance()
	{
		if (instance == null)
			instance = new NoSQLSchemaSerializer();

		return instance;
	}

	public String serializePretty(NoSQLSchema theSchema)
	{
		if (theSchema == null)
			return null;

		StringBuilder result = new StringBuilder();

		result.append("NoSQLSchema name:" + theSchema.getName()
			+ System.lineSeparator());

		for (Entity entity : theSchema.getEntities())
			result.append(serializePretty(entity, TAB));

		return result.toString();
	}

	public String SerializePretty(Entity entity)
	{
		return serializePretty(entity, "");
{'fraction_non_alphanumeric': 0.10462776659959759, 'fraction_numerical': 0.0, 'mean_word_length': 5.779545454545454, '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': '988166', 'n_tokens_mistral': 975, 'n_tokens_neox': 920, 'n_words': 168}