Skip to content

Latest commit

 

History

History

text-splitter

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

README.md

Text splitter

Split a document into overlapping chunks with a built-in component.

Level: Basics · Concept: Components

flowchart LR
  D([document]) -- text --> S[TextSplitter] -- out --> C([chunks])
Loading

What it shows

  • TextSplitter packs paragraphs into chunks of at most chunkSize characters.
  • Paragraphs that fit in overlap repeat at the start of the next chunk.

Run

# Once, from the repository root
pnpm install && pnpm build

pnpm --filter @astack-examples/text-splitter start

The full program is index.ts.

Next: Tools