<commit_before>﻿using System;
using System.Windows.Data;

namespace zvs.WPF.Converters
{
    public class NullableIntConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            if (value == null)
                return null;

            var strVal = value.ToString();

            if (string.IsNullOrEmpty(strVal))
                return null;
            else
            {            
                var v = 0;
                if (int.TryParse(strVal, out v))
                    return v;
                else
                    return null;
            }
        }

        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            return value.ToString();
        }
    }
}
<commit_msg>Code cleanup on null int converter<commit_after>﻿using System;
using System.Windows.Data;

namespace zvs.WPF.Converters
{
    public class NullableIntConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            if (value == null)
                return null;

            var strVal = value.ToString();

            if (string.IsNullOrEmpty(strVal))
                return null;
            int v;
            if (int.TryParse(strVal, out v))
                return v;
            return null;
        }

        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            return value.ToString();
        }
    }
}

{'fraction_non_alphanumeric': 0.0745742806811509, 'fraction_numerical': 0.0005871990604815032, 'mean_word_length': 1.6542056074766356, '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': '1073209', 'n_tokens_mistral': 431, 'n_tokens_neox': 414, 'n_words': 116}