Example #1
0
        private static void Main(string[] args)
        {
            if (args.Length != 2)
            {
                Console.WriteLine("Incorrect command line parameters.");
            }
            else
            {
                try
                {
                    var allLinesFromText = File.ReadAllLines(args[0]);
                    var allLinesFromQueries = File.ReadAllLines(args[1]);

                    var textParser = new TextParser(allLinesFromText);
                    textParser.ParseText();

                    var queries = new Queries(allLinesFromQueries, textParser);
                    queries.ProcessAllRequests();
                    queries.AllReplies.Print();
                }
                catch (FileNotFoundException exception)
                {
                    Console.WriteLine(exception.Message);
                }
            }
        }
Example #2
0
 public Queries(IEnumerable<string> allQueries, TextParser parser)
 {
     _allQueries = allQueries.Select(e => e.ToLower()).ToArray();
     _parser = parser;
 }