Exemplo n.º 1
0
        private SemanticItem _field_simplified(ModuleContext context)
        {
            var answer           = _body.InputHistory.Last();
            var simplifiedAnswer = context.GetAnswer(Question.HowToSimplify, answer);

            if (simplifiedAnswer == null)
            {
                simplifiedAnswer = SemanticItem.Entity(answer);
            }
            else
            {
                simplifiedAnswer = SemanticItem.Entity(simplifiedAnswer.InstantiateWithEntityVariables(simplifiedAnswer.Answer));
            }

            return(simplifiedAnswer);
        }
        private SemanticItem _countValue(ModuleContext context)
        {
            var numberValue = context.Input;

            if (!int.TryParse(numberValue, out var number))
            {
                numberValue = context.GetAnswer(Question.HowToConvertItToNumber)?.Answer;
                if (numberValue == null)
                {
                    return(null);
                }

                if (!int.TryParse(numberValue, out number))
                {
                    return(null);
                }
            }


            return(SemanticItem.Entity(number.ToString()));
        }
Exemplo n.º 3
0
        private SemanticItem _param_evaluation(ModuleContext context)
        {
            var evaluation = context.GetAnswer(Question.HowToEvaluate, _body.InputHistory.Last());

            return(evaluation);
        }