コード例 #1
0
        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);
        }
コード例 #2
0
        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);
        }
コード例 #3
0
 internal static HandleRef getCPtr(WordPreprocessor obj) {
   return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
 }
コード例 #4
0
 internal static HandleRef getCPtr(WordPreprocessor obj)
 {
     return((obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr);
 }