コード例 #1
0
        private bool DidAgentAskQuestion(string agentMessage, FacetQuestion clickedFacetQuestion)
        {
            var simplifiedAgentMessage = StringWithoutSpaceAndOnlyWithAlphanumericCharacters(agentMessage);

            int matchesFound = 0;

            if (simplifiedAgentMessage.Contains(StringWithoutSpaceAndOnlyWithAlphanumericCharacters(clickedFacetQuestion.FacetName), StringComparison.InvariantCultureIgnoreCase))
            {
                matchesFound++;
            }

            foreach (var facetValue in clickedFacetQuestion.FacetValues)
            {
                if (simplifiedAgentMessage.Contains(StringWithoutSpaceAndOnlyWithAlphanumericCharacters(facetValue), StringComparison.InvariantCultureIgnoreCase))
                {
                    matchesFound++;
                }
            }

            return(matchesFound >= 2);
        }
コード例 #2
0
        private bool Answered(FacetQuestion pendingQuestion, string messageText)
        {
            var simplifiedMessageText = StringWithoutSpaceAndOnlyWithAlphanumericCharacters(messageText);

            return(pendingQuestion.FacetValues.Any(facet => simplifiedMessageText.Contains(StringWithoutSpaceAndOnlyWithAlphanumericCharacters(facet), StringComparison.InvariantCultureIgnoreCase)));
        }
コード例 #3
0
 public FacetQuestionResultBuilder WithFacetQuestion(FacetQuestion facetQuestion)
 {
     this._facetQuestion = facetQuestion;
     return(this);
 }
コード例 #4
0
 private FacetQuestionResultBuilder()
 {
     this._facetQuestion = FacetQuestionBuilder.Build.Instance;
     this._score         = 0.75;
 }