Class: Kreuzberg::Result::PageContent

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#contentString (readonly)

Returns Text content for this page.

Returns:

  • (String)

    Text content for this page



145
146
147
148
149
150
151
152
153
154
155
156
# File 'lib/kreuzberg/result.rb', line 145

PageContent = Struct.new(:page_number, :content, :tables, :images, :hierarchy, :is_blank) do
  def to_h
    {
      page_number: page_number,
      content: content,
      tables: tables.map(&:to_h),
      images: images.map(&:to_h),
      hierarchy: hierarchy&.to_h,
      is_blank: is_blank
    }
  end
end

#hierarchyPageHierarchy? (readonly)

Returns Hierarchy information for the page.

Returns:



145
146
147
148
149
150
151
152
153
154
155
156
# File 'lib/kreuzberg/result.rb', line 145

PageContent = Struct.new(:page_number, :content, :tables, :images, :hierarchy, :is_blank) do
  def to_h
    {
      page_number: page_number,
      content: content,
      tables: tables.map(&:to_h),
      images: images.map(&:to_h),
      hierarchy: hierarchy&.to_h,
      is_blank: is_blank
    }
  end
end

#imagesArray<Image> (readonly)

Returns Images on this page.

Returns:

  • (Array<Image>)

    Images on this page



145
146
147
148
149
150
151
152
153
154
155
156
# File 'lib/kreuzberg/result.rb', line 145

PageContent = Struct.new(:page_number, :content, :tables, :images, :hierarchy, :is_blank) do
  def to_h
    {
      page_number: page_number,
      content: content,
      tables: tables.map(&:to_h),
      images: images.map(&:to_h),
      hierarchy: hierarchy&.to_h,
      is_blank: is_blank
    }
  end
end

#is_blankObject

Returns the value of attribute is_blank

Returns:

  • (Object)

    the current value of is_blank



145
146
147
# File 'lib/kreuzberg/result.rb', line 145

def is_blank
  @is_blank
end

#page_numberInteger (readonly)

Returns Page number (1-indexed).

Returns:

  • (Integer)

    Page number (1-indexed)



145
146
147
148
149
150
151
152
153
154
155
156
# File 'lib/kreuzberg/result.rb', line 145

PageContent = Struct.new(:page_number, :content, :tables, :images, :hierarchy, :is_blank) do
  def to_h
    {
      page_number: page_number,
      content: content,
      tables: tables.map(&:to_h),
      images: images.map(&:to_h),
      hierarchy: hierarchy&.to_h,
      is_blank: is_blank
    }
  end
end

#tablesArray<Table> (readonly)

Returns Tables on this page.

Returns:

  • (Array<Table>)

    Tables on this page



145
146
147
148
149
150
151
152
153
154
155
156
# File 'lib/kreuzberg/result.rb', line 145

PageContent = Struct.new(:page_number, :content, :tables, :images, :hierarchy, :is_blank) do
  def to_h
    {
      page_number: page_number,
      content: content,
      tables: tables.map(&:to_h),
      images: images.map(&:to_h),
      hierarchy: hierarchy&.to_h,
      is_blank: is_blank
    }
  end
end

Instance Method Details

#to_hObject



146
147
148
149
150
151
152
153
154
155
# File 'lib/kreuzberg/result.rb', line 146

def to_h
  {
    page_number: page_number,
    content: content,
    tables: tables.map(&:to_h),
    images: images.map(&:to_h),
    hierarchy: hierarchy&.to_h,
    is_blank: is_blank
  }
end