Exemplo n.º 1
0
 public Result <Bitmap> Create(TagsCloudSettings settings)
 {
     return(wordReader.ReadAllWords(settings.WordsPath)
            .Then(HandleWords)
            .Then(WordCounter.Count)
            .Map(CreateTag)
            .Then(tags => tags.ToArray())
            .Then(painter.Colorize)
            .Then(visualizer.Visualize));
 }
Exemplo n.º 2
0
        public Image Create(TagsCloudSettings settings)
        {
            var words = processors.Aggregate(wordReader.ReadAllWords(settings.WordsPath),
                                             (current, processor) => processor.Process(current)).ToArray();
            var tags = WordCounter.Count(words)
                       .Select(word =>
            {
                var(font, size) = wordMeasurer.Measure(word);
                return(new Tag(word.Value, font, layouter.PutNextRectangle(size)));
            })
                       .ToArray();

            return(visualizer.Visualize(painter.Colorize(tags)));
        }