Table of Contents

Method FromExtraction

Namespace
MailFathom.Application.Emails.AttachmentText
Assembly
MailFathom.Application.dll

FromExtraction(int, string, string?, AttachmentTextExtractionResult)

Records what reading one document attachment produced, with nothing read off the pictures inside it.

public static DerivedAttachmentText FromExtraction(int position, string declaredMediaType, string? fileName, AttachmentTextExtractionResult result)

Parameters

position int

The attachment's walk position.

declaredMediaType string

The media type the part declared.

fileName string

The normalized file name, or null.

result AttachmentTextExtractionResult

What the extractor answered.

Returns

DerivedAttachmentText

The derivation to store.

Exceptions

ArgumentNullException

Thrown when declaredMediaType or result is null.

FromExtraction(int, string, string?, AttachmentTextExtractionResult, IReadOnlyList<EmbeddedPictureReading>)

Records what reading one document attachment and the pictures inside it produced.

public static DerivedAttachmentText FromExtraction(int position, string declaredMediaType, string? fileName, AttachmentTextExtractionResult result, IReadOnlyList<EmbeddedPictureReading> pictureReadings)

Parameters

position int

The attachment's walk position.

declaredMediaType string

The media type the part declared.

fileName string

The normalized file name, or null.

result AttachmentTextExtractionResult

What the extractor answered.

pictureReadings IReadOnlyList<EmbeddedPictureReading>

What the model read off each picture the document carries, in reading order.

Returns

DerivedAttachmentText

The derivation to store.

Remarks

A transcription is written text that happens to be printed as a picture — the scanned page of a PDF, the photographed receipt pasted into a report — so it joins the document's own words, placed at the end of the page it was found on so a passage cut from it cites that page. The document stays a Document and is searched as one.

A description is kept only when the document yielded no written words at all, and then the attachment is stored as a ImageDescription — a PDF that is one photograph is a picture, and ranks as one. Beside written words a description is dropped rather than joined, because joining it would put a machine's sentence about a logo or a product shot into the lexical index as though somebody had written it, which is exactly what keeps a depicted match below a written one.

A picture the provider did not answer this time leaves the attachment's outcome naming that refusal, whatever the document itself yielded. That is what keeps the message outstanding, exactly as an image attachment the provider did not answer keeps it: the next run reads the document again and replaces this reading with a complete one, rather than the scanned page being settled as though it held nothing.

Exceptions

ArgumentNullException

Thrown when an argument is null.