Skip to content

Commit

Permalink
Bug fix in determine_heading_level
Browse files Browse the repository at this point in the history
  • Loading branch information
AnnaMarika01 committed Oct 2, 2024
1 parent 8443c20 commit b2e6d98
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions text_extractor/parser/pdfact_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,10 @@ def determine_heading_level(document: Document) -> Document:
})
else:
existing_style['occurrences'] += 1

if not heading_styles:
return document

# Sort the styles by font size in descending order
heading_styles = sorted(heading_styles, key=lambda x: x['font_size'], reverse=True)

Expand Down

0 comments on commit b2e6d98

Please sign in to comment.