<commit_before>﻿using System;
using System.Data;
namespace Implem.Libraries.Utilities
{
    public static class DataRows
    {
        public static bool Bool(this DataRow dataRow, string name)
        {
            return dataRow.Table.Columns.Contains(name)
                ? dataRow[name].ToBool()
                : false;
        }

        public static int Int(this DataRow dataRow, string name)
        {
            return dataRow.Table.Columns.Contains(name)
                ? dataRow[name].ToInt()
                : 0;
        }

        public static long Long(this DataRow dataRow, string name)
        {
            return dataRow.Table.Columns.Contains(name)
                ? dataRow[name].ToLong()
                : 0;
        }

        public static Decimal Decimal(this DataRow dataRow, string name)
        {
            return dataRow.Table.Columns.Contains(name)
                ? dataRow[name].ToDecimal()
                : 0;
        }

        public static DateTime DateTime(this DataRow dataRow, string name)
        {
            return dataRow.Table.Columns.Contains(name)
                ? dataRow[name].ToDateTime()
                : System.DateTime.MinValue;
        }

        public static string String(this DataRow dataRow, string name)
        {
            return dataRow.Table.Columns.Contains(name)
                ? dataRow.Field<string>(name) ?? string.Empty
                : string.Empty;
        }

        public static byte[] Bytes(this DataRow dataRow, string name)
        {
            return dataRow.Table.Columns.Contains(name)
                ? dataRow[name] is DBNull 
                    ? dataRow[name] as byte[]
                    : null
                : null;
        }
    }
}<commit_msg>Refactored: 型名の単純化。<commit_after>﻿using System;
using System.Data;
namespace Implem.Libraries.Utilities
{
    public static class DataRows
    {
        public static bool Bool(this DataRow dataRow, string name)
        {
            return dataRow.Table.Columns.Contains(name)
                ? dataRow[name].ToBool()
                : false;
        }

        public static int Int(this DataRow dataRow, string name)
        {
            return dataRow.Table.Columns.Contains(name)
                ? dataRow[name].ToInt()
                : 0;
        }

        public static long Long(this DataRow dataRow, string name)
        {
            return dataRow.Table.Columns.Contains(name)
                ? dataRow[name].ToLong()
                : 0;
        }

        public static decimal Decimal(this DataRow dataRow, string name)
        {
            return dataRow.Table.Columns.Contains(name)
                ? dataRow[name].ToDecimal()
                : 0;
        }

        public static DateTime DateTime(this DataRow dataRow, string name)
        {
            return dataRow.Table.Columns.Contains(name)
                ? dataRow[name].ToDateTime()
                : System.DateTime.MinValue;
        }

        public static string String(this DataRow dataRow, string name)
        {
            return dataRow.Table.Columns.Contains(name)
                ? dataRow.Field<string>(name) ?? string.Empty
                : string.Empty;
        }

        public static byte[] Bytes(this DataRow dataRow, string name)
        {
            return dataRow.Table.Columns.Contains(name)
                ? dataRow[name] is DBNull 
                    ? dataRow[name] as byte[]
                    : null
                : null;
        }
    }
}
{'fraction_non_alphanumeric': 0.08618721461187215, 'fraction_numerical': 0.0017123287671232876, 'mean_word_length': 1.4858156028368794, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '1994732', 'n_tokens_mistral': 949, 'n_tokens_neox': 893, 'n_words': 203}