Class: Pikuri::Extractor::Page

Inherits:
Data
  • Object
show all
Defined in:
lib/pikuri/extractor.rb

Overview

One windowed slice of a document, returned by extract_paged, carrying everything a trailer needs without re-reading the document.

  • linesArray<String>, the collected window; already per-line truncated (with PAGE_LINE_TRUNCATION_MARKER), not line-numbered (numbering is the caller's presentation). Includes any +"--- Page N ---"+ marker lines, which count toward +limit+/the byte cap.
  • start_line — 1-indexed line number of lines.first (the requested offset).
  • total_linesInteger document line count when known, else nil. Known at EOF, when extracted in full (HTML), or on a cheap-to-count stream (text); nil when a lazy stream stopped early (byte cap, or a PDF window filled before the last page — counting the rest would parse every page).
  • moretrue if content remains past this window.
  • byte_cappedtrue if the byte cap (not the line limit) stopped it.
  • kind — the matched extractor's kind tag.

Empty document → lines: [], total_lines: 0; offset past EOF → lines: [] with total_lines at the real count — the caller distinguishes the two.

Instance Attribute Summary collapse

Instance Attribute Details

#byte_cappedObject (readonly)

Returns the value of attribute byte_capped

Returns:

  • the current value of byte_capped



104
105
106
# File 'lib/pikuri/extractor.rb', line 104

def byte_capped
  @byte_capped
end

#kindObject (readonly)

Returns the value of attribute kind

Returns:

  • the current value of kind



104
105
106
# File 'lib/pikuri/extractor.rb', line 104

def kind
  @kind
end

#linesObject (readonly)

Returns the value of attribute lines

Returns:

  • the current value of lines



104
105
106
# File 'lib/pikuri/extractor.rb', line 104

def lines
  @lines
end

#moreObject (readonly)

Returns the value of attribute more

Returns:

  • the current value of more



104
105
106
# File 'lib/pikuri/extractor.rb', line 104

def more
  @more
end

#start_lineObject (readonly)

Returns the value of attribute start_line

Returns:

  • the current value of start_line



104
105
106
# File 'lib/pikuri/extractor.rb', line 104

def start_line
  @start_line
end

#total_linesObject (readonly)

Returns the value of attribute total_lines

Returns:

  • the current value of total_lines



104
105
106
# File 'lib/pikuri/extractor.rb', line 104

def total_lines
  @total_lines
end