Class: Mindee::Parsing::Standard::BaseField

Inherits:
AbstractField show all
Defined in:
lib/mindee/parsing/standard/base_field.rb

Overview

Base field object.

Instance Attribute Summary collapse

Attributes inherited from AbstractField

#bounding_box, #confidence, #page_id, #polygon

Instance Method Summary collapse

Methods inherited from AbstractField

array_confidence, array_sum, float_to_string, #to_s

Constructor Details

#initialize(prediction, page_id, reconstructed: false) ⇒ BaseField

Returns a new instance of BaseField.

Parameters:

  • prediction (Hash)
  • page_id (Integer, nil)
  • reconstructed (bool) (defaults to: false)


20
21
22
23
24
# File 'lib/mindee/parsing/standard/base_field.rb', line 20

def initialize(prediction, page_id, reconstructed: false)
  super(prediction, page_id)
  @value = prediction['value']
  @reconstructed = reconstructed
end

Instance Attribute Details

#reconstructedbool (readonly)

true if the field was reconstructed or computed using other fields.

Returns:

  • (bool)


15
16
17
# File 'lib/mindee/parsing/standard/base_field.rb', line 15

def reconstructed
  @reconstructed
end

#valueString, ... (readonly)

Returns:

  • (String, Float, Integer, bool)


12
13
14
# File 'lib/mindee/parsing/standard/base_field.rb', line 12

def value
  @value
end