示例#1
0
        static void Main(string[] args)
        {
            //HailMary hailMary = new HailMary();
            //List<string> alternates = hailMary.LoadFromAlternatesFile("D:/alternates.csv", 16028369);
            //Row[] alternateAllData = alternates.Select(n => FileLibrary.ParseRow(n)).ToArray();

            // Load Data
            var lines = FileLibrary.GetLines();

            Row[] allData = lines.Skip(1).Where(l => l != ",,,,,,,,,,,,,,,,,,").Select(l => FileLibrary.ParseRow(l)).ToArray();

            List <Row> toProcess = new List <Row>();

            toProcess.AddRange(allData);
            //toProcess.AddRange(alternateAllData);

            allData = toProcess.ToArray();

            var realData = toProcess.Where(r => r.EnterpriseID >= 15374761).OrderBy(n => n.MRN).ToArray();

            // Clean Data
            Console.WriteLine("Cleaning Rows");
            DataCleaningManager.CleanData(ref allData, realData);
            Console.WriteLine("Done Cleaning Rows");

            // Load Data
            ClosedSets originalMatches = FileLibrary.LoadOriginalMatches(allData);
            ClosedSets newMatches      = FileLibrary.LoadOriginalMatches(allData); // create a copy to edit

            // Match Data
            MatchingManager matchingManager = new MatchingManager(_printErrors, _printActuals, _printLargeGroupValues);

            matchingManager.FindAllMatches(allData, ref newMatches);

            List <List <int> > finalSubmission = newMatches.ClosedRowSets();//hailMary.Collapse(newMatches.ClosedRowSets());

            FileLibrary.SaveFinalSubmission(finalSubmission, @"submission.csv");

            Console.ReadLine();
        }