public TagCloudBuilder(IWordsReader reader, IAlgorithm algorithm, IImageWriter writer, IWordsFilter filter)
 {
     this.filter = filter;
     this.reader = reader;
     this.algorithm = algorithm;
     this.writer = writer;
 }
 public TagCloudBuilder(IWordsReader reader, IWordNormalizer normalizer, IWordFilter filter, IAlgorithm algorithm)
 {
     this.reader = reader;
     this.normalizer = normalizer;
     this.filter = filter;
     this.algorithm = algorithm;
 }
Example #3
0
 public TagsCloudGenerator(IWordsReader wordsReader, WordsNormalizer normalizer, ILayoutPainter layoutPainter, WordsLayouter wordsLayouter)
 {
     this.wordsReader   = wordsReader;
     this.normalizer    = normalizer;
     this.layoutPainter = layoutPainter;
     this.wordsLayouter = wordsLayouter;
 }
Example #4
0
        public WordsProcessorTests()
        {
            IWordsReader wordsReader = Substitute.For <IWordsReader>();
            var          words       = new Regex(@"\W+", RegexOptions.Compiled).Split("This is a test string. String which contains some words. String starts with some new words. Words made of words. Words containing words".ToLowerInvariant()).ToList();

            wordsReader.GetWords().Returns(words);
            _wordsProcessor = new WordsProcessor(wordsReader);
        }
Example #5
0
 public TagsCloudVisualizer(
     ITagsCloudCreator cloudCreator,
     IWordsReader reader,
     TagsCloudPictureHolder pictureHolder)
 {
     CloudCreator  = cloudCreator;
     Reader        = reader;
     PictureHolder = pictureHolder;
 }
Example #6
0
        public void OneTimeSetUp()
        {
            resourcesDir = TestContext.CurrentContext.TestDirectory + @"\..\..\Resources\fake\";

            ext1WordsReader = A.Fake <IWordsReader>();
            A.CallTo(() => ext1WordsReader.AllowedFileExtension).Returns(new Regex(@"\.ext1$"));

            ext2WordsReader = A.Fake <IWordsReader>();
            A.CallTo(() => ext2WordsReader.AllowedFileExtension).Returns(new Regex(@"\.ext2$"));

            generalWordsReader = new GeneralWordsReader(new[] { ext1WordsReader, ext2WordsReader });
        }
Example #7
0
 public TagCloudCreator(IWordsForCloudGenerator wordsForCloudGenerator,
                        IWordsReader wordsReader,
                        IWordsNormalizer wordsNormalizer,
                        ICloudDrawer cloudDrawer,
                        string inputFile,
                        string boringWordsFile)
 {
     this.wordsNormalizer        = wordsNormalizer;
     this.cloudDrawer            = cloudDrawer;
     this.wordsReader            = wordsReader;
     this.wordsForCloudGenerator = wordsForCloudGenerator;
     this.inputFile       = inputFile;
     this.boringWordsFile = boringWordsFile;
 }
Example #8
0
 public TagsCloudContainerApplication
     (IWordsReader reader, FormattingComponent formattingComponent,
     FilteringComponent filteringComponent, IWordsSizer wordsSizer, ITagsCloudRenderer renderer,
     IColorManager colorManager, IBoringWordsRepository boringWordsRepository,
     ITagsCloudFactory tagsCloudFactory, ITagsCloudLayouterFactory layouterFactory)
 {
     this.reader = reader;
     this.formattingComponent   = formattingComponent;
     this.filteringComponent    = filteringComponent;
     this.renderer              = renderer;
     this.colorManager          = colorManager;
     this.boringWordsRepository = boringWordsRepository;
     this.wordsSizer            = wordsSizer;
     this.tagsCloudFactory      = tagsCloudFactory;
     this.layouterFactory       = layouterFactory;
 }
Example #9
0
 public TagCloudCreatorFactory(IWordsForCloudGeneratorFactory wordsForCloudGeneratorFactory,
                               IColorGeneratorFactory colorGeneratorFactory,
                               ICloudDrawerFactory cloudDrawerFactory,
                               ITagCloudLayouterFactory tagCloudLayouteFactory,
                               IPointsFactory pointsFactory,
                               IWordsReader wordsReader,
                               IWordsNormalizer wordsNormalizer)
 {
     this.tagCloudLayouteFactory        = tagCloudLayouteFactory;
     this.wordsForCloudGeneratorFactory = wordsForCloudGeneratorFactory;
     this.colorGeneratorFactory         = colorGeneratorFactory;
     this.cloudDrawerFactory            = cloudDrawerFactory;
     this.pointsFactory   = pointsFactory;
     this.wordsNormalizer = wordsNormalizer;
     this.wordsReader     = wordsReader;
 }
Example #10
0
 public WordsRepository(IWordsReader wordsReader)
 {
     _wordsReader = wordsReader;
     _allWords    = wordsReader.GetAllWords();
 }
Example #11
0
 public WordsProcessor(IWordsReader reader)
 {
     _wordsReader = reader;
     BuildCollection(); //For simplicity loading data here otherwise another class would handle this
 }