Пример #1
0
 static void AnalyzeFiles(TextStatistician statistician, IEnumerable <string> filePaths)
 {
     foreach (var filePath in filePaths)
     {
         DoAndPrintTime(() => statistician.AnalyzeFile(filePath),
                        $"Analyze: {filePath}");
     }
 }
Пример #2
0
 public static void AnalyzeFilesSeparately(IEnumerable <string> filePaths, string outputDir = null)
 {
     foreach (var filePath in filePaths)
     {
         var fileInfo     = new FileInfo(filePath);
         var outFilePath  = $"{outputDir ?? fileInfo.DirectoryName}/{fileInfo.Name}_stat.csv";
         var statistician = new TextStatistician();
         DoAndPrintTime(() =>
         {
             statistician.AnalyzeFile(filePath);
             statistician.RemoveLowFrequency((int)(statistician.Total * MinRate));
             statistician.Save(outFilePath);
         }, $"Analyze: {filePath}");
     }
 }