Example #1
0
		/// <summary>Implemented as
		/// <code>state.getBoost()*lengthNorm(numTerms)</code>, where
		/// <code>numTerms</code> is {@link FieldInvertState#GetLength()} if {@link
		/// #setDiscountOverlaps} is false, else it's {@link
		/// FieldInvertState#GetLength()} - {@link
		/// FieldInvertState#GetNumOverlap()}.
		/// 
		/// <p/><b>WARNING</b>: This API is new and experimental, and may suddenly
		/// change.<p/> 
		/// </summary>
		public override float ComputeNorm(System.String field, FieldInvertState state)
		{
			int numTerms;
			if (discountOverlaps)
				numTerms = state.GetLength() - state.GetNumOverlap();
			else
				numTerms = state.GetLength();
			return (float) (state.GetBoost() * LengthNorm(field, numTerms));
		}
Example #2
0
        /// <summary>Implemented as
        /// <code>state.getBoost()*lengthNorm(numTerms)</code>, where
        /// <code>numTerms</code> is {@link FieldInvertState#GetLength()} if {@link
        /// #setDiscountOverlaps} is false, else it's {@link
        /// FieldInvertState#GetLength()} - {@link
        /// FieldInvertState#GetNumOverlap()}.
        ///
        /// <p/><b>WARNING</b>: This API is new and experimental, and may suddenly
        /// change.<p/>
        /// </summary>
        public override float ComputeNorm(System.String field, FieldInvertState state)
        {
            int numTerms;

            if (discountOverlaps)
            {
                numTerms = state.GetLength() - state.GetNumOverlap();
            }
            else
            {
                numTerms = state.GetLength();
            }
            return((float)(state.GetBoost() * LengthNorm(field, numTerms)));
        }
Example #3
0
 public override float ComputeNorm(System.String fieldName, FieldInvertState state)
 {
     return(delegee.ComputeNorm(fieldName, state));
 }
Example #4
0
 /// <summary> Compute the normalization value for a field, given the accumulated
 /// state of term processing for this field (see {@link FieldInvertState}).
 ///
 /// <p/>Implementations should calculate a float value based on the field
 /// state and then return that value.
 ///
 /// <p/>For backward compatibility this method by default calls
 /// {@link #LengthNorm(String, int)} passing
 /// {@link FieldInvertState#GetLength()} as the second argument, and
 /// then multiplies this value by {@link FieldInvertState#GetBoost()}.<p/>
 ///
 /// <p/><b>WARNING</b>: This API is new and experimental and may
 /// suddenly change.<p/>
 ///
 /// </summary>
 /// <param name="field">field name
 /// </param>
 /// <param name="state">current processing state for this field
 /// </param>
 /// <returns> the calculated float norm
 /// </returns>
 public virtual float ComputeNorm(System.String field, FieldInvertState state)
 {
     return((float)(state.GetBoost() * LengthNorm(field, state.GetLength())));
 }
Example #5
0
		public override float ComputeNorm(System.String fieldName, FieldInvertState state)
		{
			return delegee.ComputeNorm(fieldName, state);
		}
Example #6
0
		/// <summary> Compute the normalization value for a field, given the accumulated
		/// state of term processing for this field (see {@link FieldInvertState}).
		/// 
		/// <p/>Implementations should calculate a float value based on the field
		/// state and then return that value.
		/// 
		/// <p/>For backward compatibility this method by default calls
		/// {@link #LengthNorm(String, int)} passing
		/// {@link FieldInvertState#GetLength()} as the second argument, and
		/// then multiplies this value by {@link FieldInvertState#GetBoost()}.<p/>
		/// 
		/// <p/><b>WARNING</b>: This API is new and experimental and may
		/// suddenly change.<p/>
		/// 
		/// </summary>
		/// <param name="field">field name
		/// </param>
		/// <param name="state">current processing state for this field
		/// </param>
		/// <returns> the calculated float norm
		/// </returns>
		public virtual float ComputeNorm(System.String field, FieldInvertState state)
		{
			return (float) (state.GetBoost() * LengthNorm(field, state.GetLength()));
		}