# ----------------------------------------------------------------------- # Copyright © 2012 ShepHertz Technologies Pvt Ltd. All rights reserved. # ----------------------------------------------------------------------- require 'App42Response.rb' # # An enum that contains 2 types of the Recommender Similarity either EuclideanDistanceSimilarity or PearsonCorrelationSimilarity. # # module App42 module Recommend class RecommenderSimilarity < App42Response unless (const_defined?(:EUCLIDEAN_DISTANCE)) EUCLIDEAN_DISTANCE = "EuclideanDistanceSimilarity" end unless (const_defined?(:PEARSON_CORRELATION)) PEARSON_CORRELATION = "PearsonCorrelationSimilarity" end # # Sets the value of the Recommender Similarity. EuclideanDistanceSimilarity # or PearsonCorrelationSimilarity. # # @param string # - the string of Recommender Similarity either EuclideanDistanceSimilarity or PearsonCorrelationSimilarity. # def enum(string) return RecommenderSimilarity.const_get(string) end # # Returns the value of Recommender Similarity either EuclideanDistanceSimilarity or PearsonCorrelationSimilarity. # # @return the value of Recommender Similarity. # # def isAvailable(string) if(string == "EuclideanDistanceSimilarity") return "EUCLIDEAN_DISTANCE" elsif(string == "PearsonCorrelationSimilarity") return "PEARSON_CORRELATION"; else return nil end end end end end