Class: AmazonTRP::FieldKey
- Inherits:
-
Object
- Object
- AmazonTRP::FieldKey
- Defined in:
- lib/amazon-textract-parser-ruby.rb
Instance Attribute Summary collapse
-
#block ⇒ Object
readonly
Returns the value of attribute block.
-
#confidence ⇒ Object
readonly
Returns the value of attribute confidence.
-
#content ⇒ Object
readonly
Returns the value of attribute content.
-
#geometry ⇒ Object
readonly
Returns the value of attribute geometry.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#text ⇒ Object
readonly
Returns the value of attribute text.
Instance Method Summary collapse
-
#initialize(block, children, blockMap) ⇒ FieldKey
constructor
A new instance of FieldKey.
- #to_s ⇒ Object
Constructor Details
#initialize(block, children, blockMap) ⇒ FieldKey
Returns a new instance of FieldKey.
156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 |
# File 'lib/amazon-textract-parser-ruby.rb', line 156 def initialize(block, children, blockMap) @block = block @confidence = block[:confidence] @geometry = Geometry.new(block[:geometry]) @id = block[:id] @text = "" @content = [] t = [] children.each do |eid| wb = blockMap[eid] if wb[:block_type] == "WORD" w = Word.new(wb, blockMap) @content.append(w) t.append(w.text) end end @text = t.join(' ') if t end |
Instance Attribute Details
#block ⇒ Object (readonly)
Returns the value of attribute block.
154 155 156 |
# File 'lib/amazon-textract-parser-ruby.rb', line 154 def block @block end |
#confidence ⇒ Object (readonly)
Returns the value of attribute confidence.
149 150 151 |
# File 'lib/amazon-textract-parser-ruby.rb', line 149 def confidence @confidence end |
#content ⇒ Object (readonly)
Returns the value of attribute content.
152 153 154 |
# File 'lib/amazon-textract-parser-ruby.rb', line 152 def content @content end |
#geometry ⇒ Object (readonly)
Returns the value of attribute geometry.
150 151 152 |
# File 'lib/amazon-textract-parser-ruby.rb', line 150 def geometry @geometry end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
151 152 153 |
# File 'lib/amazon-textract-parser-ruby.rb', line 151 def id @id end |
#text ⇒ Object (readonly)
Returns the value of attribute text.
153 154 155 |
# File 'lib/amazon-textract-parser-ruby.rb', line 153 def text @text end |
Instance Method Details
#to_s ⇒ Object
176 177 178 |
# File 'lib/amazon-textract-parser-ruby.rb', line 176 def to_s @text end |