Implement a named tuple in place of the input vector (close to the R Sets package) :
# Convert named tuple to array
inputs_names = [:service, :food]
r(val) = [haskey(val, i) ? getindex(val, i) : "" for i in inputs_names]
rule1 = Rule(r((service="poor", food = "rancid")), "cheap", "MAX")
rule2 = Rule(r((service="good",)), "average")
rule3 = Rule(r((service="excellent", food = "delicious")), "generous", "MAX")
rules = [rule1, rule2, rule3]
I don't know if this syntax could be relevant for others?
Originally posted by @pierrethiriet in #12 (comment)
Implement a named tuple in place of the input vector (close to the R Sets package) :
I don't know if this syntax could be relevant for others?
Originally posted by @pierrethiriet in #12 (comment)