private IList <QueryResponse> Evaluate(string data) { //var modelSaver = new SimpleModelSaver(); var parseResult = Parser.Parse(data); var succ = Assert.IsType <ParseResult.Success>(parseResult); return(AlgorithmRunner.EvaluateQueries(succ).queryResults); }
/// <summary> /// Compute button onclick handler /// </summary> public async void Compute() { try { var result = Business.Parsing.Parser.Parse(InputTextSentence + Environment.NewLine + InputTextScenario + Environment.NewLine + InputTextQuery); switch (result) { case ParseResult.Success success: var results = AlgorithmRunner.EvaluateQueries(success); OutputText = string.Join("\n", results.queryResults.Select(q => q.Response).ToArray()); AlgorithmResult = new AlgorithmResultModel(results.modelsByScenario, results.extracted); break; case ParseResult.Failure failure: await ShowError(BuildErrorMessage(failure)); break; } } catch (Exception ex) { await ShowError(ex.Message); } }