Table of Contents

Method Create

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

Create(int, int, int, int, IReadOnlyList<string>, EmailChunkSourceForm)

Builds a rule set, refusing one that could not cut text into chunks that make progress.

public static EmailChunkingRules Create(int ruleSetVersion, int targetCharacterCount, int minimumCharacterCount, int overlapCharacterCount, IReadOnlyList<string> boundarySeparators, EmailChunkSourceForm sourceForm)

Parameters

ruleSetVersion int

The version these rules are recorded under.

targetCharacterCount int

The greatest number of characters one chunk may hold.

minimumCharacterCount int

The length a chunk must reach before a separator may end it.

overlapCharacterCount int

How far back into the previous chunk the next one starts.

boundarySeparators IReadOnlyList<string>

The separators to break after, from the strongest to the weakest.

sourceForm EmailChunkSourceForm

Which reading of the message body to cut from.

Returns

EmailChunkingRules

The rule set.

Exceptions

ArgumentNullException

Thrown when boundarySeparators is null.

ArgumentException

Thrown when a separator is empty, which would end every chunk where it began.

ArgumentOutOfRangeException

Thrown when a count is not positive, or when the minimum or the overlap is not smaller than the target.