From 092e477acadcaa4e166a0c7f9744fa3697acb209 Mon Sep 17 00:00:00 2001 From: Hans Date: Mon, 1 Jan 2024 22:33:40 +0800 Subject: [PATCH] Remove always true LTChar.is_compatible (#887) Co-authored-by: Pieter Marsman --- pdfminer/layout.py | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/pdfminer/layout.py b/pdfminer/layout.py index a4159e46..408a527a 100644 --- a/pdfminer/layout.py +++ b/pdfminer/layout.py @@ -422,10 +422,6 @@ def __repr__(self) -> str: def get_text(self) -> str: return self._text - def is_compatible(self, obj: object) -> bool: - """Returns True if two characters can coexist in the same line.""" - return True - LTItemT = TypeVar("LTItemT", bound=LTItem) @@ -770,8 +766,7 @@ def group_objects( # |<--->| # (char_margin) halign = ( - obj0.is_compatible(obj1) - and obj0.is_voverlap(obj1) + obj0.is_voverlap(obj1) and min(obj0.height, obj1.height) * laparams.line_overlap < obj0.voverlap(obj1) and obj0.hdistance(obj1) @@ -794,7 +789,6 @@ def group_objects( # (line_overlap) valign = ( laparams.detect_vertical - and obj0.is_compatible(obj1) and obj0.is_hoverlap(obj1) and min(obj0.width, obj1.width) * laparams.line_overlap < obj0.hoverlap(obj1)