Class: Datalab::OcrPage

Inherits:
Object
  • Object
show all
Defined in:
lib/datalab/ocr_page.rb

Instance Method Summary collapse

Constructor Details

#initialize(attributes) ⇒ OcrPage

Returns a new instance of OcrPage.



3
4
5
# File 'lib/datalab/ocr_page.rb', line 3

def initialize( attributes )
  @attributes = attributes&.dup || {}
end

Instance Method Details

#bounding_rectangleObject



19
20
21
# File 'lib/datalab/ocr_page.rb', line 19

def bounding_rectangle 
  @attributes[ :image_bbox ]
end

#languagesObject



11
12
13
# File 'lib/datalab/ocr_page.rb', line 11

def languages 
  @attributes[ :languages ]
end

#numberObject



15
16
17
# File 'lib/datalab/ocr_page.rb', line 15

def number
  @attributes[ :page ]
end

#text_linesObject



7
8
9
# File 'lib/datalab/ocr_page.rb', line 7

def text_lines 
  ( @attributes[ :text_lines ] || [] ).map( &OcrTextLine.method( :new ) ) 
end