Table of Contents

Class DataSource

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

Represents a repository for various data sources, encapsulating the content from diverse sources such as documents, web pages, and other data-rich environments. This class provides a unified interface to interact with different types of data in a consistent manner.

public sealed class DataSource : ISerializableData
Inheritance
DataSource
Implements
Inherited Members

Remarks

In LMKit, the hierarchy of data structures is organized as follows: a DataSource contains a collection of Section objects, each of which can hold a collection of TextPartition instances.

Properties

Identifier

Gets the unique identifier for this instance.

Metadata

Gets the metadata associated with this instance.

Sections

Gets a read-only collection of sections that make up this instance.

Methods

Clone()

Creates a deep clone of this DataSource instance.

Deserialize(byte[], LM)

Deserializes the given binary data into a DataSource instance using the specified model for context.

Deserialize(Stream, LM)

Deserializes a DataSource from a stream using the provided model for context.

Deserialize(string, LM)

Deserializes the binary data from the specified file path into a DataSource instance using the provided model for context.

GetSectionByIdentifier(string)

Retrieves a Section object from this instance based on the specified identifier.

RemoveSection(Section)

Removes the specified Section from this DataSource.

RemoveSection(string)

Removes the section identified by the specified identifier from this DataSource.

Serialize()

Serializes this instance into a binary format and returns the resulting data as a byte array.

Serialize(Stream)

Serializes this instance into a binary format and writes it to the specified stream.

Serialize(string)

Serializes this instance into a binary format and writes it to the specified file path.