示例#1
0
 public static GenericOcrResponse Map(WindowsOcrResult ocrResult)
 {
     return(new GenericOcrResponse
     {
         SummaryText = ocrResult.Text,
         Language = ocrResult.Language,
         Detections = ocrResult.Lines.SelectMany(l => l.Words).Select(w => Get(w)).ToList()
     });
 }
示例#2
0
        public static WindowsOcrResult FromDynamic(dynamic ocrResult)
        {
            var result = new WindowsOcrResult();

            result.Lines = new List <OcrLine>();
            foreach (var line in ocrResult.Lines)
            {
                result.Lines.Add(OcrLine.FromDynamic(line));
            }
            result.Text = ocrResult.Text;

            return(result);
        }