<commit_before>﻿namespace Hypermedia.Client.Reader.ProblemJson
{
    using System;
    using System.Net.Http;

    using global::Hypermedia.Client.Exceptions;
    using global::Hypermedia.Client.Resolver;

    using Newtonsoft.Json;

    public static class ProblemJsonReader
    {
        public static bool TryReadProblemJson(HttpResponseMessage result, out ProblemDescription problemDescription)
        {
            problemDescription = null;
            if (result.Content == null)
            {
                return false;
            }

            try
            {
                var content = result.Content.ReadAsStringAsync().Result;
                problemDescription = JsonConvert.DeserializeObject<ProblemDescription>(content); // TODO inject deserializer
            }
            catch (Exception)
            {
                return false;
            }
            return true;
        }
    }
}
<commit_msg>Fix TryReadProblemJson: ensure problem json could be read and an object was created<commit_after>﻿namespace Hypermedia.Client.Reader.ProblemJson
{
    using System;
    using System.Net.Http;

    using global::Hypermedia.Client.Exceptions;
    using global::Hypermedia.Client.Resolver;

    using Newtonsoft.Json;

    public static class ProblemJsonReader
    {
        public static bool TryReadProblemJson(HttpResponseMessage result, out ProblemDescription problemDescription)
        {
            problemDescription = null;
            if (result.Content == null)
            {
                return false;
            }

            try
            {
                var content = result.Content.ReadAsStringAsync().Result;
                problemDescription = JsonConvert.DeserializeObject<ProblemDescription>(content); // TODO inject deserializer
            }
            catch (Exception)
            {
                return false;
            }
            return problemDescription != null;
        }
    }
}

{'fraction_non_alphanumeric': 0.06901840490797546, 'fraction_numerical': 0.0, 'mean_word_length': 1.8486171761280932, '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': '4440891', 'n_tokens_mistral': 469, 'n_tokens_neox': 439, 'n_words': 105}