Fixed #68: Implement SheerkaQL
Fixed #70: SheerkaFilterManager : Pipe functions Fixed #71: SheerkaFilterManager : filter_objects Fixed #75: SheerkaMemory: Enhance memory() to use the filtering capabilities Fixed #76: SheerkaEvaluateConcept: Concepts that modify the state of the system must not be evaluated during question
This commit is contained in:
@@ -16,6 +16,7 @@ from parsers.BaseNodeParser import UnrecognizedTokensNode, SourceCodeNode, RuleN
|
||||
from parsers.FunctionParser import FunctionNode
|
||||
from parsers.PythonParser import PythonNode
|
||||
from parsers.SyaNodeParser import SyaConceptParserHelper
|
||||
from sheerkapython.python_wrapper import sheerka_globals
|
||||
from sheerkarete.common import V
|
||||
from sheerkarete.conditions import Condition, AndConditions, NegatedCondition, NegatedConjunctiveConditions
|
||||
|
||||
@@ -934,11 +935,18 @@ class FN:
|
||||
|
||||
@dataclass()
|
||||
class NEGCOND:
|
||||
"""
|
||||
Represents a NegatedCondition
|
||||
"""
|
||||
condition: str
|
||||
|
||||
|
||||
@dataclass()
|
||||
class NCCOND:
|
||||
"""
|
||||
Represents a NegatedConjunctiveConditions
|
||||
"""
|
||||
|
||||
conditions: List[str]
|
||||
|
||||
|
||||
@@ -1319,11 +1327,8 @@ def get_rete_conditions(*conditions):
|
||||
def get_value(obj):
|
||||
if obj.startswith("#"):
|
||||
return V(obj[1:])
|
||||
if obj.startswith("'"):
|
||||
return obj[1:-1]
|
||||
if obj in ("True", "False"):
|
||||
return obj == "True"
|
||||
return int(obj)
|
||||
|
||||
return eval(obj, sheerka_globals)
|
||||
|
||||
res = []
|
||||
for cond in conditions:
|
||||
|
||||
Reference in New Issue
Block a user