Module: Mindee::Parsing::Generated

Included in:
GeneratedListField, Mindee::Product::Generated::GeneratedV1PagePrediction, Mindee::Product::Generated::GeneratedV1Prediction
Defined in:
lib/mindee.rb,
lib/mindee/parsing/generated/generated_list_field.rb,
lib/mindee/parsing/generated/generated_object_field.rb

Overview

Generated fields and functions.

Defined Under Namespace

Classes: GeneratedListField, GeneratedObjectField

Class Method Summary collapse

Class Method Details

.generated_object?(str_dict) ⇒ Boolean

Returns:

  • (Boolean)


93
94
95
96
97
98
99
100
101
102
103
104
105
106
# File 'lib/mindee/parsing/generated/generated_object_field.rb', line 93

def self.generated_object?(str_dict)
  common_keys = [
    'value',
    'polygon',
    'rectangle',
    'page_id',
    'confidence',
    'quadrangle',
    'values',
    'raw_value',
  ]
  str_dict.each_key { |key| return true unless common_keys.include?(key) }
  false
end