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

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

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

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