<commit_before>﻿namespace TeamElderberryProject
{
    using System.Collections.Generic;
    using System.IO;
    using System.Web.Script.Serialization;

    using TeamElderberryProject.Interfaces;

    public class ImportFromFile
    {
        public static ICollection<ITransaction> ImportData()
        {
            ICollection<ITransaction> dataList = new List<ITransaction>();

            StreamReader readData = new StreamReader(@"..\..\..\TextFiles\SaveData.txt");

            var readLine = readData.ReadLine();

            ITransaction data;

            data = CheckForType(dataList, readLine);

            while (readLine != null)
            {
                readLine = readData.ReadLine();

                data = CheckForType(dataList, readLine);

                dataList.Add(data);
            }

            return dataList;
        }

        private static ITransaction CheckForType(ICollection<ITransaction> dataList, string readLine)
        {
            ITransaction data;
            if (readLine.Contains("RegularIncome"))
            {
                data = new JavaScriptSerializer().Deserialize<RegularIncome>(readLine);<commit_msg>Fixed ImportFromFile<commit_after>﻿namespace TeamElderberryProject
{
    using System.Collections.Generic;
    using System.IO;
    using System.Web.Script.Serialization;

    using TeamElderberryProject.Interfaces;

    public class ImportFromFile
    {
        public static ICollection<ITransaction> ImportData()
        {
            ICollection<ITransaction> dataList = new List<ITransaction>();

            StreamReader readData = new StreamReader(@"..\..\..\..\..\..\TextFiles\SaveData.txt");

            var readLine = readData.ReadLine();

            ITransaction data;

            data = CheckForType(dataList, readLine);

            while (readLine != null)
            {
                readLine = readData.ReadLine();

                data = CheckForType(dataList, readLine);

                dataList.Add(data);
            }

            return dataList;
        }

        private static ITransaction CheckForType(ICollection<ITransaction> dataList, string readLine)
        {
            ITransaction data;
            if (readLine.Contains("RegularIncome"))
            {
                data = new JavaScriptSerializer().Deserialize<RegularIncome>(readLine);
{'fraction_non_alphanumeric': 0.09327086882453152, 'fraction_numerical': 0.0, 'mean_word_length': 2.054616384915475, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, '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': '1120836', 'n_tokens_mistral': 626, 'n_tokens_neox': 574, 'n_words': 116}