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
ruleSetVersionintThe version these rules are recorded under.
targetCharacterCountintThe greatest number of characters one chunk may hold.
minimumCharacterCountintThe length a chunk must reach before a separator may end it.
overlapCharacterCountintHow far back into the previous chunk the next one starts.
boundarySeparatorsIReadOnlyList<string>The separators to break after, from the strongest to the weakest.
sourceFormEmailChunkSourceFormWhich reading of the message body to cut from.
Returns
- EmailChunkingRules
The rule set.
Exceptions
- ArgumentNullException
Thrown when
boundarySeparatorsis 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.