Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changes in sintax #14

Open
phelipe opened this issue Jul 20, 2021 · 0 comments
Open

Changes in sintax #14

phelipe opened this issue Jul 20, 2021 · 0 comments

Comments

@phelipe
Copy link
Owner

phelipe commented Jul 20, 2021

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant