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
contentstringThe unstructured text content to process; cannot be
nullor 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
contentisnullor empty.
SetContent(Attachment)
Sets an image attachment to be processed for data extraction.
public void SetContent(Attachment content)
Parameters
contentAttachmentThe 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
contentisnull.
SetContent(ImageBuffer)
Sets the content for extraction from the specified image buffer.
public void SetContent(ImageBuffer content)
Parameters
contentImageBufferThe 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
contentisnull.
SetContent(IEnumerable<Attachment>)
Sets multiple image attachments to be processed for data extraction.
public void SetContent(IEnumerable<Attachment> content)
Parameters
contentIEnumerable<Attachment>An enumerable of Attachment representing the images to process; cannot be
nullor 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
contentisnullor contains no items.