Class: Mindee::V2::Product::OCR::OCRWord
- Defined in:
- lib/mindee/v2/product/ocr/ocr_word.rb,
sig/mindee/v2/product/ocr/ocr_word.rbs
Overview
OCR result for a single word extracted from the document page.
Instance Attribute Summary collapse
-
#content ⇒ String
readonly
Text content of the word.
-
#polygon ⇒ Mindee::Geometry::Polygon
readonly
Position information as a list of points in clockwise order.
Instance Method Summary collapse
-
#initialize(server_response) ⇒ OCRWord
constructor
A new instance of OCRWord.
-
#to_s ⇒ String
String representation.
Constructor Details
#initialize(server_response) ⇒ OCRWord
Returns a new instance of OCRWord.
15 16 17 18 |
# File 'lib/mindee/v2/product/ocr/ocr_word.rb', line 15 def initialize(server_response) @content = server_response['content'] @polygon = Mindee::Geometry::Polygon.new(server_response['polygon']) end |
Instance Attribute Details
#content ⇒ String (readonly)
Returns Text content of the word.
10 11 12 |
# File 'lib/mindee/v2/product/ocr/ocr_word.rb', line 10 def content @content end |
#polygon ⇒ Mindee::Geometry::Polygon (readonly)
Returns Position information as a list of points in clockwise order.
12 13 14 |
# File 'lib/mindee/v2/product/ocr/ocr_word.rb', line 12 def polygon @polygon end |
Instance Method Details
#to_s ⇒ String
String representation.
22 23 24 |
# File 'lib/mindee/v2/product/ocr/ocr_word.rb', line 22 def to_s @content end |