/// <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)));
        }
Beispiel #3
0
 private double IsMatch(JToken jtoken)
 {
     return(MatchScores.ToScore(_patterns.Select(pattern => jtoken.SelectToken(pattern) != null)));
 }
Beispiel #4
0
        /// <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)));
        }
Beispiel #8
0
        /// <inheritdoc cref="IObjectMatcher.IsMatch"/>
        public double IsMatch(object input)
        {
            bool equals = _object != null?Equals(_object, input) : _bytes.SequenceEqual((byte[])input);

            return(MatchScores.ToScore(equals));
        }