Table of Contents

Method SetContent

Namespace
LMKit.Extraction
Assembly
LM-Kit.NET.dll

SetContent(string)

Sets the text content from which the elements will be extracted.

public void SetContent(string content)

Parameters

content string

The unstructured text content to process; cannot be null or empty.

Examples

// Set the content to extract data from
textExtraction.SetContent("John Doe, aged 30, lives at 123 Main St, Anytown, 12345.");

Exceptions

ArgumentException

Thrown if content is null or empty.

SetContent(Attachment)

Sets an image attachment to be processed for data extraction.

public void SetContent(Attachment content)

Parameters

content Attachment

The Attachment representing the image to process; cannot be null.

Examples

// Create an attachment from an image file
Attachment imageAttachment = new Attachment("path/to/image.png");

// Set the image content to extract data from
textExtraction.SetContent(imageAttachment);

Exceptions

ArgumentException

Thrown if content is null.

SetContent(ImageBuffer)

Sets the content for extraction from the specified image buffer.

public void SetContent(ImageBuffer content)

Parameters

content ImageBuffer

The ImageBuffer representing the image to process; cannot be null.

Examples

// Load an image into an ImageBuffer
ImageBuffer buffer = ImageLoader.Load("path/to/image.png");

// Set the image content to extract data from
textExtraction.SetContent(buffer);

Exceptions

ArgumentNullException

Thrown if content is null.

SetContent(IEnumerable<Attachment>)

Sets multiple image attachments to be processed for data extraction.

public void SetContent(IEnumerable<Attachment> content)

Parameters

content IEnumerable<Attachment>

An enumerable of Attachment representing the images to process; cannot be null or empty.

Examples

// Create multiple attachments from image files
IEnumerable<Attachment> imageAttachments = new List<Attachment>
{
    new Attachment("path/to/image1.png"),
    new Attachment("path/to/image2.jpg")
};

// Set the image contents to extract data from
textExtraction.SetContent(imageAttachments);

Exceptions

ArgumentException

Thrown if content is null or contains no items.