Esempio n. 1
0
        public Bitmap GetTagCloud(string filepath)
        {
            var textReader           = FindTextReader(filepath);
            var words                = textReader.GetAllWords(filepath);
            var preprocessedWords    = preprocessor.PreprocessWords(words);
            var analyzedText         = statCounter.GetAnalyzedText(preprocessedWords);
            var analyzedLayoutedText = layouter.GetLayoutedText(analyzedText);
            var paintedWords         = painter.GetPaintedWords(analyzedLayoutedText);

            return(drawer.GetDrawnLayoutedWords(paintedWords));
        }
Esempio n. 2
0
        public void GetLayoutedWords_ReturnDifferentSizes_OnDifferentWordFrequency()
        {
            var wordLayouter   = new WordLayouter(new CloudLayouterConfiguration(() => cloudLayouter), sizeChooser);
            var previousHeight = -1;

            foreach (var layoutedWord in wordLayouter.GetLayoutedText(analyzedText).Words
                     .OrderBy(x => x.Position.Height))
            {
                layoutedWord.Position.Height.Should().BeGreaterThan(previousHeight);
                previousHeight = layoutedWord.Position.Height;
            }
        }