Unstructured-IO / Unstructured-IO/unstructured

bug/right to left languages

Open
#3,927 3 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
HTML
Stars
15.5k
Forks
1.3k
Avg merge
4d 2h
Merged PRs (30d)
13

Description

Describe the bug
for right to left languages the output of reading a document is printed left to right,
for example instead of printing "Hello world", in arabic for example, the output print : "Dlor wolleh"

To Reproduce

from unstructured.partition.pdf import partition_pdf
elements=partition_pdf(
          filename=file_path,
          languages= languages,
          strategy="hi_res",
      )

elements_dict = [el.to_dict() for el in elements]

Expected behavior
the output text is printed right to left sentences

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the unstructured.partition.pdf partition_pdf entry point and reproduce the issue with the supplied languages and hi_res example. Trace how the extracted elements are converted with to_dict(), then verify that right-to-left language output preserves sentence direction rather than reversing the text.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.