UNPKG

@juspay/neurolink

Version:

Universal AI Development Platform with working MCP integration, multi-provider support, voice (TTS/STT/realtime), and professional CLI. 58+ external MCP servers discoverable, multimodal file processing, RAG pipelines. Build, test, and deploy AI applicatio

29 lines (28 loc) 895 B
/** * Character Chunker * * Splits text into fixed-size character chunks with optional overlap. * The simplest chunking strategy for language-agnostic processing. */ import { BaseChunker, DEFAULT_CHUNKER_CONFIG } from "./BaseChunker.js"; /** * Character Chunker * * Splits content into fixed-size character chunks. */ export class CharacterChunker extends BaseChunker { strategy = "character"; getDefaultConfig() { return { ...DEFAULT_CHUNKER_CONFIG, maxSize: 1000, overlap: 100, }; } async doChunk(content, config) { const maxSize = config.maxSize ?? 1000; const overlap = config.overlap ?? 100; const segments = this.splitBySizeWithOverlap(content, maxSize, overlap); return segments.map((segment, index) => this.createChunk(segment.text, index, segment.start, segment.end)); } }