请允许我指出以下几类(具有其可能的价值):
animal: any, cat, dog
color: any, white, black, gray
gender: any, male, female
[...]
或更一般地说,......
category: <array of values>
(1) 让我说,我有一套可预见的规则,例如:
when animal is any, color is gray, gender is male, call x
when animal is dog, color is gray, gender is male, call y
when animal is any, color is any, gender is any, call z
[...]
(2) And some input values.
Q. 是否有算法根据所提供的投入解决寻找匹配规则的问题(优先采用最具体的规则)?
页: 1
input (animal:dog, color:gray, gender:male)
它称为“y”
页: 1
input (color:gray, gender:female)
“z”
这样做的更适当方式是,根据规则(每级树木为一类)建造一个树苗?
如:
- any animal
- any color
- any gender => z
- gray
- male => x
- dog
- gray
- male => y
这样做是否有更好的办法?
感谢!