| 340 | raise NotImplementedError |
| 341 | |
| 342 | class LTTextLineHorizontal(LTTextLine): |
| 343 | |
| 344 | def __init__(self, word_margin): |
| 345 | LTTextLine.__init__(self, word_margin) |
| 346 | self._x1 = +INF |
| 347 | return |
| 348 | |
| 349 | def add(self, obj): |
| 350 | if isinstance(obj, LTChar) and self.word_margin: |
| 351 | margin = self.word_margin * obj.width |
| 352 | if self._x1 < obj.x0-margin: |
| 353 | LTContainer.add(self, LTAnon(' ')) |
| 354 | self._x1 = obj.x1 |
| 355 | LTTextLine.add(self, obj) |
| 356 | return |
| 357 | |
| 358 | def find_neighbors(self, plane, ratio): |
| 359 | h = ratio*self.height |
| 360 | objs = plane.find((self.x0, self.y0-h, self.x1, self.y1+h)) |
| 361 | return [ obj for obj in objs if isinstance(obj, LTTextLineHorizontal) ] |
| 362 | |
| 363 | class LTTextLineVertical(LTTextLine): |
| 364 |
no outgoing calls
no test coverage detected
searching dependent graphs…