<commit_before>using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Text;

namespace ERY.AgateLib.Geometry
{
    /// <summary>
    /// PointConverter.
    /// </summary>
    public class PointConverter : ExpandableObjectConverter
    {
        /// <summary>
        /// 
        /// </summary>
        /// <param name="context"></param>
        /// <param name="sourceType"></param>
        /// <returns></returns>
        public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType)
        {
            if (sourceType == typeof(string))
            {
                return true;
            }
            return base.CanConvertFrom(context, sourceType);
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="context"></param>
        /// <param name="culture"></param>
        /// <param name="value"></param>
        /// <returns></returns>
        public override object ConvertFrom(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value)
        {
            if (value is string)
            {
                string[] values = (value as string).Split(',');
                Point retval = new Point();

                if (values.Length > 2)
                    throw new Exception();

                for (int i = 0; i < values.Length; i++)
                {
                    if ((values[i].Contains("X") || values[i].Contains("x")) && values[i].Contains("="))
                    {
                        int equals = values[i].IndexOf('=');

                        retval.X = int.Parse(values[i].Substring(equals + 1));
                    }
                    else if ((values[i].Contains("Y") || values[i].Contains("y")) && values[i].Contains("="))
                    {
                        int equals = values[i].IndexOf('=');

                        retval.Y = int.Parse(values[i].Substring(equals + 1));
                    }
                }
                
                return retval;
            }
            return base.ConvertFrom(context, culture, value);
        }
    }
    /// <summary>
    /// 
    /// </summary>
    public class SizeConverter : ExpandableObjectConverter
    {
        /// <summary>
        /// 
        /// </summary>
        /// <param name="context"></param>
        /// <param name="sourceType"></param><commit_msg>Changed typeconverters to internal access.<commit_after>using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Text;

namespace ERY.AgateLib.Geometry
{
    /// <summary>
    /// PointConverter.
    /// </summary>
    class PointConverter : ExpandableObjectConverter
    {
        /// <summary>
        /// 
        /// </summary>
        /// <param name="context"></param>
        /// <param name="sourceType"></param>
        /// <returns></returns>
        public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType)
        {
            if (sourceType == typeof(string))
            {
                return true;
            }
            return base.CanConvertFrom(context, sourceType);
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="context"></param>
        /// <param name="culture"></param>
        /// <param name="value"></param>
        /// <returns></returns>
        public override object ConvertFrom(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value)
        {
            if (value is string)
            {
                string[] values = (value as string).Split(',');
                Point retval = new Point();

                if (values.Length > 2)
                    throw new Exception();

                for (int i = 0; i < values.Length; i++)
                {
                    if ((values[i].Contains("X") || values[i].Contains("x")) && values[i].Contains("="))
                    {
                        int equals = values[i].IndexOf('=');

                        retval.X = int.Parse(values[i].Substring(equals + 1));
                    }
                    else if ((values[i].Contains("Y") || values[i].Contains("y")) && values[i].Contains("="))
                    {
                        int equals = values[i].IndexOf('=');

                        retval.Y = int.Parse(values[i].Substring(equals + 1));
                    }
                }
                
                return retval;
            }
            return base.ConvertFrom(context, culture, value);
        }
    }
    /// <summary>
    /// 
    /// </summary>
    class SizeConverter : ExpandableObjectConverter
    {
        /// <summary>
        /// 
        /// </summary>
        /// <param name="context"></param>
        /// <param name="sourceType"></param>
{'fraction_non_alphanumeric': 0.1502376524075222, 'fraction_numerical': 0.0016532341392849763, 'mean_word_length': 1.3748773307163886, 'pattern_counts': {'":': 0, '<': 61, '<?xml version=': 0, '>': 61, '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': '2951170', 'n_tokens_mistral': 1235, 'n_tokens_neox': 1176, 'n_words': 245}