Class: Mindee::Parsing::Common::Extras::FullTextOCRExtra

Inherits:
Object
  • Object
show all
Defined in:
lib/mindee/parsing/common/extras/full_text_ocr_extra.rb

Overview

Full Text OCR result.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(raw_prediction) ⇒ FullTextOCRExtra



18
19
20
21
22
23
# File 'lib/mindee/parsing/common/extras/full_text_ocr_extra.rb', line 18

def initialize(raw_prediction)
  @contents = raw_prediction['content'] if raw_prediction['content']
  return unless raw_prediction['language']

  @language = raw_prediction['language']
end

Instance Attribute Details

#contentsString? (readonly)

Contents of the full text OCR result.



13
14
15
# File 'lib/mindee/parsing/common/extras/full_text_ocr_extra.rb', line 13

def contents
  @contents
end

#languageString? (readonly)

Language used on the page.



16
17
18
# File 'lib/mindee/parsing/common/extras/full_text_ocr_extra.rb', line 16

def language
  @language
end

Instance Method Details

#to_sString



26
27
28
# File 'lib/mindee/parsing/common/extras/full_text_ocr_extra.rb', line 26

def to_s
  @contents || ''
end