using System.Collections.Generic;
using System.Linq;

namespace ZionExtractor
{
    public class Analyzer
    {
        public ZionVault.Binder.Output.Document Apply(ZionSchematics.Schematics schematics,
            ZionVault.Binder.OCR.Document document)
        {
            return new Controllers.Legwork().Match(schematics, document);
        }
        public ZionVault.Binder.Output.Page Apply(ZionSchematics.Schematics schematics,
            ZionVault.Binder.OCR.Page page)
        {
            return new Controllers.Legwork().Match(schematics, page);
        }
        public string Fetch(ZionVault.Binder.OCR.Page page, ZionVault.Basic.Location location)
        {
            List<Models.Hypothesis> hypoteses = Controllers.LegworkMethods.Position.Search(
                page,
                location);

            return hypoteses?.OrderByDescending(h => h.Value.Length).FirstOrDefault()?.Value;
        }
    }
}
