Skip to content

Commit

Permalink
fix compiliation
Browse files Browse the repository at this point in the history
  • Loading branch information
davidkyle committed Dec 16, 2024
1 parent 5d3d2c6 commit 76f1c63
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ public List<String> chunk(String input, int maxNumberWordsPerChunk, boolean incl

if (chunks.isEmpty()) {
// The input did not chunk, return the entire input
chunks.add(new ChunkOffset(0, input.length()));
chunks.add(input);
}

return chunks;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,10 @@ public void testWhitespace() {
assertThat(chunks, contains(" "));
}

private List<String> textChunks(WordBoundaryChunker chunker, String input, int chunkSize, int overlap) {
return chunker.chunk(input, chunkSize, overlap);
}

public void testBlankString() {
var chunks = textChunks(new WordBoundaryChunker(), " ", 100, 10);
assertThat(chunks, hasSize(1));
Expand Down

0 comments on commit 76f1c63

Please sign in to comment.