Ejemplo n.º 1
0
        public TagCloud(IReader reader, IParser parser, IWordFiltersSequence filters, IAlgorithm algorithm)
        {
            var text = reader.GetContent();
            var separatedWords = parser.SplitIntoWords(text);
            var filteredWords = filters.ApplyTo(separatedWords);

            var frequencyWords = filteredWords
                .GroupBy(x => x)
                .Select(x => new FrequencyWord(x.Key, x.Count()))
                .ToImmutableList();

            Words = algorithm.CreateCloudWords(frequencyWords);
        }