namespace AIStudio.Tools.Services.Indexing;
///
/// One chunk as the chunking produced it, together with where it starts and where it ends.
///
///
/// The locations are carried rather than read back out of the chunk text. The runtime states them,
/// and the chunking knows which source segments a chunk covers, so nothing has to be derived from a
/// marker in the text — which is what used to leave Word files and continued passages without a
/// page.
///
/// The chunk itself, overlap prefix included.
/// Where the chunk's own content starts: its page, its sheet and row, or its line.
/// Where the chunk ends. Equal to the start when the chunk stays within one page, row or line.
/// Which attachment of a mail the chunk is from, counted from zero as the index numbers them, or null for the text of the mail itself and for anything but a mail.
internal sealed record EmbeddingChunk(string Text, SourceLocation Start, SourceLocation End, int? AttachmentPosition = null)
{
///
/// The page the chunk's own content starts on, or null when it has none.
///
public int? PageNumber => this.Start.PageNumber;
///
/// The page the chunk ends on, or null when it has none.
///
public int? EndPageNumber => this.End.PageNumber;
}