static void Main(string[] args) { InitUserParams(args); Dictionary <string, HashSet <int> > words = new Dictionary <string, HashSet <int> >(StringComparer.Ordinal); var ioFactory = new IOFactory(); var started = DateTime.Now; List <string> lines = GetInputLines(ioFactory); Console.WriteLine("\nData read finished in {0} ms\n\n", (DateTime.Now - started).TotalMilliseconds); started = DateTime.Now; FillWordsChart(lines, words); Console.WriteLine("\nWords parsing finished in {0} ms\n\n", (DateTime.Now - started).TotalMilliseconds); started = DateTime.Now; OutputResults(ioFactory, words); Console.WriteLine("\nData write finished in {0} ms\n\n", (DateTime.Now - started).TotalMilliseconds); Console.WriteLine("\n\nPress any key to quit..."); Console.ReadKey(); }
private static void OutputResults(IOFactory factory, Dictionary <string, HashSet <int> > data) { factory.GetOutputProvider(output).OutputData(data, outputFileName); }
private static List <string> GetInputLines(IOFactory factory) { return(factory.GetInputParser(input).GetData(inputFileName)); }