lib/browser_web_data_entity_sumarization/entity_sumarization_predicates_similarity.rb
###
# The method helps to recognize if is already marked as identical properties
#
# @param [Array<String>, String] value
#
# @return [String, NilClass]
The method helps to recognize if is already marked as identical properties
The method helps to recognize if is already marked as identical properties
def find_identical(value)
        raise RuntimeError.new('No support identify identical for more than 2 predicates.') if value.is_a?(Array) && value.size >2
        predicates_key = case value
                           when Array
                             value = value.map { |v| PredicatesSimilarity.get_key(v) }
                             @identical_predicates.find { |p|
                               p[value[0]] && p[value[1]]
                             }
                           else
                             value = PredicatesSimilarity.get_key(value)
                             @identical_predicates.find { |p|
                               p[value]
                             }
                         end
        PredicatesSimilarity.parse_key(predicates_key)
      end
def find_identical ( value ) raise RuntimeError . new ( 'No support identify identical for more than 2 predicates.' ) if value . is_a? ( Array ) && value . size > 2 predicates_key = case value when Array value = value . map { | v | PredicatesSimilarity . get_key ( v ) } @identical_predicates . find { | p | p [ value [ 0 ] ] && p [ value [ 1 ] ] } else value = PredicatesSimilarity . get_key ( value ) @identical_predicates . find { | p | p [ value ] } end PredicatesSimilarity . parse_key ( predicates_key ) end
The method helps to recognize if is already marked as identical properties
The method helps to recognize if is already marked as identical properties
None
String, NilClass
value
<not_specific>
<not_specific>
None