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)



122
123
124
125
126
# File 'lib/kreuzberg/result.rb', line 122

HierarchicalBlock = Struct.new(:text, :font_size, :level, :bbox) 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



122
123
124
125
126
# File 'lib/kreuzberg/result.rb', line 122

HierarchicalBlock = Struct.new(:text, :font_size, :level, :bbox) 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



122
123
124
125
126
# File 'lib/kreuzberg/result.rb', line 122

HierarchicalBlock = Struct.new(:text, :font_size, :level, :bbox) 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



122
123
124
125
126
# File 'lib/kreuzberg/result.rb', line 122

HierarchicalBlock = Struct.new(:text, :font_size, :level, :bbox) 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)



122
123
124
125
126
# File 'lib/kreuzberg/result.rb', line 122

HierarchicalBlock = Struct.new(:text, :font_size, :level, :bbox) 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)



122
123
124
125
126
# File 'lib/kreuzberg/result.rb', line 122

HierarchicalBlock = Struct.new(:text, :font_size, :level, :bbox) 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



122
123
124
125
126
# File 'lib/kreuzberg/result.rb', line 122

HierarchicalBlock = Struct.new(:text, :font_size, :level, :bbox) 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



122
123
124
125
126
# File 'lib/kreuzberg/result.rb', line 122

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

Instance Method Details

#to_hObject



123
124
125
# File 'lib/kreuzberg/result.rb', line 123

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