private static void Main(string[] args) { var options = new ProgramOptions(); if (!Parser.Default.ParseArguments(args, options) || !options.IsValid()) { Console.WriteLine(HelpText.AutoBuild(options)); return; } Run(options); }
private static void Run(ProgramOptions programOptions) { var lines = TextGetterFromFile.GetTextLineByLine(programOptions.InputFile); var words = TextParser.GetWordsFromLines(lines); var prohibitedWords = TextParser.GetWordsFromLines(TextGetterFromFile.GetTextLineByLine(programOptions.ProhibitedWordsFile)); var filteredWords = SimpleWordFilter.GetFilteredWords(words, prohibitedWords); var wordModels = FrequencyWordCloudAlgorithm.GetWordModels(filteredWords, programOptions.MinFontSize, programOptions.MaxFontSize, programOptions.MaxAmountOfWords); var wordArrangeMethod = WordArrangeMethods[programOptions.ArrangeAlgorithm]; var visualiser = Visualisers[programOptions.VisualiseMethod]; var visualiseOptions = programOptions.ToVisualiseOptions(); visualiser(visualiseOptions, wordArrangeMethod, wordModels); }