Fixed #131 : Implement ExprToConditions

Fixed #130 : ArithmeticOperatorParser
Fixed #129 : python_wrapper : create_namespace
Fixed #128 : ExpressionParser: Cannot parse func(x) infixed concept 'xxx'
This commit is contained in:
2021-10-13 16:06:57 +02:00
parent a61a1c0d2b
commit 89e1f20975
76 changed files with 5867 additions and 3206 deletions
-1
View File
@@ -661,7 +661,6 @@ as:
]
sheerka = self.init_scenario(init, global_truth=True)
context = self.get_context(sheerka)
res = sheerka.evaluate_user_input("twenty one")
assert len(res) == 1
@@ -69,9 +69,9 @@ class TestSheerkaNonRegPipeFunctions(TestUsingMemoryBasedSheerka):
def test_i_can_collect_properties(self):
init = [
"def concept one as 1",
"def concept isa from x is a y def_var x def_var y",
"def concept is_a from x is a y def_var x def_var y",
"def concept plus from a plus b as a + b",
"add_to_memory('x', [one, isa, plus])"
"add_to_memory('x', [one, is_a, plus])"
]
sheerka = self.init_scenario(init)
@@ -80,6 +80,6 @@ class TestSheerkaNonRegPipeFunctions(TestUsingMemoryBasedSheerka):
assert len(res) == 1
assert res[0].status
assert sheerka.isinstance(res[0].body, BuiltinConcepts.TO_DICT)
assert res[0].body.body == {'isa': ['body', 'id', 'key', 'name', 'x', 'y'],
assert res[0].body.body == {'is_a': ['body', 'id', 'key', 'name', 'x', 'y'],
'one': ['body', 'id', 'key', 'name'],
'plus': ['a', 'b', 'body', 'id', 'key', 'name']}