class Mindee::Parsing::Common::OCR::OCRWord

A single word.

def initialize(prediction)

Parameters:
  • prediction (Hash) --
def initialize(prediction)
  @text = prediction['text']
  @confidence = prediction['confidence']
  @polygon = Geometry.polygon_from_prediction(prediction['polygon'])
  @bounding_box = Geometry.get_bounding_box(@polygon) unless @polygon.nil? || @polygon.empty?
end

def to_s

Returns:
  • (String) -
def to_s
  @text.to_s
end