Member Junction
    Preparing search index...

    Base class for content cleaning strategies.

    Cleaning is deliberately a separate stage from segmentation, and a separate plug-in point. The two answer different questions — cleaning asks which text is actually content, segmentation asks where that content divides — and they change for different reasons: a new CMS template needs new selectors, not a new chunking strategy. Splitting them also means the cleaning rules apply once and benefit every downstream consumer (embedding chunks, tagging chunks, full-text indexing) instead of being reimplemented per pipeline.

    Garbage that survives this stage is expensive: it gets embedded, stored, retrieved, and eventually shown to a user or an agent. Navigation chrome repeated across a thousand pages produces a thousand near-identical vectors that crowd out real answers.

    @RegisterClass(BaseContentCleaner, 'MyCleaner')
    export class MyCleaner extends BaseContentCleaner {
    public get Key(): string { return 'MyCleaner'; }
    protected CleanCore(params: ContentCleaningParams): string { return strip(params.Content); }
    }

    Hierarchy (View Summary)

    Index

    Constructors

    Accessors

    Methods

    • Collapse horizontal whitespace and runs of blank lines, while preserving the single blank line that marks a paragraph break — segmenters rely on it as a boundary signal.

      Parameters

      • content: string

      Returns string