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); }
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); }