Class: Mindee::V2::Product::OCR::OCRPage
- Inherits:
-
Object
- Object
- Mindee::V2::Product::OCR::OCRPage
- Defined in:
- lib/mindee/v2/product/ocr/ocr_page.rb
Overview
OCR result for a single page.
Instance Attribute Summary collapse
-
#content ⇒ String
readonly
Full text content extracted from the document page.
-
#words ⇒ Array<OCRWord>
readonly
List of words extracted from the document page.
Instance Method Summary collapse
-
#initialize(server_response) ⇒ OCRPage
constructor
A new instance of OCRPage.
-
#to_s ⇒ String
String representation.
Constructor Details
Instance Attribute Details
#content ⇒ String (readonly)
Returns Full text content extracted from the document page.
14 15 16 |
# File 'lib/mindee/v2/product/ocr/ocr_page.rb', line 14 def content @content end |
#words ⇒ Array<OCRWord> (readonly)
Returns List of words extracted from the document page.
12 13 14 |
# File 'lib/mindee/v2/product/ocr/ocr_page.rb', line 12 def words @words end |
Instance Method Details
#to_s ⇒ String
String representation.
24 25 26 27 28 |
# File 'lib/mindee/v2/product/ocr/ocr_page.rb', line 24 def to_s ocr_words = "\n" ocr_words += @words.join("\n\n") if @words&.any? "OCR Words\n======#{ocr_words}\n\n:Content: #{@content}" end |