Exemplo n.º 1
0
 public Result <Bitmap> GetTagCloudBitmap(Parameters parameters)
 {
     return(Result.Of(() => fileReader.ReadWords(parameters.InputFilePath))
            .RefineError("Failed to read input file")
            .Then(words => wordProcessor.ProcessWords(words))
            .RefineError("Failed to process words")
            .Then(processedWords => layoutAlgorithm.GetLayout(processedWords, parameters.ImageSize))
            .Then(layout =>
                  visualizer.GetLayoutBitmap(layout, parameters.Font, parameters.ImageSize, parameters.Colors))
            .RefineError("Failed to build layout"));
 }