<commit_before>﻿using JUST.net.Selectables;
using Newtonsoft.Json.Linq;
using System;
using System.Collections;
using System.Linq;

namespace JUST
{
    internal class Transformer
    {
        protected static object TypedNumber(decimal number)
        {
            return number * 10 % 10 == 0 ? (object)Convert.ToInt32(number) : number;
        }

        internal static object GetValue(JToken selectedToken)
        {
            object output = null;
            if (selectedToken != null)
            {
                switch (selectedToken.Type)
                {
                    case JTokenType.Object:
                        output = selectedToken;
                        break;
                    case JTokenType.Array:
                        output = selectedToken.Values<object>().ToArray();
                        break;
                    case JTokenType.Integer:
                        output = selectedToken.ToObject<long>();
                        break;
                    case JTokenType.Float:
                        output = selectedToken.ToObject<double>();
                        break;
                    case JTokenType.String:
                        output = selectedToken.ToString();
                        break;
                    case JTokenType.Boolean:
                        output = selectedToken.ToObject<bool>();
                        break;
                    case JTokenType.Date:
                        DateTime value = selectedToken.Value<DateTime>();
                        output = value.ToString("yyyy-MM-ddTHH:mm:ssZ");
                        break;
                    case JTokenType.Raw:
                        break;
                    case JTokenType.Bytes:
                        output = selectedToken.Value<byte[]>();
                        break;
                    case JTokenType.Guid:
                        output = selectedToken.Value<Guid>();
                        break;
                    case JTokenType.TimeSpan:
                        output = selectedToken.Value<TimeSpan>();
                        break;
                    case JTokenType.Uri:
                    case JTokenType.Undefined:
                    case JTokenType.Constructor:
                    case JTokenType.Property:
                    case JTokenType.Comment:
                    case JTokenType.Null:<commit_msg>Date convertion to string with milliseconds and  timezone<commit_after>﻿using JUST.net.Selectables;
using Newtonsoft.Json.Linq;
using System;
using System.Collections;
using System.Linq;

namespace JUST
{
    internal class Transformer
    {
        protected static object TypedNumber(decimal number)
        {
            return number * 10 % 10 == 0 ? (object)Convert.ToInt32(number) : number;
        }

        internal static object GetValue(JToken selectedToken)
        {
            object output = null;
            if (selectedToken != null)
            {
                switch (selectedToken.Type)
                {
                    case JTokenType.Object:
                        output = selectedToken;
                        break;
                    case JTokenType.Array:
                        output = selectedToken.Values<object>().ToArray();
                        break;
                    case JTokenType.Integer:
                        output = selectedToken.ToObject<long>();
                        break;
                    case JTokenType.Float:
                        output = selectedToken.ToObject<double>();
                        break;
                    case JTokenType.String:
                        output = selectedToken.ToString();
                        break;
                    case JTokenType.Boolean:
                        output = selectedToken.ToObject<bool>();
                        break;
                    case JTokenType.Date:
                        DateTime value = selectedToken.Value<DateTime>();
                        output = value.ToString("yyyy-MM-ddTHH:mm:ss.fffK");
                        break;
                    case JTokenType.Raw:
                        break;
                    case JTokenType.Bytes:
                        output = selectedToken.Value<byte[]>();
                        break;
                    case JTokenType.Guid:
                        output = selectedToken.Value<Guid>();
                        break;
                    case JTokenType.TimeSpan:
                        output = selectedToken.Value<TimeSpan>();
                        break;
                    case JTokenType.Uri:
                    case JTokenType.Undefined:
                    case JTokenType.Constructor:
                    case JTokenType.Property:
                    case JTokenType.Comment:
                    case JTokenType.Null:
{'fraction_non_alphanumeric': 0.07101449275362319, 'fraction_numerical': 0.002898550724637681, 'mean_word_length': 1.0592497868712702, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 19, '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': '4475857', 'n_tokens_mistral': 1080, 'n_tokens_neox': 980, 'n_words': 222}