Table of Contents

Constructor EmailTextChunk

Namespace
MailFathom.Application.Emails.Chunking
Assembly
MailFathom.Application.dll

EmailTextChunk(int, int, string, EmailChunkContentHash, int, bool, EmailChunkAttachmentSource?)

One retrievable passage of a message, and the span of the extracted text it was cut from.

public EmailTextChunk(int Ordinal, int StartOffset, string Text, EmailChunkContentHash ContentHash, int RuleSetVersion, bool IsDerivedFromLossyHtml, EmailChunkAttachmentSource? Attachment = null)

Parameters

Ordinal int

The chunk's position in the text it was cut from, counted from zero in reading order.

StartOffset int

Where the chunk begins in the extracted text it was cut from.

Text string

The passage itself.

ContentHash EmailChunkContentHash

What identifies this text under the rules that produced it.

RuleSetVersion int

The version of the rules that produced it, copied so a backfill can select on it.

IsDerivedFromLossyHtml bool

Whether the text was inferred from markup rather than read from a plain-text part.

Attachment EmailChunkAttachmentSource

The attachment this passage is a span of, or null when it is a span of the message body. It is what makes StartOffset mean something: the offsets index one text, and a message with attachments has several, so the ordinals and offsets of one attachment's passages run alongside the body's rather than after them.

Remarks

A chunk names its own span rather than only the message it belongs to, so a later citation can point at the passage that answered a question instead of at the whole message. StartOffset and the length of Text index the reading of the body named by the rules' source form, which makes the span verifiable: the same offsets applied to the same extracted text return exactly this text.

The remaining source coordinates a chunk could carry — the account, the folder, the sender, the recipients, the date, and the subject — are the stored email's own columns and are reached through the message a persisted chunk hangs on. They are deliberately not copied here: every one of them is mail content or personal data, and a second copy would widen the access, export, and erasure surface without answering a question the message cannot already answer.

A chunk's text is mail content. Nothing here may be written to a log, a metric, a trace, or an error message; the ordinal, the offsets, and the length are the only members safe to report.