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

Inherits:
Object
  • Object
show all
Defined in:
lib/mindee/v1/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

Returns a new instance of FullTextOCRExtra.



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

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.

Returns:

  • (String, nil)


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

def contents
  @contents
end

#languageString? (readonly)

Language used on the page.

Returns:

  • (String, nil)


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

def language
  @language
end

Instance Method Details

#to_sString

Returns:

  • (String)


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

def to_s
  @contents || ''
end