Example #1
0
 public Result <IEnumerable <string> > ProcessWords(IEnumerable <string> words)
 {
     return(wordConverter.ConvertWords(words)
            .RefineError("Failed to convert words")
            .Then(convertedWords => wordFilter.FilterWords(convertedWords))
            .RefineError("Failed to filter words"));
 }
Example #2
0
 public IEnumerable <WeightedWord> WeightWords(IWordReader reader)
 {
     return(_filter
            .FilterWords(reader)
            .GroupBy(word => word)
            .Select(group => new WeightedWord(group.Key, group.Count()))
            .OrderByDescending(weightedWord => weightedWord.Weight)
            .ToList());
 }
Example #3
0
        public void Run()
        {
            var words = wordReader
                        .ReadToEnd(pathToWords);
            var filteredWords = wordFilter
                                .FilterWords(words);
            var tags = tagReader
                       .ReadTags(filteredWords)
                       .OrderByDescending(item => item.FontSize)
                       .ToList();

            using (var picture = visualizer.CreatePictureWithItems(tags))
            {
                if (File.Exists(pathToPicture))
                {
                    File.Delete(pathToPicture);
                }
                picture.Save(pathToPicture, format);
            }
        }