Exemple #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);
        }
Exemple #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);
        }
Exemple #5
0
        public IWeightedTermConstructionFlow PrefixTerm(string prefix)
        {
            var operand = SearchConditionNodeFactory.CreatePrefixTerm(rootOperator, prefix);

            weightedOperands.Add(operand, null);
            return(this);
        }
Exemple #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)));
        }
Exemple #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);
        }
Exemple #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);
        }
Exemple #9
0
        public IWeightedTermConstructionFlow PrefixTerm(string prefix, float weight)
        {
            EnsureWeightIsCorrect(weight);
            var operand = SearchConditionNodeFactory.CreatePrefixTerm(rootOperator, prefix);

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

            weightedOperands.Add(operand, weight);
            return(this);
        }
Exemple #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));
        }
Exemple #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));
        }
Exemple #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>();
 }
Exemple #15
0
 /// <inheritdoc/>
 public IProximityOperand PrefixTerm(string prefix)
 {
     return(SearchConditionNodeFactory.CreatePrefixTerm(this, prefix));
 }
Exemple #16
0
 /// <inheritdoc/>
 public IGenerationTerm GenerationTerm(GenerationType generationType, ICollection <string> terms)
 {
     return(SearchConditionNodeFactory.CreateGenerationTerm(this, generationType, terms));
 }
 /// <inheritdoc/>
 public IOperator AndNot()
 {
     return(SearchConditionNodeFactory.CreateAndNot(this));
 }
 /// <inheritdoc/>
 public IOperator Or()
 {
     return(SearchConditionNodeFactory.CreateOr(this));
 }
Exemple #19
0
 /// <inheritdoc/>
 public IProximityOperand SimpleTerm(string term)
 {
     return(SearchConditionNodeFactory.CreateSimpleTerm(this, term));
 }
Exemple #20
0
 internal WeightedTermEndpoint()
 {
     rootOperator     = SearchConditionNodeFactory.CreateConditonRoot();
     weightedOperands = new Dictionary <IWeighableTerm, float?>();
 }