Exemplo n.º 1
0
 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);
 }
Exemplo n.º 2
0
        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);
        }