<commit_before>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ecologylab.serialization.types.scalar
{
    /// <summary>
    ///     Class to hold the mappings of different datatypes 
    ///     supported by the serialization framework. This objects 
    ///     returns the right abstraction for the supported types. 
    /// </summary>
    public class TypeRegistry
    {
        /// <summary>
        ///     Maps to hold the Type with their right abstraction
        /// </summary>
        private static Dictionary<String, ScalarType> allTypes = new Dictionary<String, ScalarType>();

        /// <summary>
        ///     Array of supported types
        /// </summary>
        static Type[] BASIC_TYPES = 
        {
            typeof(StringType), 
            typeof(DoubleType), 
            typeof(IntType),
            typeof(FloatType),
            typeof(LongType),
            typeof(UriType),
            typeof(BooleanType),
            typeof(ScalarTypeType),
            typeof(EnumeratedType),
            typeof(RegexType)
        };

        /// <summary>
        ///     Static constructor register basic types 
        /// </summary>
        static TypeRegistry()
        {
            Register(BASIC_TYPES);
        }

        /// <summary>
        ///     Maps basic types 
        /// </summary>
        /// <param name="basicTypes"></param>
        private static void Register(Type[] basicTypes)
        {
            for (int i = 0; i < basicTypes.Length; i++)
            {
                Register(basicTypes[i]);
            }
        }

        /// <summary>
        ///     Maps basic types with their simple and type names. 
        /// </summary>
        /// <param name="thatClass"></param>
        private static void Register(Type thatClass)
        {<commit_msg>Expose TypeRegistry Register methods<commit_after>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ecologylab.serialization.types.scalar
{
    /// <summary>
    ///     Class to hold the mappings of different datatypes 
    ///     supported by the serialization framework. This objects 
    ///     returns the right abstraction for the supported types. 
    /// </summary>
    public class TypeRegistry
    {
        /// <summary>
        ///     Maps to hold the Type with their right abstraction
        /// </summary>
        private static Dictionary<String, ScalarType> allTypes = new Dictionary<String, ScalarType>();

        /// <summary>
        ///     Array of supported types
        /// </summary>
        static Type[] BASIC_TYPES = 
        {
            typeof(StringType), 
            typeof(DoubleType), 
            typeof(IntType),
            typeof(FloatType),
            typeof(LongType),
            typeof(UriType),
            typeof(BooleanType),
            typeof(ScalarTypeType),
            typeof(EnumeratedType),
            typeof(RegexType)
        };

        /// <summary>
        ///     Static constructor register basic types 
        /// </summary>
        static TypeRegistry()
        {
            Register(BASIC_TYPES);
        }

        /// <summary>
        ///     Maps basic types 
        /// </summary>
        /// <param name="basicTypes"></param>
        public static void Register(Type[] basicTypes)
        {
            for (int i = 0; i < basicTypes.Length; i++)
            {
                Register(basicTypes[i]);
            }
        }

        /// <summary>
        ///     Maps basic types with their simple and type names. 
        /// </summary>
        /// <param name="thatClass"></param>
        public static void Register(Type thatClass)
        {
{'fraction_non_alphanumeric': 0.11215454789374832, 'fraction_numerical': 0.0005366246310705661, 'mean_word_length': 1.5291723202170964, 'pattern_counts': {'":': 0, '<': 41, '<?xml version=': 0, '>': 39, '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': '5775754', 'n_tokens_mistral': 942, 'n_tokens_neox': 909, 'n_words': 251}