Class: Kreuzberg::Result::Table

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#bounding_boxBoundingBox? (readonly)

Returns Bounding box of the table on the page.

Returns:

  • (BoundingBox, nil)

    Bounding box of the table on the page



28
29
30
31
32
# File 'lib/kreuzberg/result.rb', line 28

Table = Struct.new(:cells, :markdown, :page_number, :bounding_box) do
  def to_h
    { cells: cells, markdown: markdown, page_number: page_number, bounding_box: bounding_box&.to_h }
  end
end

#cellsArray<Array<String>> (readonly)

Returns Table cells (2D array).

Returns:

  • (Array<Array<String>>)

    Table cells (2D array)



28
29
30
31
32
# File 'lib/kreuzberg/result.rb', line 28

Table = Struct.new(:cells, :markdown, :page_number, :bounding_box) do
  def to_h
    { cells: cells, markdown: markdown, page_number: page_number, bounding_box: bounding_box&.to_h }
  end
end

#markdownString (readonly)

Returns Markdown representation.

Returns:

  • (String)

    Markdown representation



28
29
30
31
32
# File 'lib/kreuzberg/result.rb', line 28

Table = Struct.new(:cells, :markdown, :page_number, :bounding_box) do
  def to_h
    { cells: cells, markdown: markdown, page_number: page_number, bounding_box: bounding_box&.to_h }
  end
end

#page_numberInteger (readonly)

Returns Page number where table was found.

Returns:

  • (Integer)

    Page number where table was found



28
29
30
31
32
# File 'lib/kreuzberg/result.rb', line 28

Table = Struct.new(:cells, :markdown, :page_number, :bounding_box) do
  def to_h
    { cells: cells, markdown: markdown, page_number: page_number, bounding_box: bounding_box&.to_h }
  end
end

Instance Method Details

#to_hObject



29
30
31
# File 'lib/kreuzberg/result.rb', line 29

def to_h
  { cells: cells, markdown: markdown, page_number: page_number, bounding_box: bounding_box&.to_h }
end