Constructor TextExtractionElement
- Namespace
- LMKit.Extraction
- Assembly
- LM-Kit.NET.dll
TextExtractionElement(string, ElementType, string, bool)
Initializes a new instance of the TextExtractionElement class representing a simple data element.
public TextExtractionElement(string name, ElementType type, string description = "", bool isRequired = false)Parameters
- namestring
- The name of the extraction element; cannot be - null, empty, or whitespace.
- typeElementType
- The data type of the extraction element, specified by the ElementType enumeration. 
- descriptionstring
- An optional description providing additional context or information about the extraction element. Defaults to an empty string if omitted. 
- isRequiredbool
- A boolean indicating whether this element is mandatory in the output. 
Examples
var amount = new TextExtractionElement("Amount", ElementType.Decimal, "Grand total incl. taxes", isRequired: true);Exceptions
- ArgumentNullException
- Thrown if - nameis- null, empty, or consists only of whitespace.
TextExtractionElement(string, IEnumerable<TextExtractionElement>, bool, string, bool)
Initializes a new instance of the TextExtractionElement class representing a complex object or an array with nested elements.
public TextExtractionElement(string name, IEnumerable<TextExtractionElement> innerElements, bool isArray, string description = "", bool isRequired = false)Parameters
- namestring
- The name of the extraction element; cannot be - null, empty, or whitespace.
- innerElementsIEnumerable<TextExtractionElement>
- A collection of TextExtractionElement instances representing the nested elements within this extraction element. Cannot be - nullor empty.
- isArraybool
- A boolean value indicating whether this element represents an array of objects ( - true) or a single object (- false).
- descriptionstring
- An optional description providing additional context or information about the extraction element. Defaults to an empty string if omitted. 
- isRequiredbool
- A boolean indicating whether this element is mandatory in the output. 
Examples
var address = new TextExtractionElement(
    "Address",
    new[]
    {
        new TextExtractionElement("Street", ElementType.String),
        new TextExtractionElement("City", ElementType.String),
        new TextExtractionElement("PostalCode", ElementType.String)
    },
    isArray: false,
    description: "Shipping address");Exceptions
- ArgumentNullException
- Thrown if - nameis- null, empty, or consists only of whitespace. Or if- innerElementsis- nullor empty.