示例#1
0
        public LexicalMatch Match(string value)
        {
            var x = _canonicalForm.Key;
            var y = Comparer.Normalize(value);

            if (Comparer.Equals(x, y))
            {
                return(new LexicalMatch(this));
            }

            if (Synonyms.Contains(y))
            {
                return(new LexicalMatch(this));
            }

            return(null);
        }
示例#2
0
        public bool Matches(IParameterInput parameter)
        {
            if (parameter.Name == null)
            {
                if (parameter.PositionIndex != PositionIndex)
                {
                    return(false);
                }

                if (SupportsAssignmentByPositionIndex)
                {
                    return(true);
                }

                throw new NotSupportedException(
                          $"{Name} parameter doesn't support position assignment by index");
            }

            return(Name != null &&
                   (Name.Equals(parameter.Name, StringComparison.OrdinalIgnoreCase) || Synonyms.Contains(parameter.Name)));
        }