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); }
private bool Answered(FacetQuestion pendingQuestion, string messageText) { var simplifiedMessageText = StringWithoutSpaceAndOnlyWithAlphanumericCharacters(messageText); return(pendingQuestion.FacetValues.Any(facet => simplifiedMessageText.Contains(StringWithoutSpaceAndOnlyWithAlphanumericCharacters(facet), StringComparison.InvariantCultureIgnoreCase))); }
public FacetQuestionResultBuilder WithFacetQuestion(FacetQuestion facetQuestion) { this._facetQuestion = facetQuestion; return(this); }
private FacetQuestionResultBuilder() { this._facetQuestion = FacetQuestionBuilder.Build.Instance; this._score = 0.75; }