Skip to content

Commit

Permalink
fixbug for computing 'not concating feature' (#896)
Browse files Browse the repository at this point in the history
### What problem does this PR solve?

When pdfparser call `_naive_vertical_merge` method,there is a "not
concating feature " value by computing difference between `b` and `b_`'s
layoutno ,but actually is `b` and `b`. I think it's a bug, so fix it.
Please check again.

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
  • Loading branch information
xinzhuang committed May 23, 2024
1 parent 070b53f commit 3bbdf3b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion deepdoc/parser/pdf_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ def _naive_vertical_merge(self):
]
# features for not concating
feats = [
b.get("layoutno", 0) != b.get("layoutno", 0),
b.get("layoutno", 0) != b_.get("layoutno", 0),
b["text"].strip()[-1] in "。?!?",
self.is_english and b["text"].strip()[-1] in ".!?",
b["page_number"] == b_["page_number"] and b_["top"] -
Expand Down

0 comments on commit 3bbdf3b

Please sign in to comment.