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

Class LTTextLineVertical

pattern/web/pdf/layout.py:363–382  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

361 return [ obj for obj in objs if isinstance(obj, LTTextLineHorizontal) ]
362
363class LTTextLineVertical(LTTextLine):
364
365 def __init__(self, word_margin):
366 LTTextLine.__init__(self, word_margin)
367 self._y0 = -INF
368 return
369
370 def add(self, obj):
371 if isinstance(obj, LTChar) and self.word_margin:
372 margin = self.word_margin * obj.height
373 if obj.y1+margin < self._y0:
374 LTContainer.add(self, LTAnon(' '))
375 self._y0 = obj.y0
376 LTTextLine.add(self, obj)
377 return
378
379 def find_neighbors(self, plane, ratio):
380 w = ratio*self.width
381 objs = plane.find((self.x0-w, self.y0, self.x1+w, self.y1))
382 return [ obj for obj in objs if isinstance(obj, LTTextLineVertical) ]
383
384
385## LTTextBox

Callers 1

get_textlinesMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…