Exemple #1
0
def main(data):

    data = expand_data(data)

    rules = json.load(open(const101.rulesDump))

    interpretRules.apply_rules(data['data'], rules, lambda rule: not any(filter(lambda key: key in ('predicate', 'fpredicate', 'content', 'locator'), rule['rule'].keys())), False)
Exemple #2
0
def main(data):
    print data
    data = expand_data(data)

    rules = json.load(open(const101.rulesDump))

    fpredicate_rules = interpretRules.group_fast_predicates(rules)


    interpretRules.apply_rules(data['data'], fpredicate_rules, lambda rule: rule['rule']['fpredicate'] == "technologies/fpredicate_generic_platform/import.py", append=True)
Exemple #3
0
def main(data):
    print 'match tokens'

    logging.basicConfig(filename='matchSimpleRules.log',level=logging.DEBUG)

    data = expand_data(data)

    rules = json.load(open(const101.rulesDump))
    fpredicate_rules = interpretRules.group_fast_predicates(rules)
    print fpredicate_rules

    interpretRules.apply_rules(data['data'], fpredicate_rules, lambda rule: lambda rule: rule['rule']['fpredicate'] == "technologies/fpredicate_generic_platform/tokens.py", append=True)
Exemple #4
0
def main(data):
    print data
    data = expand_data(data)

    rules = json.load(open(const101.rulesDump))

    fpredicate_rules = interpretRules.group_fast_predicates(rules)

    interpretRules.apply_rules(
        data['data'],
        fpredicate_rules,
        lambda rule: rule['rule']['fpredicate'] ==
        "technologies/fpredicate_generic_platform/import.py",
        append=True)
Exemple #5
0
def main(data):
    print 'match tokens'

    logging.basicConfig(filename='matchSimpleRules.log', level=logging.DEBUG)

    data = expand_data(data)

    rules = json.load(open(const101.rulesDump))
    fpredicate_rules = interpretRules.group_fast_predicates(rules)
    print fpredicate_rules

    interpretRules.apply_rules(
        data['data'],
        fpredicate_rules,
        lambda rule: lambda rule: rule['rule']['fpredicate'] ==
        "technologies/fpredicate_generic_platform/tokens.py",
        append=True)