c# - Math model for determining more relevance set of rules -
i have string input data, it's request. there set of rules applying input string. so, instance, rule can "input parameter1 equals bla-bla-bla" or "input parameter2 contains bla-bla-bla".
the rules has "strength". example, "equals" rule has more strength "contains" rule. want develop algotihm or math model evaluate strength of rule sets.
really, i'm looking more theoretical answer. links, articles, books appreciated.
the reason of concept of strength have rule "parameter1 contains value 'google'" , rule tells "parameter1 equals value 'google'". second selected, because it's more expressive such input data.
although i'm not quite sure type of answer you're looking for, here goes:
one way of implementing assume order of rules in rules definition implies strength.
this mean first rule matches best , strongest match. shortest path complete proof of concept use regexes.
parameter1 = /^match this$/ #this more important partialwordfragment parameter2 = \bcontainsthisword\b parameter1 = partialwordfragment
then load regexes , execute them on associated parameters. once match found, stop executing rules parameter.
Comments
Post a Comment