public WordCloudDrawer(WordPreprocessor wordPreprocessor, ILayoutCreator layoutCreator, BitmapSettings bitmapSettings, Func <WeightedWord, WordDescription> weightedWord2WordDescriptionMapper) { this.wordPreprocessor = wordPreprocessor; this.layoutCreator = layoutCreator; this.weightedWord2WordDescriptionMapper = weightedWord2WordDescriptionMapper; bitmap = new Bitmap(bitmapSettings.Size.Width, bitmapSettings.Size.Height); Graphics.FromImage(bitmap).Clear(bitmapSettings.BackgroundColor); }
public void Should_AttainDifferentWeight_ForWordsWithDifferentFrequency() { var reader = new ArrayReader(new[] { "a", "b", "a" }); var preprocessor = new WordPreprocessor( reader, new IPreprocessingRule[] { new LoweringRule() }); preprocessor .GetPreprocessedWordsFromFile("") .Select(weightedWord => weightedWord.Weight) .ToHashSet() .Count() .Should() .Be(2); }
internal static HandleRef getCPtr(WordPreprocessor obj) { return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr; }
internal static HandleRef getCPtr(WordPreprocessor obj) { return((obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr); }