fastrag.normalization.models#
Source-preserving structural models independent of ingestion and packing.
Classes
|
A nonoverlapping retained source interval owned by a structural node. |
|
Stable normalization diagnostic; no timing or secret values. |
|
Explicitly omitted source with the policy reason. |
|
Tree and independent exact source coverage partition. |
|
Ordered structure; content is original syntax, not rewritten prose. |
|
Injectable format adapter with stable nonsecret cache identity. |
|
Half-open Unicode offsets into the original Document content. |
- class fastrag.normalization.models.SourceSpan(start_offset, end_offset)[source]#
Bases:
objectHalf-open Unicode offsets into the original Document content.
- class fastrag.normalization.models.NormalizedNode(id, kind, content, spans, children=(), parent_id=None, level=None, title=None, metadata=<factory>)[source]#
Bases:
objectOrdered structure; content is original syntax, not rewritten prose.
- Parameters:
- class fastrag.normalization.models.CoverageUnit(id, node_id, span)[source]#
Bases:
objectA nonoverlapping retained source interval owned by a structural node.
- Parameters:
id (str)
node_id (str)
span (SourceSpan)
- class fastrag.normalization.models.Exclusion(span, reason)[source]#
Bases:
objectExplicitly omitted source with the policy reason.
- Parameters:
span (SourceSpan)
reason (str)
- class fastrag.normalization.models.Diagnostic(code, message, span=None)[source]#
Bases:
objectStable normalization diagnostic; no timing or secret values.
- Parameters:
code (str)
message (str)
span (SourceSpan | None)
- class fastrag.normalization.models.NormalizedDocument(document, source_format, roots, units, exclusions=(), diagnostics=())[source]#
Bases:
objectTree and independent exact source coverage partition.
- Parameters:
document (Document)
source_format (str)
roots (tuple[NormalizedNode, ...])
units (tuple[CoverageUnit, ...])
diagnostics (tuple[Diagnostic, ...])