Fixed some misbehaviours regarding question() + added #import functionality when restoring
This commit is contained in:
@@ -194,7 +194,7 @@ def resolve_ambiguity(context, concepts):
|
||||
else:
|
||||
for c in by_complexity[complexity]:
|
||||
evaluated = context.sheerka.evaluate_concept(context, c, metadata=["pre"])
|
||||
if evaluated.key == c.key:
|
||||
if context.sheerka.is_success(evaluated) or evaluated.key == c.key:
|
||||
remaining_concepts.append(c)
|
||||
|
||||
if len(remaining_concepts) > 0:
|
||||
@@ -214,6 +214,13 @@ def resolve_ambiguity(context, concepts):
|
||||
|
||||
|
||||
def get_condition_complexity(concept, concept_part_str):
|
||||
"""
|
||||
Need to find a proper algorithm to compute the complexity of a concept
|
||||
So far, the concept is considered as complex if it has pre
|
||||
:param concept:
|
||||
:param concept_part_str:
|
||||
:return:
|
||||
"""
|
||||
concept_part_value = getattr(concept.metadata, concept_part_str)
|
||||
if concept_part_value is None or concept_part_value.strip() == 0:
|
||||
return 0
|
||||
@@ -374,6 +381,7 @@ def evaluate(context,
|
||||
desc=None,
|
||||
eval_body=True,
|
||||
eval_where=True,
|
||||
is_question=False,
|
||||
expect_success=False,
|
||||
stm=None):
|
||||
"""
|
||||
@@ -384,6 +392,7 @@ def evaluate(context,
|
||||
:param desc:
|
||||
:param eval_body:
|
||||
:param eval_where:
|
||||
:param is_question:
|
||||
:param expect_success:
|
||||
:param stm: short term memories entries
|
||||
:return:
|
||||
@@ -400,6 +409,8 @@ def evaluate(context,
|
||||
|
||||
if expect_success:
|
||||
sub_context.protected_hints.add(BuiltinConcepts.EVAL_UNTIL_SUCCESS_REQUESTED)
|
||||
|
||||
if is_question:
|
||||
sub_context.protected_hints.add(BuiltinConcepts.EVAL_QUESTION_REQUESTED)
|
||||
|
||||
if stm:
|
||||
|
||||
Reference in New Issue
Block a user