예제 #1
0
        private static ResultsValue CreateResultsValue(int wordIndex, Document document, string value = null)
        {
            var word           = document.Pages[0].Sections.SelectMany(s => s.WordGroups).SelectMany(w => w.Words).ToArray()[wordIndex];
            var wordValueToken = new ResultsValueTokens(word.IndexInText, word.Text.Length, 0, (float)document.Pages[0].Size.Width, (float)document.Pages[0].Size.Height, new[] { word.Box });
            var reference      = new ResultsContentReference(word.IndexInText, word.Text.Length, new[] { wordValueToken });

            return(new ResultsValue(value ?? word.Text, reference, 0.9f, word.OcrConfidence));
        }
예제 #2
0
        private static ResultsDataPoint CreateBooleanFieldDataPoint(Field firstBooleanField, Document document)
        {
            var booleanToken      = new ResultsValueTokens(0, (float)document.Pages[0].Size.Width, (float)document.Pages[0].Size.Height, new[] { Box.CreateChecked(50, 100, 200, 300) });
            var reference         = new ResultsContentReference(0, 0, new[] { booleanToken });
            var firstBooleanValue = new ResultsValue("Yes", reference, 0.9f, 1f);

            return(new ResultsDataPoint(
                       firstBooleanField.FieldId,
                       firstBooleanField.FieldName,
                       firstBooleanField.Type,
                       new[] { firstBooleanValue }));
        }