Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions unstructured/chunking/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -311,8 +311,10 @@ def _is_in_new_semantic_unit(self, element: Element) -> bool:
# -- all detectors need to be called to update state and avoid double counting
# -- boundaries that happen to coincide, like Table and new section on same element.
# -- Using `any()` would short-circuit on first True.
semantic_boundaries = [pred(element) for pred in self._boundary_predicates]
return any(semantic_boundaries)
for pred in self._boundary_predicates:
if pred(element):
return True
return False


class PreChunkBuilder:
Expand Down