コード例 #1
0
        /// <inheritdoc cref="IStringMatcher.IsMatch"/>
        public double IsMatch(string input)
        {
            string jsonInput = "" + JsonConvert.DeserializeObject(input);

            return(MatchScores.ToScore(_jsons.Select(value => value.Equals(jsonInput))));
        }
コード例 #2
0
        /// <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)));
        }
コード例 #3
0
 private double IsMatch(JToken jtoken)
 {
     return(MatchScores.ToScore(_patterns.Select(pattern => jtoken.SelectToken(pattern) != null)));
 }
コード例 #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)))));
        }
コード例 #5
0
 /// <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))));
 }
コード例 #6
0
 /// <inheritdoc cref="IStringMatcher.IsMatch"/>
 public double IsMatch(string input)
 {
     return(MatchScores.ToScore(_values.Select(value => value.Equals(input))));
 }
コード例 #7
0
        /// <inheritdoc cref="IStringMatcher.IsMatch"/>
        public double IsMatch(string input)
        {
            var match = !string.IsNullOrEmpty(input);

            return(MatchBehaviourHelper.Convert(MatchBehaviour, MatchScores.ToScore(match)));
        }
コード例 #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));
        }