Skip to content

Commit

Permalink
exclude empty sentences from sentenceit
Browse files Browse the repository at this point in the history
  • Loading branch information
jparkerweb committed Dec 13, 2024
1 parent bc1a4a1 commit 71a1ca2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion chunkit.js
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,9 @@ export async function sentenceit(
// Split the text into sentences
const chunks = [];
for (const { segment } of splitBySentence(doc.document_text)) {
chunks.push(segment.trim());
if (segment.trim().length > 0) {
chunks.push(segment.trim());
}
}

if (logging) {
Expand Down

0 comments on commit 71a1ca2

Please sign in to comment.