<commit_before>﻿using System;
using System.Collections.Generic;
using System.Text;
using JetBrains.Annotations;

namespace FreecraftCore.Serializer
{
	public interface INameBuildable
	{
		string BuildName();
	}

	internal sealed class GeneratedSerializerNameStringBuilder
	{
		public static INameBuildable Create([NotNull] Type serializableType)
		{
			if (serializableType == null) throw new ArgumentNullException(nameof(serializableType));

			return (INameBuildable) Activator.CreateInstance(typeof(GeneratedSerializerNameStringBuilder<>).MakeGenericType(serializableType));
		}
	}

	internal sealed class GeneratedSerializerNameStringBuilder<TSerializableType> : INameBuildable
	{
		public const string SERIALIZER_NAME = nameof(AutoGeneratedTemplateSerializerStrategy);

		public override string ToString()
		{
			return $"{ComputeName(typeof(TSerializableType))}_{SERIALIZER_NAME}";
		}

		public string BuildName()
		{
			return ToString();
		}

		private static string ComputeName(Type type)
		{
			if (type.IsGenericType)
			{
				string baseName = type.Name.Remove(type.Name.IndexOf('`'));
				StringBuilder builder = new StringBuilder(baseName);<commit_msg>Made SERIALIZER_NAME non-nameof<commit_after>﻿using System;
using System.Collections.Generic;
using System.Text;
using JetBrains.Annotations;

namespace FreecraftCore.Serializer
{
	public interface INameBuildable
	{
		string BuildName();
	}

	internal sealed class GeneratedSerializerNameStringBuilder
	{
		public static INameBuildable Create([NotNull] Type serializableType)
		{
			if (serializableType == null) throw new ArgumentNullException(nameof(serializableType));

			return (INameBuildable) Activator.CreateInstance(typeof(GeneratedSerializerNameStringBuilder<>).MakeGenericType(serializableType));
		}
	}

	internal sealed class GeneratedSerializerNameStringBuilder<TSerializableType> : INameBuildable
	{
		//Linked to autogenerated template type template. (Commented out usually)
		public const string SERIALIZER_NAME = "AutoGeneratedTemplateSerializerStrategy";

		public override string ToString()
		{
			return $"{ComputeName(typeof(TSerializableType))}_{SERIALIZER_NAME}";
		}

		public string BuildName()
		{
			return ToString();
		}

		private static string ComputeName(Type type)
		{
			if (type.IsGenericType)
			{
				string baseName = type.Name.Remove(type.Name.IndexOf('`'));
				StringBuilder builder = new StringBuilder(baseName);
{'fraction_non_alphanumeric': 0.08835672997522709, 'fraction_numerical': 0.0, 'mean_word_length': 5.922857142857143, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '423457', 'n_tokens_mistral': 754, 'n_tokens_neox': 672, 'n_words': 148}