Class: Kreuzberg::Result::HierarchicalBlock

Inherits:
Struct
  • Object
show all
Defined in:
lib/kreuzberg/result.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#bboxArray<Float>? (readonly)

Returns Bounding box (left, top, right, bottom).

Returns:

  • (Array<Float>, nil)

    Bounding box (left, top, right, bottom)



117
118
119
120
121
# File 'lib/kreuzberg/result.rb', line 117

HierarchicalBlock = Struct.new(:text, :font_size, :level, :bbox, keyword_init: true) do
  def to_h
    { text: text, font_size: font_size, level: level, bbox: bbox }
  end
end

#contentString (readonly)

Returns Text content for this page.

Returns:

  • (String)

    Text content for this page



117
118
119
120
121
# File 'lib/kreuzberg/result.rb', line 117

HierarchicalBlock = Struct.new(:text, :font_size, :level, :bbox, keyword_init: true) do
  def to_h
    { text: text, font_size: font_size, level: level, bbox: bbox }
  end
end

#font_sizeFloat (readonly)

Returns The font size of the text.

Returns:

  • (Float)

    The font size of the text



117
118
119
120
121
# File 'lib/kreuzberg/result.rb', line 117

HierarchicalBlock = Struct.new(:text, :font_size, :level, :bbox, keyword_init: true) do
  def to_h
    { text: text, font_size: font_size, level: level, bbox: bbox }
  end
end

#imagesArray<Image> (readonly)

Returns Images on this page.

Returns:

  • (Array<Image>)

    Images on this page



117
118
119
120
121
# File 'lib/kreuzberg/result.rb', line 117

HierarchicalBlock = Struct.new(:text, :font_size, :level, :bbox, keyword_init: true) do
  def to_h
    { text: text, font_size: font_size, level: level, bbox: bbox }
  end
end

#levelString (readonly)

Returns The hierarchy level (h1-h6 or body).

Returns:

  • (String)

    The hierarchy level (h1-h6 or body)



117
118
119
120
121
# File 'lib/kreuzberg/result.rb', line 117

HierarchicalBlock = Struct.new(:text, :font_size, :level, :bbox, keyword_init: true) do
  def to_h
    { text: text, font_size: font_size, level: level, bbox: bbox }
  end
end

#page_numberInteger (readonly)

Returns Page number (1-indexed).

Returns:

  • (Integer)

    Page number (1-indexed)



117
118
119
120
121
# File 'lib/kreuzberg/result.rb', line 117

HierarchicalBlock = Struct.new(:text, :font_size, :level, :bbox, keyword_init: true) do
  def to_h
    { text: text, font_size: font_size, level: level, bbox: bbox }
  end
end

#tablesArray<Table> (readonly)

Returns Tables on this page.

Returns:

  • (Array<Table>)

    Tables on this page



117
118
119
120
121
# File 'lib/kreuzberg/result.rb', line 117

HierarchicalBlock = Struct.new(:text, :font_size, :level, :bbox, keyword_init: true) do
  def to_h
    { text: text, font_size: font_size, level: level, bbox: bbox }
  end
end

#textString (readonly)

Returns The text content of this block.

Returns:

  • (String)

    The text content of this block



117
118
119
120
121
# File 'lib/kreuzberg/result.rb', line 117

HierarchicalBlock = Struct.new(:text, :font_size, :level, :bbox, keyword_init: true) do
  def to_h
    { text: text, font_size: font_size, level: level, bbox: bbox }
  end
end

Instance Method Details

#to_hObject



118
119
120
# File 'lib/kreuzberg/result.rb', line 118

def to_h
  { text: text, font_size: font_size, level: level, bbox: bbox }
end