MCPcopy Create free account
hub / github.com/clips/pattern / hdistance

Method hdistance

pattern/web/pdf/layout.py:102–107  ·  view source on GitHub ↗
(self, obj)

Source from the content-addressed store, hash-verified

100 return obj.x0 <= self.x1 and self.x0 <= obj.x1
101
102 def hdistance(self, obj):
103 assert isinstance(obj, LTComponent)
104 if self.is_hoverlap(obj):
105 return 0
106 else:
107 return min(abs(self.x0-obj.x1), abs(self.x1-obj.x0))
108
109 def hoverlap(self, obj):
110 assert isinstance(obj, LTComponent)

Callers 1

get_textlinesMethod · 0.80

Calls 2

is_hoverlapMethod · 0.95
absFunction · 0.50

Tested by

no test coverage detected