Table of Contents

Class MediReaderAdapter

Namespace
Qavren.Edge.Ingestion.DataIngestion
Assembly
Qavren.Edge.Ingestion.DataIngestion.dll

Turns any MEDI IngestionDocumentReader into an SP3 IDocumentExtractor (spec 11, plan task 6.3 step 3). This is how a consumer gets a format SP3 does not ship — HTML, say — without SP3 shipping an extractor for it (spec 18): register the adapter through AddDocumentExtractor or IngestionOptions.Extractors and the registry resolves it like any other extractor, ahead of the built-ins.

The source is opened through OpenAsync, as every SP3 extractor must be, and handed to the reader's stream overload. When NormalizeText is on, each element's text is normalised (CRLF and lone CR to LF, NFC, BOM stripped) before the text buffer is built, so the offsets FromMedi(IngestionDocument, ILogger?) assigns already index the normalised text. The same caveat as the core's normaliser applies: under InvariantGlobalization Normalize(NormalizationForm) is a no-op, so there the line-ending and BOM rules are the whole of it.

public sealed class MediReaderAdapter : IDocumentExtractor
Inheritance
MediReaderAdapter
Implements
Inherited Members

Constructors

MediReaderAdapter(IngestionDocumentReader, string, IReadOnlyList<string>, IReadOnlyList<string>, int)

Creates the adapter.

Properties

Extensions

Lower-case, dotted.

Id

Stable; feeds the recipe hash.

MediaTypes

The media types this extractor claims.

Reader

The wrapped reader.

Version

Bump when output changes for identical input.

Methods

CanExtract(DocumentSourceItem)

Always true: the registry's media-type and extension match is the whole decision.

ExtractAsync(DocumentSourceItem, ExtractionContext, CancellationToken)

Extracts one document. The stream is opened here, not by the caller, and the returned document's block offsets index Text.