Class: Mindee::Parsing::Standard::AddressField

Inherits:
StringField show all
Defined in:
lib/mindee/parsing/standard/address_field.rb

Overview

Represents physical-address information.

Instance Attribute Summary collapse

Attributes inherited from StringField

#raw_value, #value

Attributes inherited from BaseField

#reconstructed, #value

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 = nil, reconstructed: false) ⇒ AddressField

Returns a new instance of AddressField.



35
36
37
38
39
40
41
42
43
44
45
# File 'lib/mindee/parsing/standard/address_field.rb', line 35

def initialize(prediction, page_id = nil, reconstructed: false)
  super
  @street_number = prediction['street_number']
  @street_name = prediction['street_name']
  @po_box = prediction['po_box']
  @address_complement = prediction['address_complement']
  @city = prediction['city']
  @postal_code = prediction['postal_code']
  @state = prediction['state']
  @country = prediction['country']
end

Instance Attribute Details

#address_complementString? (readonly)

Address complement

Returns:

  • (String, nil)


21
22
23
# File 'lib/mindee/parsing/standard/address_field.rb', line 21

def address_complement
  @address_complement
end

#cityString? (readonly)

City name.

Returns:

  • (String, nil)


24
25
26
# File 'lib/mindee/parsing/standard/address_field.rb', line 24

def city
  @city
end

#countryString? (readonly)

Country.

Returns:

  • (String, nil)


33
34
35
# File 'lib/mindee/parsing/standard/address_field.rb', line 33

def country
  @country
end

#po_boxString? (readonly)

PO Box number

Returns:

  • (String, nil)


18
19
20
# File 'lib/mindee/parsing/standard/address_field.rb', line 18

def po_box
  @po_box
end

#postal_codeString? (readonly)

Postal or ZIP code.

Returns:

  • (String, nil)


27
28
29
# File 'lib/mindee/parsing/standard/address_field.rb', line 27

def postal_code
  @postal_code
end

#stateString? (readonly)

State, province or region.

Returns:

  • (String, nil)


30
31
32
# File 'lib/mindee/parsing/standard/address_field.rb', line 30

def state
  @state
end

#street_nameString? (readonly)

Street name

Returns:

  • (String, nil)


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

def street_name
  @street_name
end

#street_numberString? (readonly)

Street number

Returns:

  • (String, nil)


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

def street_number
  @street_number
end