namespace Ocr.Report.Models;

public readonly struct ImageStats
{
  public string ImageName { get; }

  public ICollection<string> Reference { get; }

  public ICollection<ProcessorStat> Processors { get; }

  public ImageStats(
    string imageName,
    ICollection<string> taggedWords,
    IEnumerable<ScanFileInfo> scanResult
  )
  {
    Reference = taggedWords;
    ImageName = imageName;
    Processors = scanResult
      .Select(t =>
      {
        var (elapsed, words) = t.GetData();
        return new ProcessorStat(t.ProcessorName, elapsed, taggedWords, words);
      })
      .ToArray();
  }
}
