public Bitmap GetCloud() { var words = wordsReader.Get(inputFile); var normalizedWords = wordsNormalizer.NormalizeWords(words, wordsReader.Get(boringWordsFile).Select(x => x.ToLower()).ToHashSet()); var wordsForCloud = wordsForCloudGenerator.Generate(normalizedWords); return(cloudDrawer.DrawCloud(wordsForCloud)); }
public void Create(string filePath, string targetPath, string imageName) { IFileReader reader; var fileExtension = Path.GetExtension(filePath).TrimStart('.'); if (!fileReaders.TryGetValue(fileExtension, out reader)) { throw new ArgumentException(); } var words = reader.ReadAllLines(filePath); words = FilterWords(words); var orderedWordsWithFonts = fontSizeCalculator.CalculateFontSize(words, fontFamily) .OrderByDescending(word => word.Font.Size).ToList(); cloudDrawer.DrawCloud(orderedWordsWithFonts, targetPath, imageName); }