Skip to content

Commit

Permalink
change chunk limit check in boht algorithms
Browse files Browse the repository at this point in the history
Signed-off-by: yuye-aws <[email protected]>
  • Loading branch information
yuye-aws committed Apr 30, 2024
1 parent 3490a92 commit 84cd362
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public List<String> chunk(final String content, final Map<String, Object> runtim
int nextDelimiterPosition = content.indexOf(delimiter);

while (nextDelimiterPosition != -1) {
if (ChunkerUtil.checkRunTimeMaxChunkLimit(chunkResult.size(), runtimeMaxChunkLimit, stringTobeChunkedCount)) {
if (Chunker.checkRunTimeMaxChunkLimit(chunkResult.size(), runtimeMaxChunkLimit, stringTobeChunkedCount)) {
break;
}
end = nextDelimiterPosition + delimiter.length();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ public List<String> chunk(final String content, final Map<String, Object> runtim
} else {
startContentPosition = tokens.get(startTokenIndex).getStartOffset();
}
if (ChunkerUtil.checkRunTimeMaxChunkLimit(chunkResult.size(), runtimeMaxChunkLimit, stringTobeChunkedCount)) {
if (Chunker.checkRunTimeMaxChunkLimit(chunkResult.size(), runtimeMaxChunkLimit, stringTobeChunkedCount)) {
// include all characters till the end if exceeds max chunk limit
chunkResult.add(content.substring(startContentPosition));
break;
Expand Down

0 comments on commit 84cd362

Please sign in to comment.