Skip to content

Commit 2e808c7

Browse files
authored
fix: text splitter with tiny documents (fixes #193) (#196)
1 parent 6efe240 commit 2e808c7

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

packages/indexer/src/lib/document-processor.ts

+4
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,10 @@ export class DocumentProcessor {
7575
let start = 0;
7676
let end = length;
7777

78+
if (end <= MAX_SECTION_LENGTH) {
79+
return [{ content: allText, page: findPage(0) }];
80+
}
81+
7882
while (start + SECTION_OVERLAP < length) {
7983
let lastWord = -1;
8084
end = start + MAX_SECTION_LENGTH;

0 commit comments

Comments
 (0)