public static void Main(string[] args) { if (!CheckArguments(args)) { return; } _path = ConfigurationManager.AppSettings["file-path"].ToString(); _dictionaryFile = ConfigurationManager.AppSettings["dictionary-file"].ToString(); _textFile = ConfigurationManager.AppSettings["text-file"].ToString(); if (!Initialize(_path, _dictionaryFile)) { return; } var result = _commandProcessor.ProcessCommand(args, arguments => InputTextController.ReadTextFromFile(arguments, File.ReadAllText), arguments => InputTextController.ReadTextFromFile(arguments, _loadWords) ); result.Print(Console.Out); Console.Write("Press ANY key to exit."); Console.ReadKey(); }
private static bool Initialize(string path, string dictionaryFile) { if (path == null) { Console.WriteLine($"Folder was not set up"); return(false); } if (path == null) { Console.WriteLine($"File with dictionary was not set up"); return(false); } if (!InputTextController.TryReadWords(Path.Combine(path, dictionaryFile), out string[] words))