/// <inheritdoc/> public QuestionAnswerReceiveResult ReceiveQuestionPart(IEnumerable <TurnLog> questionTurns) { var answer = _module.GetRankedAnswer(questionTurns.Last().Text, _pool); if (answer.Rank < 0.8) { return(QuestionAnswerReceiveResult.HintNeeded(answer.Rank)); } return(QuestionAnswerReceiveResult.From(answer)); }
/// <inheritdoc/> public QuestionAnswerReceiveResult ReceiveAnswerPart(IEnumerable <TurnLog> answerTurns) { var lastTurn = answerTurns.Last(); var parsedUtterance = UtteranceParser.Parse(lastTurn.Text); foreach (var word in parsedUtterance.Words) { if (_pool.Graph.HasEvidence(word)) { var answer = new[] { _pool.Graph.GetNode(word) }; return(QuestionAnswerReceiveResult.From(new Ranked <IEnumerable <NodeReference> >(answer, 1.0))); } } throw new NotImplementedException("Parse answer"); }