Implemented a first and basic version of a Rete rule engine
This commit is contained in:
@@ -14,17 +14,17 @@ class TestRuleParser(TestUsingMemoryBasedSheerka):
|
||||
@classmethod
|
||||
def setup_class(cls):
|
||||
init_test_helper = cls().init_test(cache_only=False, ontology="#TestRuleParser#")
|
||||
sheerka, context, *updated = init_test_helper.with_rules(*my_rules).unpack()
|
||||
sheerka, context, *updated = init_test_helper.with_format_rules(*my_rules).unpack()
|
||||
|
||||
cls.shared_ontology = sheerka.get_ontology(context)
|
||||
sheerka.pop_ontology()
|
||||
sheerka.pop_ontology(context)
|
||||
|
||||
def init_parser(self, rules=None, **kwargs):
|
||||
if rules is None:
|
||||
sheerka, context = self.init_test().unpack()
|
||||
sheerka.add_ontology(context, self.shared_ontology)
|
||||
else:
|
||||
sheerka, context, *updated = self.init_test().with_rules(*rules, **kwargs).unpack()
|
||||
sheerka, context, *updated = self.init_test().with_format_rules(*rules, **kwargs).unpack()
|
||||
|
||||
parser = RuleParser()
|
||||
return sheerka, context, parser
|
||||
|
||||
Reference in New Issue
Block a user