nlmatics / llmsherpa

Developer APIs to Accelerate LLM Projects
https://www.nlmatics.com
MIT License
1.37k stars 134 forks source link

Incorrect child assignment for 'header' blocks in LayoutReader.read #90

Closed IoanaDragan closed 3 months ago

IoanaDragan commented 3 months ago

Fixed parent-child assignment for 'header' blocks when the appearance order of blocks doesn't follow the logical level sequence (e.g. header level 0, header level 2, header level 1, ...)

aaryan200 commented 3 months ago

Hi @IoanaDragan , You are using CRLF line endings (Windows style) in your text editor. Please change them to LF (unix style) line endings so that things remain consistent and it becomes easier to see the changes. This blog might help you if you are using vscode.

IoanaDragan commented 3 months ago

Thank you, I've changed the line endings, should be ok now.

ansukla commented 3 months ago

Thanks for the PR

ansukla commented 3 months ago

Hi @IoanaDragan - Thanks for the PR. Could you please confirm you have run all the test cases. Also would it be possible to add a new test case so that future changes don't reverse yours. I remember writing this part of the code and there are some tricky edge cases.

IoanaDragan commented 3 months ago

Hello @ansukla . Yes, I had ran all test cases before comitting. I added a new test case just now for this particular scenario.

ansukla commented 3 months ago

Thanks, merging this now.