Beispiel #1
0
        internal static void Print(Ranked <RuleQuestions.StructuredInterpretation> interpretation)
        {
            Print("STRUCTURED INTERPRETATION", CaptionColor);
            PrintLine(" rank: " + interpretation.Rank, ActiveColor);
            PrintLine(interpretation.Value.FeatureKey, ActiveColor);
            Indent(1);

            PrintLine("GENERAL: ", OperatorColor);
            Indent(1);
            foreach (var constraint in interpretation.Value.GeneralConstraints)
            {
                PrintLine(constraint, NodeColor);
            }
            Indent(-1);

            PrintLine("DISAMBIGUATION: ", OperatorColor);
            Indent(1);
            foreach (var constraint in interpretation.Value.DisambiguationConstraints)
            {
                PrintLine(constraint, NodeColor);
            }
            Indent(-1);

            Indent(-1);
        }
Beispiel #2
0
 public int CompareTo(Ranked <T> other)
 {
     return(other.Rank.CompareTo(Rank));
 }
        /// <summary>
        /// Creates receive result which reports the answer.
        /// </summary>
        /// <param name="answer">The answer.</param>
        /// <returns>The created result.</returns>
        internal static QuestionAnswerReceiveResult From(Ranked <IEnumerable <NodeReference> > answer)
        {
            var entities = answer.Value.Select(s => s.Data);

            return(new QuestionAnswerReceiveResult(false, true, entities, answer.Rank));
        }