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

Numbered elements aren't preserved as they show up in .docx files #29

Open
ultran1te opened this issue Mar 10, 2024 · 2 comments
Open

Comments

@ultran1te
Copy link

ultran1te commented Mar 10, 2024

I'm currently trying to create a method of parsing .pdf, .docx, and other files containing questions and converting it to a format that can imported to an online learning platform. I'm having a problem in the situation shown below where .docx files use the built in numbered list formatting and the numbers are lost.

image

The above image results in:
34.How do you...
What is..
What is a...
36.Water...
a. option a b. option b c. option c d. option d

I'm unsure if this is something wrong with the docx file or the library. I've tested this without doing anything to the data that officerParser outputs and it has the same results. I've done a bit of digging into this and it seems that the only preserved numbers are those that are misformatted in the .docx file. If they do correctly use the built-in numbering system, they will be removed. Otherwise, they are preserved. Not necessarily a problem, just makes it difficult to parse the questions.

@harshankur
Copy link
Owner

Hi @ultran1te, I would need to have a look at the document file. Can you create a copy of the document, remove all the other content that is not visible in the attached image and share it here?

@ultran1te
Copy link
Author

Hi @ultran1te, I would need to have a look at the document file. Can you create a copy of the document, remove all the other content that is not visible in the attached image and share it here?

Here is the document with everything else removed. I verified that it does still occur with this document.
Example Document.docx

Thank you for the quick response.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants