Lucene.Net.Misc.SweetSpotSimilarity.BaselineTf C# (CSharp) Method

BaselineTf() public method

Implemented as: (x <= min) ? base : Math.Sqrt(x+(base**2)-min) ...but with a special case check for 0.

This degrates to Math.Sqrt(x) when min and base are both 0

public BaselineTf ( float freq ) : float
freq float
return float
        public virtual float BaselineTf(float freq)
        {
            if (0.0f == freq)
            {
                return 0.0f;
            }

            return (freq <= tf_min) ? tf_base : (float)Math.Sqrt(freq + (tf_base * tf_base) - tf_min);
        }