<commit_before>﻿using PPTail.Entities;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Xml.Linq;

namespace PPTail.Data.FileSystem
{
    public static class StringExtensions
    {
        public static ContentItem ParseContentItem(this string xmlText, string nodeLocalName)
        {
            ContentItem result = null;

            XElement node;
            try
            {
                node = XElement.Parse(xmlText);
            }
            catch (System.Xml.XmlException)
            {
                node = null;
            }

            if (node != null && node.Name.LocalName == nodeLocalName)
            {
                string author = node.GetElementValue("author");

                // DateTime publicationDate = DateTime.MinValue;
                // DateTime.TryParse(node.GetElementValue("pubDate"), out publicationDate);

                result = new ContentItem()
                {
                    //IsPublished = Convert.ToBoolean(node.GetElementValue("ispublished")),
                    Title = node.GetElementValue("title"),
                    Description = node.GetElementValue("description"),
                    //Content = node.GetElementValue("content"),
                    //Slug = node.GetElementValue("slug"),
                    Author = author
                    //PublicationDate = publicationDate,
                    //ByLine = string.IsNullOrEmpty(author) ? string.Empty : $"by {author}"
                };
            }

            return result;
        }
    }
}<commit_msg>ReturnTheProperValueInTheContentField - Green<commit_after>﻿using PPTail.Entities;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Xml.Linq;

namespace PPTail.Data.FileSystem
{
    public static class StringExtensions
    {
        public static ContentItem ParseContentItem(this string xmlText, string nodeLocalName)
        {
            ContentItem result = null;

            XElement node;
            try
            {
                node = XElement.Parse(xmlText);
            }
            catch (System.Xml.XmlException)
            {
                node = null;
            }

            if (node != null && node.Name.LocalName == nodeLocalName)
            {
                string author = node.GetElementValue("author");

                // DateTime publicationDate = DateTime.MinValue;
                // DateTime.TryParse(node.GetElementValue("pubDate"), out publicationDate);

                result = new ContentItem()
                {
                    //IsPublished = Convert.ToBoolean(node.GetElementValue("ispublished")),
                    Title = node.GetElementValue("title"),
                    Description = node.GetElementValue("description"),
                    Content = node.GetElementValue("content"),
                    //Slug = node.GetElementValue("slug"),
                    Author = author
                    //PublicationDate = publicationDate,
                    //ByLine = string.IsNullOrEmpty(author) ? string.Empty : $"by {author}"
                };
            }

            return result;
        }
    }
}
{'fraction_non_alphanumeric': 0.0946617008069522, 'fraction_numerical': 0.0, 'mean_word_length': 1.5742811501597445, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 4}, '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': '2767324', 'n_tokens_mistral': 782, 'n_tokens_neox': 748, 'n_words': 153}