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
OrdinalintThe chunk's position in the text it was cut from, counted from zero in reading order.
StartOffsetintWhere the chunk begins in the extracted text it was cut from.
TextstringThe passage itself.
ContentHashEmailChunkContentHashWhat identifies this text under the rules that produced it.
RuleSetVersionintThe version of the rules that produced it, copied so a backfill can select on it.
IsDerivedFromLossyHtmlboolWhether the text was inferred from markup rather than read from a plain-text part.
AttachmentEmailChunkAttachmentSourceThe 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.