leaf_focus/report/item/page.py
def items_text(self, line_num: int) -> str:
        """
        Get the ocr text for a line spaced
        according to item positions.
        """
        sorted_items = self.items_line(line_num)
        est_char_width = 11
        text = ""
        for item in sorted_items:
            offset_chars = math.floor(item.top_left_x / est_char_width)
            text_chars = len(text)

            # Ignore that offset_chars might sometimes be
            # smaller than text_chars.
            # Each phrase from the OCR is known to not overlap.
            # Each phrase must be to the right of the previous
            # phrase by at least one space.
            if offset_chars > text_chars:
                text += " " * (offset_chars - text_chars)
            else:
                text += " "

            text += item.text
        return text

        Get the ocr text for a line spaced
        according to item positions.
        
Get the ocr text for a line spaced
according to item positions.
Get the ocr text for a line spaced according to item positions .
def items_text(self, line_num: int) -> str:
        sorted_items = self.items_line(line_num)
        est_char_width = 11
        text = ""
        for item in sorted_items:
            offset_chars = math.floor(item.top_left_x / est_char_width)
            text_chars = len(text)
            if offset_chars > text_chars:
                text += " " * (offset_chars - text_chars)
            else:
                text += " "
            text += item.text
        return text
def items_text ( self , line_num : int ) -> str : sorted_items = self . items_line ( line_num ) est_char_width = 11 text = "" for item in sorted_items : offset_chars = math . floor ( item . top_left_x / est_char_width ) text_chars = len ( text ) if offset_chars > text_chars : text += " " * ( offset_chars - text_chars ) else : text += " " text += item . text return text
Get the ocr text for a line spaced
according to item positions.
Get the ocr text for a line spaced according to item positions .
"""
        Get the ocr text for a line spaced
        according to item positions.
        """ # Ignore that offset_chars might sometimes be # smaller than text_chars. # Each phrase from the OCR is known to not overlap. # Each phrase must be to the right of the previous # phrase by at least one space.
self
line_num
int