Class TextExtractionElement
- Namespace
- LMKit.Extraction
- Assembly
- LM-Kit.NET.dll
Represents an element used in text extraction processes, encapsulating metadata such as name, type, description, and optional nested elements for complex data structures.
public sealed class TextExtractionElement
- Inheritance
-
TextExtractionElement
- Inherited Members
Examples
// A flat schema with a few primitives
var invoiceNo = new TextExtractionElement("InvoiceNumber", ElementType.String, "Human-readable invoice ID", isRequired: true);
var issueDate = new TextExtractionElement("IssueDate", ElementType.Date);
var total = new TextExtractionElement("Total", ElementType.Decimal);
// A nested object
var vendor = new TextExtractionElement(
"Vendor",
new[]
{
new TextExtractionElement("Name", ElementType.String),
new TextExtractionElement("Country", ElementType.String)
},
isArray: false,
description: "Supplier information");
// An array of objects
var lines = new TextExtractionElement(
"Lines",
new[]
{
new TextExtractionElement("Sku", ElementType.String),
new TextExtractionElement("Qty", ElementType.Integer),
new TextExtractionElement("Price", ElementType.Decimal)
},
isArray: true,
description: "Line items");
Remarks
The TextExtractionElement class is designed to model elements within a text extraction schema. It supports simple data types as well as complex types with nested elements, enabling the representation of hierarchical data models.
Constructors
- TextExtractionElement(string, ElementType, string, bool)
Initializes a new instance of the TextExtractionElement class representing a simple data element.
- 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.
Properties
- Description
Gets the descriptive text associated with the extraction element.
- ElementType
Gets the data type of the extraction element.
- Format
Gets the format settings applied to this extraction element.
- InnerElements
Gets a read-only list of nested TextExtractionElement instances if this element contains inner elements.
- IsArray
Gets a value indicating whether this element represents an array.
- IsArrayOfObject
Gets a value indicating whether this element represents an array of objects.
- IsObject
Gets a value indicating whether this element represents a complex object with nested elements.
- IsRequired
Gets or sets a value indicating whether this element must be present in the extracted output.
- Name
Gets the original name of the extraction element.