< Summary

Class:Azure.AI.FormRecognizer.Models.FormLine
Assembly:Azure.AI.FormRecognizer
File(s):C:\Git\azure-sdk-for-net\sdk\formrecognizer\Azure.AI.FormRecognizer\src\FormLine.cs
Covered lines:8
Uncovered lines:0
Coverable lines:8
Total lines:36
Line coverage:100% (8 of 8)
Covered branches:2
Total branches:2
Branch coverage:100% (2 of 2)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-100%100%
get_Words()-100%100%
ConvertWords(...)-100%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\formrecognizer\Azure.AI.FormRecognizer\src\FormLine.cs

#LineLine coverage
 1// Copyright (c) Microsoft Corporation. All rights reserved.
 2// Licensed under the MIT License.
 3
 4using System.Collections.Generic;
 5
 6namespace Azure.AI.FormRecognizer.Models
 7{
 8    /// <summary>
 9    /// Represents a line of text recognized from the input document.
 10    /// </summary>
 11    public class FormLine : FormElement
 12    {
 13        internal FormLine(TextLine textLine, int pageNumber)
 493614            : base(new BoundingBox(textLine.BoundingBox), pageNumber, textLine.Text)
 15        {
 493616            Words = ConvertWords(textLine.Words, pageNumber);
 493617        }
 18
 19        /// <summary>
 20        /// A list of the words that make up the line.
 21        /// </summary>
 1400422        public IReadOnlyList<FormWord> Words { get; }
 23
 24        private static IReadOnlyList<FormWord> ConvertWords(IReadOnlyList<TextWord> textWords, int pageNumber)
 25        {
 493626            List<FormWord> rawWords = new List<FormWord>();
 27
 3107228            foreach (TextWord textWord in textWords)
 29            {
 1060030                rawWords.Add(new FormWord(textWord, pageNumber));
 31            }
 32
 493633            return rawWords;
 34        }
 35    }
 36}