예제 #1
0
파일: ConsoleUI.cs 프로젝트: lgnv/di
        private void Run(Options options)
        {
            var boringWords = FormBoringWords(options.FileWithBoringWords);

            filter.UserExcludedWords = boringWords;
            var words = FormWordsFromFile(options.InputFile)
                        .MostCommon(30)
                        .Select(kvp => kvp.Item1)
                        .ToArray();

            var tags   = FormTags(words, options.FontName);
            var bitmap = tagCloudImageCreator.Build(options.FontName, tags, layoutAlgorithm.GetLayoutSize());

            imageSaver.Save(options.OutputFile, bitmap, options.ImageFormat);
        }
예제 #2
0
파일: ApplicationCore.cs 프로젝트: lgnv/fp
        public void Run(Options options)
        {
            FormBoringWords(options.FileWithBoringWords, readerFinder, filter)
            .Then(words => filter.UserExcludedWords = words)
            .OnFail(HandleError);
            var rightWords = FormWords(options.InputFile, readerFinder, filter)
                             .Then(words => words.MostCommon(30)
                                   .Select(kvp => kvp.Element)
                                   .ToArray())
                             .OnFail(HandleError);

            GetBaseFont(options.FontName)
            .Then(font => FormTags(rightWords.Value, font))
            .Then(tags => tagCloudImageBuilder.Build(tags, layoutAlgorithm.GetLayoutSize()))
            .Then(bitmap => imageSaver.Save(options.OutputFile, bitmap, options.ImageFormat))
            .OnFail(HandleError);
        }