Table of Contents

Method DeriveChunks

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

DeriveChunks(ExtractedEmailText, EmailChunkingRules, EmbeddingInputBound)

Cuts extracted text into chunks, in reading order, stopping at what one message may cost.

EmailChunkingResult DeriveChunks(ExtractedEmailText text, EmailChunkingRules rules, EmbeddingInputBound bound)

Parameters

text ExtractedEmailText

The text extraction derived from one message's body.

rules EmailChunkingRules

The boundaries to cut along.

bound EmbeddingInputBound

How much of the text to cut, beyond which the message's remainder yields no passage.

Returns

EmailChunkingResult

The chunks in reading order and what the ceiling left out, or an empty result when the message yielded no text to cut.

Remarks

The same text, the same rules, and the same bound produce the same chunks and the same hashes on every call, on any machine, and in any order, which is what lets a caller decide by hash alone whether anything downstream has to be re-done. The bound is a parameter rather than a member of the rules deliberately: the rules are covered by each chunk's content hash because they decide what a passage says, while the bound decides only how many passages there are and must not make an unchanged passage look like a different one.

Exceptions

ArgumentNullException

Thrown when any argument is null.