Esempio n. 1
0
        public void Save()
        {
            var words          = reader.Read(configuration.PathToWordsFile);
            var preparedWords  = preprocessor.PrepareWords(words);
            var wordsFrequency = wordsCounter.GetWordsFrequency(preparedWords);
            var tags           = tagsGenerator.GenerateTags(wordsFrequency);
            var image          = visualizer.Visualize(tags);

            imageWriter.Write(image, configuration.OutFileName, configuration.ImageFormat.ToString(), configuration.DirectoryToSave);
        }
Esempio n. 2
0
        public Result <None> Save()
        {
            var pathToSave = Path.Combine(configuration.DirectoryToSave,
                                          $"{configuration.OutFileName}.{configuration.ImageFormat}");

            return(reader.Read(configuration.PathToWordsFile)
                   .Then(words => preprocessor.PrepareWords(words))
                   .Then(preparedWords => wordsCounter.GetWordsFrequency(preparedWords))
                   .Then(wordsFrequency => tagsGenerator.GenerateTags(wordsFrequency))
                   .Then(tags => visualizer.Visualize(tags))
                   .Then(image => imageWriter.Write(
                             image, pathToSave)
                         .RefineError("Failed to save file")));
        }