Method: IiifPrint::TextExtraction::HOCRReader::HOCRDocStream#initialize
- Defined in:
- lib/iiif_print/text_extraction/hocr_reader.rb
#initialize ⇒ HOCRDocStream
Returns a new instance of HOCRDocStream.
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/iiif_print/text_extraction/hocr_reader.rb', line 18 def initialize super() # plain text buffer: @text = '' # list of word hash, containing word+coord: @words = [] # page width and height to be found in hOCR for `div.ocr_page` @width = nil @height = nil # to hold current word data state across #start_element, #characters, # and #end_element methods (to associate word with coordinates). @current = nil # to preserve element classname from start to use by #end_element @element_class_name = nil end |