using Ocr.Tesseract.Models;
using Process.Abstract;
using System.Collections.Generic;

namespace Ocr.Tesseract;

/// <summary>
/// Converts the <see cref="Word.Text"/> strings to lowercase
/// </summary>
public class ToLowerProcessor
  : Processor<ScanResult, ScanResult>
{
  /// <inheritdoc />
  public override IEnumerable<ScanResult> Process(
    IEnumerable<ScanResult> inputs
  )
  {
    foreach (var kv in inputs)
    {
      kv.Word.Text = kv.Word.Text.ToLower();
      yield return kv;
    }
  }
}
