Пример #1
0
        public IWeightedTermConstructionFlow GenerationTerm(GenerationType generationType, ICollection <string> terms)
        {
            var operand = SearchConditionNodeFactory.CreateGenerationTerm(rootOperator, generationType, terms);

            weightedOperands.Add(operand, null);
            return(this);
        }
        IProximityOperandsConstructionFlow IProximityOperandsConstructionFlow.NearSimpleTerm(string term)
        {
            var operand = SearchConditionNodeFactory.CreateSimpleTerm(rootOperator, term);

            operands.Add(operand);
            return(this);
        }
Пример #3
0
        public IWeightedTermConstructionFlow SimpleTerm(string term)
        {
            var operand = SearchConditionNodeFactory.CreateSimpleTerm(rootOperator, term);

            weightedOperands.Add(operand, null);
            return(this);
        }
        IProximityOperandsConstructionFlow IProximityOperandsConstructionFlow.NearPrefixTerm(string prefix)
        {
            var operand = SearchConditionNodeFactory.CreatePrefixTerm(rootOperator, prefix);

            operands.Add(operand);
            return(this);
        }
Пример #5
0
        public IWeightedTermConstructionFlow PrefixTerm(string prefix)
        {
            var operand = SearchConditionNodeFactory.CreatePrefixTerm(rootOperator, prefix);

            weightedOperands.Add(operand, null);
            return(this);
        }
Пример #6
0
        /// <inheritdoc/>
        public IComplexTerm ComplexTerm(Func <ConditionEndpoint, IOperand> complexTermConstructor)
        {
            ArgumentValidator.EnsureArgumentNotNull(complexTermConstructor, "complexTermConstructor");

            var endpoint = SearchConditionNodeFactory.CreateConditonRoot();

            return(SearchConditionNodeFactory.CreateComplexTerm(this, complexTermConstructor.Invoke(endpoint)));
        }
Пример #7
0
        public IWeightedTermConstructionFlow GenerationTerm(GenerationType generationType, ICollection <string> terms, float weight)
        {
            EnsureWeightIsCorrect(weight);
            var operand = SearchConditionNodeFactory.CreateGenerationTerm(rootOperator, generationType, terms);

            weightedOperands.Add(operand, weight);
            return(this);
        }
Пример #8
0
        public IWeightedTermConstructionFlow ProximityTerm(Func <ProximityOperandEndpoint, IProximityOperandsConstructionFlow> proximityComposer)
        {
            var constructionFlow = proximityComposer.Invoke(new ProximityOperandEndpoint());
            var operand          = SearchConditionNodeFactory.CreateGenericProximityTerm(rootOperator, constructionFlow.Operands);

            weightedOperands.Add(operand, null);
            return(this);
        }
Пример #9
0
        public IWeightedTermConstructionFlow PrefixTerm(string prefix, float weight)
        {
            EnsureWeightIsCorrect(weight);
            var operand = SearchConditionNodeFactory.CreatePrefixTerm(rootOperator, prefix);

            weightedOperands.Add(operand, weight);
            return(this);
        }
Пример #10
0
        public IWeightedTermConstructionFlow SimpleTerm(string term, float weight)
        {
            EnsureWeightIsCorrect(weight);
            var operand = SearchConditionNodeFactory.CreateSimpleTerm(rootOperator, term);

            weightedOperands.Add(operand, weight);
            return(this);
        }
Пример #11
0
        /// <inheritdoc/>
        public IProximityTerm GenericProximityTerm(Func <ProximityOperandEndpoint, IProximityOperandsConstructionFlow> proximityTermsConstructor)
        {
            ArgumentValidator.EnsureArgumentNotNull(proximityTermsConstructor, "proximityTermsConstructor");

            var proximityOperandRoot = new ProximityOperandEndpoint();
            var constructionFlow     = proximityTermsConstructor.Invoke(proximityOperandRoot);

            return(SearchConditionNodeFactory.CreateGenericProximityTerm(this, constructionFlow.Operands));
        }
Пример #12
0
        /// <inheritdoc/>
        public ICustomProximityTerm CustomProximityTerm(Func <ProximityOperandEndpoint, IProximityOperandsConstructionFlow> proximityTermsConstructor, long maximumDistance, bool matchOrder)
        {
            ArgumentValidator.EnsureArgumentNotNull(proximityTermsConstructor, "proximityTermsConstructor");

            var proximityOperandRoot = new ProximityOperandEndpoint();
            var constructionFlow     = proximityTermsConstructor.Invoke(proximityOperandRoot);

            return(SearchConditionNodeFactory.CreateCustomProximityTerm(this, constructionFlow.Operands, maximumDistance, matchOrder));
        }
Пример #13
0
        /// <inheritdoc/>
        public IWeightedTerm WeightedTerm(Func <WeightedTermEndpoint, IWeightedTermConstructionFlow> weightedTermsConstructor)
        {
            ArgumentValidator.EnsureArgumentNotNull(weightedTermsConstructor, "weightedTermsConstructor");

            var endpoint         = new WeightedTermEndpoint();
            var constructionFlow = weightedTermsConstructor.Invoke(endpoint);

            return(SearchConditionNodeFactory.CreateWeightedTerm(this, constructionFlow.WeightedOperands));
        }
 internal ProximityOperandEndpoint()
 {
     rootOperator = SearchConditionNodeFactory.CreateConditonRoot();
     operands     = new List <IProximityOperand>();
 }
Пример #15
0
 /// <inheritdoc/>
 public IProximityOperand PrefixTerm(string prefix)
 {
     return(SearchConditionNodeFactory.CreatePrefixTerm(this, prefix));
 }
Пример #16
0
 /// <inheritdoc/>
 public IGenerationTerm GenerationTerm(GenerationType generationType, ICollection <string> terms)
 {
     return(SearchConditionNodeFactory.CreateGenerationTerm(this, generationType, terms));
 }
Пример #17
0
 /// <inheritdoc/>
 public IOperator AndNot()
 {
     return(SearchConditionNodeFactory.CreateAndNot(this));
 }
Пример #18
0
 /// <inheritdoc/>
 public IOperator Or()
 {
     return(SearchConditionNodeFactory.CreateOr(this));
 }
Пример #19
0
 /// <inheritdoc/>
 public IProximityOperand SimpleTerm(string term)
 {
     return(SearchConditionNodeFactory.CreateSimpleTerm(this, term));
 }
Пример #20
0
 internal WeightedTermEndpoint()
 {
     rootOperator     = SearchConditionNodeFactory.CreateConditonRoot();
     weightedOperands = new Dictionary <IWeighableTerm, float?>();
 }