Skip to content

Commit

Permalink
Update haystack/components/preprocessors/recursive_splitter.py
Browse files Browse the repository at this point in the history
Co-authored-by: Sebastian Husch Lee <[email protected]>
  • Loading branch information
davidsbatista and sjrl authored Dec 19, 2024
1 parent f35d4e5 commit 938b610
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion haystack/components/preprocessors/recursive_splitter.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ def _chunk_text(self, text: str) -> List[str]:
for i in range(0, self._chunk_length(text), self.split_length - self.split_overlap)
]

def _add_overlap_info(self, curr_pos, new_doc, new_docs):
def _add_overlap_info(self, curr_pos: int, new_doc: Document, new_docs: List[Document]) -> None:
prev_doc = new_docs[-1]
overlap_length = self._chunk_length(prev_doc.content) - (curr_pos - prev_doc.meta["split_idx_start"]) # type: ignore
if overlap_length > 0:
Expand Down

0 comments on commit 938b610

Please sign in to comment.