<commit_before>﻿namespace Superscribe.Models
{
    using System;
    using System.ComponentModel;
    using System.Globalization;

    public abstract class ParamNode : SuperscribeNode
    {
        protected ParamNode()
        {
            this.ActionFunction = (data, segment) =>
            {
                object value;
                var success = this.TryParse(segment, out value);

                if (success)
                {
                    data.Parameters.Add(this.Name, value);
                }
                else
                {
                    data.ParamConversionError = true;
                }
            };
        }

        public abstract bool TryParse(string value, out object obj);

        public abstract Type Type { get; }

        public string Name { get; set; }
    }

    public abstract class ParamNode<T> : ParamNode
    {
        protected ParamNode(string name)
        {
            Name = name;
        }

        public override bool TryParse(string value, out object obj)
        {
            try
            {
                var tc = TypeDescriptor.GetConverter(this.Type);
                obj = tc.ConvertFromString(null, CultureInfo.InvariantCulture, value);
                return true;
            }<commit_msg>ParamNode<T> is no longer abstract<commit_after>﻿namespace Superscribe.Models
{
    using System;
    using System.ComponentModel;
    using System.Globalization;

    public abstract class ParamNode : SuperscribeNode
    {
        protected ParamNode()
        {
            this.ActionFunction = (data, segment) =>
            {
                object value;
                var success = this.TryParse(segment, out value);

                if (success)
                {
                    data.Parameters.Add(this.Name, value);
                }
                else
                {
                    data.ParamConversionError = true;
                }
            };
        }

        public abstract bool TryParse(string value, out object obj);

        public abstract Type Type { get; }

        public string Name { get; set; }
    }

    public class ParamNode<T> : ParamNode
    {
        protected ParamNode(string name)
        {
            Name = name;
        }

        public override bool TryParse(string value, out object obj)
        {
            try
            {
                var tc = TypeDescriptor.GetConverter(this.Type);
                obj = tc.ConvertFromString(null, CultureInfo.InvariantCulture, value);
                return true;
            }
{'fraction_non_alphanumeric': 0.07338017174082748, 'fraction_numerical': 0.0, 'mean_word_length': 1.3342440801457194, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 8, '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': '903293', 'n_tokens_mistral': 638, 'n_tokens_neox': 606, 'n_words': 159}