/// <inheritdoc cref="IStringMatcher.IsMatch"/> public double IsMatch(string input) { string jsonInput = "" + JsonConvert.DeserializeObject(input); return(MatchScores.ToScore(_jsons.Select(value => value.Equals(jsonInput)))); }
/// <inheritdoc cref="IObjectMatcher.IsMatch"/> public double IsMatch(object input) { bool equals = _object != null?Equals(_object, input) : _bytes.SequenceEqual((byte[])input); return(MatchBehaviourHelper.Convert(MatchBehaviour, MatchScores.ToScore(equals))); }
private double IsMatch(JToken jtoken) { return(MatchScores.ToScore(_patterns.Select(pattern => jtoken.SelectToken(pattern) != null))); }
/// <inheritdoc cref="IStringMatcher.IsMatch"/> public double IsMatch(string input) { IStringMetric m = GetStringMetricType(); return(MatchBehaviourHelper.Convert(MatchBehaviour, MatchScores.ToScore(_patterns.Select(p => m.GetSimilarity(p, input))))); }
/// <inheritdoc cref="IStringMatcher.IsMatch"/> public double IsMatch(string jsonInput) { System.Text.RegularExpressions.Regex patn = new System.Text.RegularExpressions.Regex(_regexes[0]); return(MatchScores.ToScore(_regexes.Select(patnvalue => (new System.Text.RegularExpressions.Regex(patnvalue)).IsMatch(jsonInput)))); }
/// <inheritdoc cref="IStringMatcher.IsMatch"/> public double IsMatch(string input) { return(MatchScores.ToScore(_values.Select(value => value.Equals(input)))); }
/// <inheritdoc cref="IStringMatcher.IsMatch"/> public double IsMatch(string input) { var match = !string.IsNullOrEmpty(input); return(MatchBehaviourHelper.Convert(MatchBehaviour, MatchScores.ToScore(match))); }
/// <inheritdoc cref="IObjectMatcher.IsMatch"/> public double IsMatch(object input) { bool equals = _object != null?Equals(_object, input) : _bytes.SequenceEqual((byte[])input); return(MatchScores.ToScore(equals)); }