Member Junction
    Preparing search index...

    Token-aware text chunker that respects natural boundaries.

    Supports three strategies:

    • sentence: Splits on sentence boundaries (., !, ?), never mid-sentence. Best for prose and natural language text.
    • paragraph: Splits on paragraph boundaries (\n\n). Best for structured documents.
    • fixed: Splits on whitespace boundaries at the token limit. Fastest but least semantic.
    Index

    Constructors

    Methods

    • Estimate token count using whitespace splitting. This is a fast approximation; for production accuracy, use tiktoken.

      Parameters

      • text: string

      Returns number