Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove clean_bullets from partition_docx #3464

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
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
8 changes: 2 additions & 6 deletions unstructured/partition/docx.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
from typing_extensions import TypeAlias

from unstructured.chunking import add_chunking_strategy
from unstructured.cleaners.core import clean_bullets
from unstructured.documents.elements import (
Address,
Element,
Expand Down Expand Up @@ -471,13 +470,10 @@ def _classify_paragraph_to_element(self, paragraph: Paragraph) -> Iterator[Eleme

metadata = self._paragraph_metadata(paragraph)

# NOTE(scanny) - a list-item gets some special treatment, mutating the text to remove a
# bullet-character if present.
if self._is_list_item(paragraph):
clean_text = clean_bullets(text).strip()
if clean_text:
if text:
yield ListItem(
text=clean_text,
text=text,
metadata=metadata,
detection_origin=DETECTION_ORIGIN,
)
Expand Down