| | 1 | | // Copyright (c) Microsoft Corporation. All rights reserved. |
| | 2 | | // Licensed under the MIT License. |
| | 3 | |
|
| | 4 | | // <auto-generated/> |
| | 5 | |
|
| | 6 | | #nullable disable |
| | 7 | |
|
| | 8 | | using System; |
| | 9 | | using System.Collections.Generic; |
| | 10 | | using System.Linq; |
| | 11 | |
|
| | 12 | | namespace Azure.AI.FormRecognizer.Models |
| | 13 | | { |
| | 14 | | /// <summary> An object representing an extracted text line. </summary> |
| | 15 | | internal partial class TextLine |
| | 16 | | { |
| | 17 | | /// <summary> Initializes a new instance of TextLine. </summary> |
| | 18 | | /// <param name="text"> The text content of the line. </param> |
| | 19 | | /// <param name="boundingBox"> Bounding box of an extracted line. </param> |
| | 20 | | /// <param name="words"> List of words in the text line. </param> |
| | 21 | | /// <exception cref="ArgumentNullException"> <paramref name="text"/>, <paramref name="boundingBox"/>, or <paramr |
| 0 | 22 | | internal TextLine(string text, IEnumerable<float> boundingBox, IEnumerable<TextWord> words) |
| | 23 | | { |
| 0 | 24 | | if (text == null) |
| | 25 | | { |
| 0 | 26 | | throw new ArgumentNullException(nameof(text)); |
| | 27 | | } |
| 0 | 28 | | if (boundingBox == null) |
| | 29 | | { |
| 0 | 30 | | throw new ArgumentNullException(nameof(boundingBox)); |
| | 31 | | } |
| 0 | 32 | | if (words == null) |
| | 33 | | { |
| 0 | 34 | | throw new ArgumentNullException(nameof(words)); |
| | 35 | | } |
| | 36 | |
|
| 0 | 37 | | Text = text; |
| 0 | 38 | | BoundingBox = boundingBox.ToList(); |
| 0 | 39 | | Words = words.ToList(); |
| 0 | 40 | | } |
| | 41 | |
|
| | 42 | | /// <summary> Initializes a new instance of TextLine. </summary> |
| | 43 | | /// <param name="text"> The text content of the line. </param> |
| | 44 | | /// <param name="boundingBox"> Bounding box of an extracted line. </param> |
| | 45 | | /// <param name="language"> The detected language of this line, if different from the overall page language. </p |
| | 46 | | /// <param name="words"> List of words in the text line. </param> |
| 4936 | 47 | | internal TextLine(string text, IReadOnlyList<float> boundingBox, Language? language, IReadOnlyList<TextWord> wor |
| | 48 | | { |
| 4936 | 49 | | Text = text; |
| 4936 | 50 | | BoundingBox = boundingBox; |
| 4936 | 51 | | Language = language; |
| 4936 | 52 | | Words = words; |
| 4936 | 53 | | } |
| | 54 | |
|
| | 55 | | /// <summary> The text content of the line. </summary> |
| 4936 | 56 | | public string Text { get; } |
| | 57 | | /// <summary> Bounding box of an extracted line. </summary> |
| 4936 | 58 | | public IReadOnlyList<float> BoundingBox { get; } |
| | 59 | | /// <summary> The detected language of this line, if different from the overall page language. </summary> |
| 0 | 60 | | public Language? Language { get; } |
| | 61 | | /// <summary> List of words in the text line. </summary> |
| 10244 | 62 | | public IReadOnlyList<TextWord> Words { get; } |
| | 63 | | } |
| | 64 | | } |